[New-bugs-announce] [issue38581] Crash on distutils/util.py when header variable isn't a string
Lealinux
report at bugs.python.org
Thu Oct 24 07:20:13 EDT 2019
New submission from Lealinux <bureau at lea-linux.org>:
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
----------
components: Library (Lib)
files: distutils_rfc822_escape.patch
keywords: patch
messages: 355326
nosy: Lealinux
priority: normal
severity: normal
status: open
title: Crash on distutils/util.py when header variable isn't a string
type: crash
versions: Python 3.8
Added file: https://bugs.python.org/file48676/distutils_rfc822_escape.patch
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38581>
_______________________________________
More information about the New-bugs-announce
mailing list