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

non-ASCII characters in filenames break output formatting #25

Closed
mgedmin opened this issue Feb 3, 2014 · 2 comments
Closed

non-ASCII characters in filenames break output formatting #25

mgedmin opened this issue Feb 3, 2014 · 2 comments

Comments

@mgedmin
Copy link
Owner

mgedmin commented Feb 3, 2014

Same repository as #23:

$ git clone https://github.com/hhatto/autopep8
$ cd autopep8
$ check-manifest --version
check-manifest version 0.19.dev0
$ check-manifest -u
...
missing from sdist:
  ...
  test/example/é.txt
  ...
suggested MANIFEST.in rules:
  include *.bash
  include *.py
  include *.rst
  include .travis.yml
  include AUTHORS
  include LICENSE
  include Makefile
  include tox.ini
  recursive-include test *.gitignore
  recursive-include test *.py
  recursive-include test *.txt
updating MANIFEST.in
don't know how to come up with rules matching
  hooks/pre-push

and now with the updated MANIFEST.in we get a crash

$ check-manifest
listing source files under version control: 94 files and directories
copying source files to a temporary directory
building an sdist: autopep8-1.0a4.tar.gz: 92 files and directoriesTraceback (most recent call last):
  File "/home/mg/.venv/bin/check-manifest", line 9, in <module>
    load_entry_point('check-manifest==0.19.dev0', 'console_scripts', 'check-manifest')()
  File "/home/mg/src/check-manifest/check_manifest.py", line 658, in main
    update=args.update, python=args.python):
  File "/home/mg/src/check-manifest/check_manifest.py", line 594, in check_manifest
    "VCS", "sdist"))
  File "/home/mg/src/check-manifest/check_manifest.py", line 117, in format_difference
    return '\n'.join(res)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 34: ordinal not in range(128)
@mgedmin
Copy link
Owner Author

mgedmin commented Feb 3, 2014

This would be because source_files is a list of Unicode filenames including

 u'test/example/e\u0301.py',
 u'test/example/e\u0301.txt',

while sdist_files is a list of bytestrings including

 'test/example/e\xcc\x81.py',
 'test/example/e\xcc\x81.txt',

@mgedmin
Copy link
Owner Author

mgedmin commented Feb 3, 2014

Hey, check-manifest works fine on this repository if I use Python 3 ;)

@mgedmin mgedmin closed this as completed in bd21e16 Feb 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant