aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2017-04-13 11:12:31 +0200
committerChristian Tismer <tismer@stackless.com>2017-04-28 12:19:53 +0000
commit9d454fbb9808a337dbcc4c9703c1359c8698fff0 (patch)
tree57674c994e8a4981be0dea02390c4f277611210a
parentfc9d8bad753aedfb7193a0f173b05d758e173a51 (diff)
Fix popenasync.py for non-Ascii characters
Some windows guy had some files with funny characters in the file names. This caused a crash because no error handling was defined. The script then got very confused and ran even into code which was for linux, barfing about a missing fcntl module, and that created a total mess, because the guy installed some funny fcntl module and got even worse errors. The simple fix was to ignore the error, which made the guy very happy. Happened with python3 on windows. Python2 does not have this issue. I’m not sure if we should continue to use this module at all? Task-number: PYSIDE-497 Change-Id: I48099a135702225c12cf7d8e62f058c50f612e5f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--popenasync.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/popenasync.py b/popenasync.py
index cfd0e13ad..eedc2fd8b 100644
--- a/popenasync.py
+++ b/popenasync.py
@@ -68,10 +68,10 @@ if mswindows:
if sys.version_info >= (3,):
# Test date should be in ascii.
def encode(s):
- return s.encode('ascii')
-
+ return s.encode('ascii', 'ignore')
+
def decode(b):
- return b.decode('ascii')
+ return b.decode('ascii', 'ignore')
else:
# Strings only; do nothing
def encode(s):