Skip to content

Commit

Permalink
Windows doesn't like Unicode arguments to subprocess.Popen()
Browse files Browse the repository at this point in the history
I'm actually surprised -- don't all the Win32 APIs have Unicode
versions?  Eh, Python.

Related to issue #23.
  • Loading branch information
mgedmin committed Feb 3, 2014
1 parent bd21e16 commit ec64db7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,9 @@ def test_zest_releaser_check_failure_user_plods_on(self, check_manifest,
class VCSHelper(object):

def _run(self, *command):
# Windows doesn't like Unicode arguments to subprocess.Popen():
# https://github.com/mgedmin/check-manifest/issues/23#issuecomment-33933031
command = [s.encode(locale.getpreferredencoding()) for s in command]
p = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stdout, stderr = p.communicate()
Expand Down

0 comments on commit ec64db7

Please sign in to comment.