pipenv install fails with nonascii path

Created on 17 Sep 2018  路  4Comments  路  Source: pypa/pipenv

Issue description

When you try install local package from path that is not ascii you got python exception.

Run

pipenv install /home/mejty/Sta啪en茅/metallurgical_materials-0.0.0.1-py3-none-any.whl

Expected result

Instaled package

Actual result
Traceback (most recent call last):
  File "/home/mejty/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/mejty/.local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/mejty/.local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/mejty/.local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/mejty/.local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/mejty/.local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/mejty/.local/lib/python2.7/site-packages/pipenv/cli.py", line 435, in install
    selective_upgrade=selective_upgrade,
  File "/home/mejty/.local/lib/python2.7/site-packages/pipenv/core.py", line 1867, in do_install
    line = ' '.join(str(s) for s in line).strip()
  File "/home/mejty/.local/lib/python2.7/site-packages/pipenv/core.py", line 1867, in <genexpr>
    line = ' '.join(str(s) for s in line).strip()
UnicodeEncodeError: 'ascii' codec can't encode character u'\u017e' in position 15: ordinal not in range(128)
/home/mejty/.local/lib/python2.7/site-packages/pipenv/_compat.py:113: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/pipenv-aNkCcH-requirements'>
  warnings.warn(warn_message, ResourceWarning)
Steps to replicate

Install pakage from nonascii path

$ pipenv --support

Pipenv version: '2018.7.1'

Pipenv location: '/home/mejty/.local/lib/python2.7/site-packages/pipenv'

Python location: '/usr/bin/python2'

Other Python installations in PATH:

  • 2.7: /usr/bin/python2.7
  • 2.7: /usr/bin/python2.7
  • 3.6: /usr/bin/python3.6m
  • 3.6: /usr/bin/python3.6
  • 3.7: /usr/bin/python3.7m
  • 3.7: /usr/bin/python3.7

  • 2.7.15: /usr/bin/python

  • 2.7.15: /usr/bin/python2
  • 3.6.6: /usr/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.16.5-300.fc28.x86_64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Fri Apr 27 17:38:36 UTC 2018',
 'python_full_version': '2.7.15',
 'python_version': '2.7',
 'sys_platform': 'linux2'}

System environment variables:

  • SSH_ASKPASS
  • LC_NUMERIC
  • GUROBI_HOME
  • BASH_FUNC_module%%
  • PROJECT_HOME
  • GNOME_DESKTOP_SESSION_ID
  • BASH_FUNC_scl%%
  • GJS_DEBUG_OUTPUT
  • LESSOPEN
  • PYTHONDONTWRITEBYTECODE
  • XDG_CURRENT_DESKTOP
  • LC_PAPER
  • QT_IM_MODULE
  • LOGNAME
  • USER
  • HOME
  • XDG_VTNR
  • QTDIR
  • PATH
  • HISTSIZE
  • DISPLAY
  • XDG_SESSION_DESKTOP
  • LANG
  • QTLIB
  • TERM
  • SHELL
  • MODULEPATH_modshare
  • SESSION_MANAGER
  • QTINC
  • WAYLAND_DISPLAY
  • LD_LIBRARY_PATH
  • XMODIFIERS
  • MODULES_RUN_QUARANTINE
  • MODULESHOME
  • LC_MONETARY
  • USERNAME
  • WORKON_HOME
  • SHLVL
  • XDG_RUNTIME_DIR
  • MAIL
  • SSH_AUTH_SOCK
  • VTE_VERSION
  • GDMSESSION
  • BASH_FUNC__moduleraw%%
  • ENV
  • XDG_DATA_DIRS
  • PIP_PYTHON_PATH
  • BASH_ENV
  • LOADEDMODULES
  • XDG_SESSION_ID
  • DBUS_SESSION_BUS_ADDRESS
  • _
  • MODULEPATH
  • DESKTOP_SESSION
  • BASH_FUNC_switchml%%
  • GNOME_TERMINAL_SERVICE
  • XDG_SESSION_TYPE
  • XDG_SEAT
  • OLDPWD
  • HOSTNAME
  • GDM_LANG
  • GJS_DEBUG_TOPICS
  • HISTCONTROL
  • LC_MEASUREMENT
  • PWD
  • CVS_RSH
  • COLORTERM
  • XDG_MENU_PREFIX
  • LC_TIME
  • LS_COLORS
  • MODULES_CMD
  • GNOME_TERMINAL_SCREEN

Pipenv鈥搒pecific environment variables:

Debug鈥搒pecific environment variables:

  • PATH: /home/mejty/miniconda3/bin:/home/mejty/miniconda3/bin:/usr/lib64/qt-3.3/bin:/usr/share/Modules/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/mejty/.local/bin:/home/mejty/bin
  • SHELL: /bin/bash
  • LANG: cs_CZ.UTF-8
  • PWD: /home/mejty/Dokumenty/test_merica_package

Contents of Pipfile ('/home/mejty/Dokumenty/test_merica_package/Pipfile'):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[dev-packages]

[packages]
metallurgical-materials = {path = "./metallurgical_materials-0.0.0.1-py3-none-any.whl"}

[requires]
python_version = "3.6"

Contents of Pipfile.lock ('/home/mejty/Dokumenty/test_merica_package/Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "4407c9b86a8b6131dcbdfed5fbcd7edc4708a78b3618822da1fda822f29e0838"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.6"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "click": {
            "hashes": [
                "sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d",
                "sha256:f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b"
            ],
            "version": "==6.7"
        },
        "metallurgical-materials": {
            "hashes": [],
            "path": "./metallurgical_materials-0.0.0.1-py3-none-any.whl",
            "version": "==0.0.0.1"
        },
        "unidecode": {
            "hashes": [
                "sha256:72f49d3729f3d8f5799f710b97c1451c5163102e76d64d20e170aedbbd923582",
                "sha256:8c33dd588e0c9bc22a76eaa0c715a5434851f726131bd44a6c26471746efabf5"
            ],
            "version": "==1.0.22"
        }
    },
    "develop": {}
}

Type

Most helpful comment

I hate Python 2. Thanks for the report!

All 4 comments

I hate Python 2. Thanks for the report!

FYI this is also a bug in prettytoml, it is a huge pain and we need to just find a way to remove prettytoml if we want to fix it

This is fixed as of #3176 and #3177, sorry for the trouble!

@techalchemy Be noted that this issue is not related to toml parsing but Unicode support on Python 2.7.

We should keep it open.

Was this page helpful?
0 / 5 - 0 ratings