Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unfriendly error message when unicode is passed to package_dir or packages #190

Closed
ghost opened this issue Apr 15, 2014 · 0 comments · Fixed by #597
Closed

Unfriendly error message when unicode is passed to package_dir or packages #190

ghost opened this issue Apr 15, 2014 · 0 comments · Fixed by #597

Comments

@ghost
Copy link

ghost commented Apr 15, 2014

Originally reported by: jaraco (Bitbucket: jaraco, GitHub: jaraco)


Adding __future__.unicode_literals causes setup.py scripts to fail. In the mailman project, here is an example error when running python2 setup.py build:

running build
running build_py
Traceback (most recent call last):
  File "setup.py", line 112, in <module>
    test_suite = 'nose2.collector.collector',
  File "C:\Program Files\Python27\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "C:\Program Files\Python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Program Files\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Program Files\Python27\lib\distutils\command\build.py", line 127, in run
    self.run_command(cmd_name)
  File "C:\Program Files\Python27\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Program Files\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "build\bdist.win-amd64\egg\setuptools\command\build_py.py", line 42, in run
  File "C:\Program Files\Python27\lib\distutils\command\build_py.py", line 372, in build_packages
    self.build_module(module, module_file, package)
  File "build\bdist.win-amd64\egg\setuptools\command\build_py.py", line 60, in build_module
  File "C:\Program Files\Python27\lib\distutils\command\build_py.py", line 333, in build_module
    "'package' must be a string (dot-separated), list, or tuple")
TypeError: 'package' must be a string (dot-separated), list, or tuple

A different error occurs when using 'develop':

running develop
error: 'egg_base' must be a directory name (got `src`)

Setuptools could make this error message nicer.


benjaoming added a commit to benjaoming/setuptools that referenced this issue May 27, 2016
Problem encountered on Ubuntu 14.04

Fixes pypa#190

If people need to fix this without this patch, they have to wrap their package names in `str()` like so:

```python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals

setup(
    # ....
    package_dir=[
        str('package_name'),
    ]
)
```
benjaoming added a commit to benjaoming/setuptools that referenced this issue Jun 2, 2016
benjaoming added a commit to benjaoming/setuptools that referenced this issue Jun 2, 2016
millerdev added a commit to dimagi/commcare-cloud that referenced this issue Sep 21, 2020
jaraco added a commit that referenced this issue Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants