Skip to content

Commit ac45554

Browse files
Fixes utf-8 arguments and include/exclude options in Python2. (#1884)
1 parent 16a7994 commit ac45554

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/robotide/contrib/testrunner/runprofiles.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,12 @@ def delete_pressed(self):
237237
def ArgumentsPanel(self, parent):
238238
panel = wx.Panel(parent, wx.ID_ANY)
239239
label = Label(panel, label="Arguments: ")
240-
self._arguments = wx.TextCtrl(
241-
panel, wx.ID_ANY, size=(-1, -1), value=self.arguments)
240+
try:
241+
self._arguments = wx.TextCtrl(
242+
panel, wx.ID_ANY, size=(-1, -1), value=self.arguments)
243+
except UnicodeDecodeError:
244+
self._arguments = wx.TextCtrl(
245+
panel, wx.ID_ANY, size=(-1, -1), value="removed due unicode_error (delete this)")
242246
# DEBUG wxPhoenix SetToolTipString
243247
self.MySetToolTip(self._arguments,
244248
"Arguments for the test run. Arguments are space separated list.")

src/robotide/contrib/testrunner/testrunnerplugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
'SYSTEM': SYSTEM_ENCODING,
8282
'OUTPUT': OUTPUT_ENCODING}
8383

84-
#print("DEBUG: TestRunnerPlugin encoding=%s" % encoding)
84+
# print("DEBUG: TestRunnerPlugin encoding=%s" % encoding)
8585

8686
ID_RUN = wx.NewId()
8787
ID_RUNDEBUG = wx.NewId()
@@ -307,7 +307,7 @@ def OnRun(self, event):
307307
else:
308308
self._output("command: %s\n" % command, enc=False) # DEBUG on Py3 it not shows correct if tags with latin chars
309309
try:
310-
if PY2: # and IS_WINDOWS:
310+
if PY2 and IS_WINDOWS:
311311
cwd = self._get_current_working_dir() # DEBUG It fails if a directory has chinese or latin symbols
312312
cwd = cwd.encode(encoding['OUTPUT']) # DEBUG SYSTEM_ENCODING
313313
# print("DEBUG: encoded cwd: %s" % cwd)

0 commit comments

Comments
 (0)