This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Lealinux
Recipients Lealinux
Date 2019-10-24.11:20:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1571916013.0.0.277609072879.issue38581@roundup.psfhosted.org>
In-reply-to
Content
Hello,

With some pip3 package, distutils could crash if variable "header" isn't a real string variable :

--------------------------------

$ pip3 install bzr
Collecting bzr
  Using cached https://files.pythonhosted.org/packages/62/3a/81325e34bcc78f67cc33dfac64f44e7c8329d4481dec1b789267b98644c3/bzr-2.7.0.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: running egg_info
    creating pip-egg-info/bzr.egg-info
    writing pip-egg-info/bzr.egg-info/PKG-INFO
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "pip-install/bzr/setup.py", line 781, in <module>
        setup(**ARGS)
      File "distutils/core.py", line 148, in setup
        dist.run_commands()
      File "distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "setuptools/command/egg_info.py", line 289, in run
        writer(self, ep.name, os.path.join(self.egg_info, ep.name))
      File "setuptools/command/egg_info.py", line 621, in write_pkg_info
        metadata.write_pkg_info(cmd.egg_info)
      File "distutils/dist.py", line 1117, in write_pkg_info
        self.write_pkg_file(pkg_info)
      File "setuptools/dist.py", line 165, in write_pkg_file
        long_desc = rfc822_escape(self.get_long_description())
      File "distutils/util.py", line 470, in rfc822_escape
        lines = header.split('\n')
    TypeError: a bytes-like object is required, not 'str'

-----------------------------

On this case (bzr), "header" is a bytes-like object.

On attachment, a patch proposal to have a (possible) solution


PS: newbie on python-core-patching and python-bug-report, sorry if we have missed something
History
Date User Action Args
2019-10-24 11:20:13Lealinuxsetrecipients: + Lealinux
2019-10-24 11:20:12Lealinuxsetmessageid: <1571916013.0.0.277609072879.issue38581@roundup.psfhosted.org>
2019-10-24 11:20:12Lealinuxlinkissue38581 messages
2019-10-24 11:20:12Lealinuxcreate