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

poetry 0.12.12 breaks pendulum install on Python 2.7 #1030

Closed
3 tasks done
joar opened this issue Apr 12, 2019 · 10 comments
Closed
3 tasks done

poetry 0.12.12 breaks pendulum install on Python 2.7 #1030

joar opened this issue Apr 12, 2019 · 10 comments

Comments

@joar
Copy link

joar commented Apr 12, 2019

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option). NOT APPLICABLE.

Issue

Complete output from command /usr/bin/python /usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpqikKQh:

Traceback (most recent call last): 
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module> 
    main() 
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py", line 197, in main 
    json_out['return_val'] = hook(**hook_input['kwargs']) 
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py", line 69, in prepare_metadata_for_build_wheel 
    return hook(metadata_directory, config_settings) 
  File "/tmp/pip-build-env-Jr9Jth/overlay/lib/python2.7/site-packages/poetry/masonry/api.py", line 49, in prepare_metadata_for_build_wheel 
    builder._write_metadata_file(f) 
  File "/tmp/pip-build-env-Jr9Jth/overlay/lib/python2.7/site-packages/poetry/masonry/builders/wheel.py", line 314, in _write_metadata_file 
    fp.write(decode(self.get_metadata_content()))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 178: ordinal not in range(128)

I suspect that fp.write(decode(self.get_metadata_content())) should be fp.write(decode(self.get_metadata_content()).encode("utf-8")) if PY2.

@joar joar changed the title Poetry breaks pendulum install on Python 2.7 poetry 0.12.12 breaks pendulum install on Python 2.7 Apr 12, 2019
@joar
Copy link
Author

joar commented Apr 12, 2019

Steps to reproduce (on python 2.7):

env LC_ALL=C pip install --no-cache -I pendulum

joar added a commit to joar/pendulum that referenced this issue Apr 12, 2019
joar added a commit to joar/pendulum that referenced this issue Apr 12, 2019
@joar
Copy link
Author

joar commented Apr 12, 2019

As I said in #1027 (comment):

I don't think it's safe to assume that the locale will always be set to UTF-8 on systems where poetry (or packages using poetry, such as pendulum) might be installed.

@vlcinsky
Copy link
Contributor

vlcinsky commented May 7, 2019

Shall be fixed by PR #1085.

@vlcinsky
Copy link
Contributor

vlcinsky commented May 8, 2019

Alternatively fixed by PR #1087 (which is extension of #1085)

@sethlivingston
Copy link

I arrived here because I can't install Maya (Datetimes for Humans) because of this error. Hope it gets merged soon and thank you for your efforts.

@vlcinsky
Copy link
Contributor

vlcinsky commented Jul 10, 2019

Can @sethlivingston check, the latest version of poetry 0.12.17 is not suffering this problem?

@sethlivingston
Copy link

I created a fresh Django Project and installed Maya without any trouble, so I believe this is fixed. Thank you!

@vlcinsky
Copy link
Contributor

@joar could you check, that the issue is resolved by latest version of poetry (0.12.17) and if so, close this issue?

@joar
Copy link
Author

joar commented Jul 16, 2019

Seems to work, thank you!

$ docker run --rm -it python:2 bash                                 
root@17722240d5a2:/# env LC_ALL=C pip install --no-cache -I pendulum
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting pendulum
  Downloading https://files.pythonhosted.org/packages/e0/f9/ea90c2c8f0d9b6a733f6231fac6d07476b68271bcf02bab0053888ea0fb3/pendulum-2.0.5.tar.gz (77kB)
     |████████████████████████████████| 81kB 9.5MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Collecting pytzdata>=2018.3 (from pendulum)
  Downloading https://files.pythonhosted.org/packages/bc/42/b865341e34066b9f3c806f7c461189b6a3cf367fec2d10d01900e8ba7afd/pytzdata-2019.2-py2.py3-none-any.whl (489kB)
     |████████████████████████████████| 491kB 8.2MB/s 
Collecting typing<4.0,>=3.6; python_version < "3.5" (from pendulum)
  Downloading https://files.pythonhosted.org/packages/79/be/e43ccd1317f483e14de507787322c74092a688707d02fa5f16562270eb63/typing-3.7.4-py2-none-any.whl
Collecting python-dateutil<3.0,>=2.6 (from pendulum)
  Downloading https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl (226kB)
     |████████████████████████████████| 235kB 10.1MB/s 
Collecting six>=1.5 (from python-dateutil<3.0,>=2.6->pendulum)
  Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Building wheels for collected packages: pendulum
  Building wheel for pendulum (PEP 517) ... done
  Stored in directory: /tmp/pip-ephem-wheel-cache-x2ER6s/wheels/f2/f2/8e/9ceeb2d4dceb9fb0b80baf6445d5ce3dac4bf1868c93a31e83
Successfully built pendulum
Installing collected packages: pytzdata, typing, six, python-dateutil, pendulum
Successfully installed pendulum-2.0.5 python-dateutil-2.8.0 pytzdata-2019.2 six-1.12.0 typing-3.7.4

@joar joar closed this as completed Jul 16, 2019
Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants