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

Removed non-ascii character from author string #123

Merged
merged 1 commit into from
Dec 8, 2013
Merged

Removed non-ascii character from author string #123

merged 1 commit into from
Dec 8, 2013

Conversation

monkut
Copy link
Contributor

@monkut monkut commented Dec 7, 2013

Trying to install python-social-auth on a system where the default encoding is NOT ascii or latin1, installation fails with UnicodeDecodeError.

It seems that the PKG-INFO format requires that header values are in ASCII following RFC-822. (I'm not sure, but it seems that PKG-INFO is auto-generated from this setup.py).

My appologies to Matias.

C:\Python33\Scripts>python3 pip-3.3-script.py install python-social-auth
Downloading/unpacking python-social-auth
Downloading python-social-auth-0.1.17.tar.gz (71kB): 71kB downloaded
Running setup.py egg_info for package python-social-auth

Cleaning up...
Exception:
Traceback (most recent call last):
File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\basecommand.py", line 134, in main
status = self.run(options, args)
File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\commands\install.py", line 236, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\req.py", line 1139, in prepare_files
req_to_install.assert_source_matches_version()
File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\req.py", line 394, in assert_source_matches_version
version = self.installed_version
File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\req.py", line 390, in installed_version
return self.pkg_info()['version']
File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\req.py", line 357, in pkg_info
data = self.egg_info_data('PKG-INFO')
File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\req.py", line 297, in egg_info_data
data = fp.read()
UnicodeDecodeError: 'cp932' codec can't decode byte 0xef in position 184: illegal multibyte sequence

Trying to install python-social-auth on a system where the default encoding is NOT ascii or latin1, installation fails with UnicodeDecodeError.  

It seems that the PKG-INFO format requires that header values are in ASCII following RFC-822. (I'm not sure, but it seems that PKG-INFO is auto-generated from this setup.py).

My appologies to Matias.


C:\Python33\Scripts>python3 pip-3.3-script.py install python-social-auth
Downloading/unpacking python-social-auth
  Downloading python-social-auth-0.1.17.tar.gz (71kB): 71kB downloaded
  Running setup.py egg_info for package python-social-auth

Cleaning up...
Exception:
Traceback (most recent call last):
  File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\basecommand.py", line 134, in main
    status = self.run(options, args)
  File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\commands\install.py", line 236, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\req.py", line 1139, in prepare_files
    req_to_install.assert_source_matches_version()
  File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\req.py", line 394, in assert_source_matches_version
    version = self.installed_version
  File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\req.py", line 390, in installed_version
    return self.pkg_info()['version']
  File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\req.py", line 357, in pkg_info
    data = self.egg_info_data('PKG-INFO')
  File "C:\Python33\lib\site-packages\pip-1.4.1-py3.3.egg\pip\req.py", line 297, in egg_info_data
    data = fp.read()
UnicodeDecodeError: 'cp932' codec can't decode byte 0xef in position 184: illegal multibyte sequence
@omab
Copy link
Owner

omab commented Dec 7, 2013

UTF-8 not supported?

@monkut
Copy link
Contributor Author

monkut commented Dec 8, 2013

Unfortunately, pip is using the system's native encoding, and not trying to decode via utf8.
I suppose this could be considered a bug in pip, but the PKG-INFO format seems to define ASCII as the encoding.

http://www.python.org/dev/peps/pep-0241/

The PKG-INFO file format is a single set of RFC-822 headers
parseable by the rfc822.py module.

http://www.ietf.org/rfc/rfc0822.txt

Each header field can be viewed as a single, logical line of
ASCII characters, comprising a field-name and a field-body.

@monkut
Copy link
Contributor Author

monkut commented Dec 8, 2013

I would think this would install fine on the majority of "western" machines, but this is on a japanese win7 installation.

omab added a commit that referenced this pull request Dec 8, 2013
Removed non-ascii character from author string while PEP-426 (or alternative) is not accepted
@omab omab merged commit 2435b5a into omab:master Dec 8, 2013
@omab
Copy link
Owner

omab commented Dec 8, 2013

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants