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.

Title: distutils fails with UnicodeEncodeError with strange filename in package_data
Type: crash Stage: resolved
Components: Distutils Versions: Python 3.6
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: dstufft, eric.araujo, scjody, steve.dower
Priority: normal Keywords:

Created on 2019-02-01 15:24 by scjody, last changed 2022-04-11 14:59 by admin. This issue is now closed.

File name Uploaded Description Edit scjody, 2019-02-01 15:24 for minimal reproduction
Messages (2)
msg334687 - (view) Author: Jody McIntyre (scjody) Date: 2019-02-01 15:24
I encountered an error while installing savReaderWriter using pip from a Dockerfile, reported as

This is actually an issue with distutils.

Steps to reproduce:

1. Create the following tree. is as attached. The .sav file is empty.

./savReaderWriter/test_data/scheiß Encoding.sav

2. Run LANG=C python install --record=/tmp/install-record.txt --single-version-externally-managed

Actual output:

running install
running build
running build_py
package init file 'savReaderWriter/' not found (or not a regular file)
creating build
creating build/lib
creating build/lib/savReaderWriter
creating build/lib/savReaderWriter/test_data
copying savReaderWriter/test_data/scheiß Encoding.sav -> build/lib/savReaderWriter/test_data
running install_lib
running install_egg_info
running egg_info
creating savReaderWriter.egg-info
writing savReaderWriter.egg-info/PKG-INFO
writing dependency_links to savReaderWriter.egg-info/dependency_links.txt
writing top-level names to savReaderWriter.egg-info/top_level.txt
writing manifest file 'savReaderWriter.egg-info/SOURCES.txt'
'savReaderWriter/test_data/schei\udcc3\udc9f Encoding.sav' not utf-8 encodable -- skipping
reading manifest file 'savReaderWriter.egg-info/SOURCES.txt'
writing manifest file 'savReaderWriter.egg-info/SOURCES.txt'
removing '/home/scjody/.pyenv/versions/3.6.5/lib/python3.6/site-packages/savReaderWriter-1.2.3-py3.6.egg-info' (and everything under it)
Copying savReaderWriter.egg-info to /home/scjody/.pyenv/versions/3.6.5/lib/python3.6/site-packages/savReaderWriter-1.2.3-py3.6.egg-info
running install_scripts
writing list of installed files to '/tmp/install-record.txt'
Traceback (most recent call last):
  File "", line 9, in <module>
  File "/home/scjody/.pyenv/versions/3.6.5/lib/python3.6/site-packages/setuptools/", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/home/scjody/.pyenv/versions/3.6.5/lib/python3.6/distutils/", line 148, in setup
  File "/home/scjody/.pyenv/versions/3.6.5/lib/python3.6/distutils/", line 955, in run_commands
  File "/home/scjody/.pyenv/versions/3.6.5/lib/python3.6/distutils/", line 974, in run_command
  File "/home/scjody/.pyenv/versions/3.6.5/lib/python3.6/site-packages/setuptools/command/", line 61, in run
  File "/home/scjody/.pyenv/versions/3.6.5/lib/python3.6/distutils/command/", line 572, in run
  File "/home/scjody/.pyenv/versions/3.6.5/lib/python3.6/distutils/", line 335, in execute
    util.execute(func, args, msg, dry_run=self.dry_run)
  File "/home/scjody/.pyenv/versions/3.6.5/lib/python3.6/distutils/", line 301, in execute
  File "/home/scjody/.pyenv/versions/3.6.5/lib/python3.6/distutils/", line 236, in write_file
    f.write(line + "\n")
UnicodeEncodeError: 'ascii' codec can't encode characters in position 94-95: ordinal not in range(128)

Expected results:

The package is installed and install-record.txt is created.

msg386313 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:16
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at
Date User Action Args
2022-04-11 14:59:10adminsetgithub: 80063
2021-02-03 18:16:26steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386313

resolution: out of date
stage: resolved
2019-02-01 15:24:51scjodycreate