Skip to content
Myr

Fixed a bug that caused locale detection to error out on Python 3. This fixes #494

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 239e44a · Browse files · 2 files+6 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−0 removed

  • other:+6 added−0 removed

2 files+6 added−0 removed

modified:click/_unicodefun.py+5 added
62 unmodified lines
63 rv = subprocess.Popen(['locale', '-a'], stdout=subprocess.PIPE,64 stderr=subprocess.PIPE).communicate()[0]65 good_locales = set()66 has_c_utf8 = False6768 # Make sure we're operating on text here.69 if isinstance(rv, bytes):70 rv = rv.decode('ascii', 'replace')7172 for line in rv.splitlines():73 locale = line.strip()74 if locale.lower().endswith(('.utf-8', '.utf8')):75 good_locales.add(locale)
44 unmodified lines
modified:CHANGES+1 added
8 unmodified lines
9(bugfix release; unreleased)1011- Fix argument checks for interpreter invoke with `-m` and `-c`12 on Windows.13- Fixed a bug that cased locale detection to error out on Python 3.141516Version 6.217-----------
308 unmodified lines