Skip to content

Commit

Permalink
Fix encoding issues and python discovery
Browse files Browse the repository at this point in the history
- Add spiner symbols to unicode translation map
- Update pythonfinder to master (ignore vendor update for now)
- Fixes pypa#3223
- Fixes pypa#3224

Signed-off-by: Dan Ryan <[email protected]>
  • Loading branch information
techalchemy authored and christek91 committed Nov 16, 2018
1 parent 0e2b894 commit 10cd384
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions news/3223.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an issue with attempting to render unicode output in non-unicode locales.
1 change: 1 addition & 0 deletions news/3224.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug which could cause failures to occur when parsing python entries from global pyenv version files.
4 changes: 3 additions & 1 deletion pipenv/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ def force_encoding():

UNICODE_TO_ASCII_TRANSLATION_MAP = {
8230: u"...",
8211: u"-"
8211: u"-",
10004: u"x",
10008: u"Ok"
}


Expand Down
7 changes: 4 additions & 3 deletions pipenv/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import os
import sys
from appdirs import user_cache_dir
from .vendor.vistir.misc import fs_str, to_text
from .vendor.vistir.misc import fs_str
from ._compat import fix_utf8


# HACK: avoid resolver.py uses the wrong byte code files.
Expand Down Expand Up @@ -275,6 +276,6 @@ def is_quiet(threshold=-1):
return PIPENV_VERBOSITY <= threshold


PIPENV_SPINNER_FAIL_TEXT = fs_str(to_text(u"✘ {0}")) if not PIPENV_HIDE_EMOJIS else ("{0}")
PIPENV_SPINNER_FAIL_TEXT = fix_utf8(u"✘ {0}") if not PIPENV_HIDE_EMOJIS else ("{0}")

PIPENV_SPINNER_OK_TEXT = fs_str(to_text(u"✔ {0}")) if not PIPENV_HIDE_EMOJIS else ("{0}")
PIPENV_SPINNER_OK_TEXT = fix_utf8(u"✔ {0}") if not PIPENV_HIDE_EMOJIS else ("{0}")
4 changes: 2 additions & 2 deletions pipenv/vendor/pythonfinder/models/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def get_version_order(self):
]
versions = {v.name: v for v in version_paths}
if self.is_pyenv:
version_order = [versions[v] for v in parse_pyenv_version_order()]
version_order = [versions[v] for v in parse_pyenv_version_order() if v in versions]
elif self.is_asdf:
version_order = [versions[v] for v in parse_asdf_version_order()]
version_order = [versions[v] for v in parse_asdf_version_order() if v in versions]
for version in version_order:
version_paths.remove(version)
if version_order:
Expand Down

0 comments on commit 10cd384

Please sign in to comment.