{"record":{"id":"6d2fc8d1b7c37a41","repo":"jordansissel/fpm","slug":"found-a-content-body-in-metadata-file-but-metadat","errorCode":null,"errorMessage":"Found a content body in METADATA file, but Metadata-Version(#{headers[\"Metadata-Version\"]}) is below 2.1 and doesn't support this. This may be a bug in fpm or a malformed python package.","messagePattern":"Found a content body in METADATA file, but Metadata-Version\\(#(.+?)\\) is below 2\\.1 and doesn't support this\\. This may be a bug in fpm or a malformed python package\\.","errorType":"exception","errorClass":"FPM::Package::Python::UnexpectedContent","httpStatus":null,"severity":"error","filePath":"lib/fpm/package/python.rb","lineNumber":243,"sourceCode":"        # > RFC 822 format, any CRLF character has to be suffixed by 7 spaces\n        # > followed by a pipe (“|”) char. As a result, the Description field is\n        # > encoded into a folded field that can be interpreted by RFC822 parser [2].\n        @description = @description.gsub!(/^       |/, \"\")\n      end\n\n      if !body.nil?\n        if headers[\"Metadata-Version\"].to_f >= 2.1\n          # Per Python core-metadata spec:\n          # > Changed in version 2.1: [Description] field may be specified in the message body instead.\n          # \n          # The description is simply the rest of the METADATA file after the headers.\n          @description = body\n        elsif headers[\"Metadata-Version\"].to_f >= 2.0\n          # dnspython v1.15.0 has a description body and Metadata-Version 2.0 \n          # this seems out of spec, but let's accept it anyway.\n          @description = body\n        else\n          raise UnexpectedContent, \"Found a content body in METADATA file, but Metadata-Version(#{headers[\"Metadata-Version\"]}) is below 2.1 and doesn't support this. This may be a bug in fpm or a malformed python package.\"\n        end\n\n        # What to do if we find a description body but already have a Description field set in the headers?\n        if headers.include?(\"Description\")\n          raise \"Found a description in the body of the python package metadata, but the package already set the Description field. I don't know what to do. This is probably a bug in fpm.\"\n        end\n      end\n\n      # XXX: The description field can be markdown, plain text, or reST. \n      # Content type is noted in the \"Description-Content-Type\" field\n      # Should we transform this to plain text?\n    end # process_description\n\n    def process_license(headers)\n      # Ignore the \"License\" field if License-Expression is also present.\n      return if headers[\"Metadata-Version\"].to_f >= 2.4 && headers.include?(\"License-Expression\")\n\n      # Deprecated field, License,  as described in python core-metadata:","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package/python.rb#L225-L261","documentation":"Error \"Found a content body in METADATA file, but Metadata-Version(#{headers[\"Metadata-Version\"]}) is below 2.1 and doesn't support this. This may be a bug in fpm or a malformed python package.\" thrown in jordansissel/fpm.","triggerScenarios":"Thrown at lib/fpm/package/python.rb:243 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}