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

UnicodeDecodeError when installing #49

Closed
sacrophyte opened this issue Sep 1, 2017 · 12 comments
Closed

UnicodeDecodeError when installing #49

sacrophyte opened this issue Sep 1, 2017 · 12 comments
Assignees
Labels

Comments

@sacrophyte
Copy link

sacrophyte commented Sep 1, 2017

Fresh install of Anaconda and git command line.

Sorry if this is a simple problem, I am getting started on a couple different levels, so most of the messages below do not mean much to me.

(C:\Users\sac\AppData\Local\Continuum\Anaconda3\envs\scopus) C:\Users\sac>pip install git+git://github.com/scopus-api/scopus
Collecting git+git://github.com/scopus-api/scopus
Cloning git://github.com/scopus-api/scopus to c:\users\sac\appdata\local\temp\1\pip-qwjphy1x-build

Complete output from command python setup.py egg_info:

Installed c:\users\sac\appdata\local\temp\1\pip-qwjphy1x-build\.eggs\pbr-3.1.1-py3.6.egg
[pbr] Generating ChangeLog
ERROR:root:Error parsing
Traceback (most recent call last):
  File "c:\users\sac\appdata\local\temp\1\pip-qwjphy1x-build\.eggs\pbr-3.1.1-py3.6.egg\pbr\core.py", line 111, in pbr
    attrs = util.cfg_to_args(path, dist.script_args)
  File "c:\users\sac\appdata\local\temp\1\pip-qwjphy1x-build\.eggs\pbr-3.1.1-py3.6.egg\pbr\util.py", line 251, in cfg_to_args
    kwargs = setup_cfg_to_setup_kwargs(config, script_args)
  File "c:\users\sac\appdata\local\temp\1\pip-qwjphy1x-build\.eggs\pbr-3.1.1-py3.6.egg\pbr\util.py", line 315, in setup_cfg_to_setup_kwa
    value += description_file.read().strip() + '\n\n'
  File "C:\Users\sac\AppData\Local\Continuum\Anaconda3\envs\scopus\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 23899: character maps to <undefined>
error in setup command: Error parsing C:\Users\sac\AppData\Local\Temp\1\pip-qwjphy1x-build\setup.cfg: UnicodeDecodeError: 'charmap' code
code byte 0x81 in position 23899: character maps to <undefined>

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\sac\AppData\Local\Temp\1\pip-qwjphy1x-build\`
@Michael-E-Rose
Copy link
Contributor

Hi! Seems like a similar problem to #41. If are on a mac, can you try the solution proposed here?
If not, are you able to install other packages?

@sacrophyte
Copy link
Author

Macs use c:\ ?? :) I am not on a Mac, this is Windows 7. I have not tried to install any other packages via pip, yet. Let me hunt one down....

@Michael-E-Rose
Copy link
Contributor

Out of curiosity: Could you solve the issue and install scopus?

@sacrophyte
Copy link
Author

I am now trying on a different computer, but with the same symptoms. pip install clock works just fine; pip install scopus gives me errors (see attached utf-8 text file)

pip_install_scopus_unicode_error.txt

@sacrophyte
Copy link
Author

Here is something else that I find odd. cp1252.py is not in this github repository, but yet I have it on my computer now; when I run pip install scopus, does it not install from this repository?

I have a little knowledge of character sets, and I know 1252 is specific to Windows, so that makes sense. I think the error refers to this line:
'\ufffe' # 0x81 -> UNDEFINED

But I have no idea why.

cp1252_py.txt

@Michael-E-Rose
Copy link
Contributor

That's really a riddle to me - tomorrow I have the opportunity to test on a Windows machine.

It looks like it complains about setup.cfg, but I really can't spot a non-ASCII character that might cause the error.

And no, pip install scopus installs from PyPI, the Python Project Inventory. It's a stable version. If you install from the GitHub repo without further specifications it installs the current development version, which might be unstable.

@sacrophyte
Copy link
Author

I think setup.cfg might be calling cp1252.py, which is why I was curious where cp1252.py comes from. It is not listed in this repository, but somehow I have it on my PC in the scopus folder.

@sacrophyte
Copy link
Author

Is pbr compliant with Python 3?

@Michael-E-Rose
Copy link
Contributor

I can replicate the error on a Windows machine. I am looking for a solution now. It is not because of pbr, which I could successfully install.

@Michael-E-Rose Michael-E-Rose self-assigned this Sep 3, 2017
@Michael-E-Rose
Copy link
Contributor

The error was introduced after 0.2.1. So you can install scopus0.2.1 with pip install scopus=0.2.1.

But I would like to ask to help me hunt down the bug because I cannot on my Windows machine. The way to do this is to install commits between
0.2.1 and 0.3 - the one commit that breaks contains the bug. These commits are

  • 48aa46af4276187972e74605ba73e40e2ab8cea8
  • 2d9712f8895fc14f9c4bd785e08f883a9b3b45b0
  • `143805b8a01006a97a90b2b02437851cc68426ce
  • e27facc4c8a789a71b59d22bb6cbc6fc7225242a
  • 8c67b3ff5737d8c7600a22e038d20b66c09d5625
  • 18dd5a8f2221c33bc24eb41d71c9e05f8b0029e4
  • d04a15e240defe4968f3aef239ab35ad27dc272e
  • 2d6d360573e4860a20449533f141559b9b0323b1
  • 74f96b5f96ec0ce05a66db830014a840649f6a97

To install a specific commit, use pip install git+git://github.com/scopus-api/scopus.git@COMMIT. I expect the last one to break and the others to work. This would indicate that switching to pbr for project management introduced the bug.

Thanks in advance!

@sacrophyte
Copy link
Author

Michael,

Well, that was definitely interesting. :) And you hit the nail on the head - all the commits work except the last one (see attached utf8 text file).
scopus_bug_hunting.txt

@Michael-E-Rose
Copy link
Contributor

I found the problem. It was in README.org which is the "description-file" mentioned in your traceback. It is being parsed by pbr while installing. In the usage examples, the name of one co-author is Áshildur which can't translate in encoding cp1252.

I removed the examples from the README in bd558c7 - it is in the examples in the docs anyways.

You should now be able to install the current version (0.4.4) via pip install scopus --upgrade. Many thanks for reporting this annoying issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants