Bug 1531672 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Workaround for Python BUG https://bugs.python.org/issue32745 - ctypes string pointer fields should accept embedded null characters
Which affects our possibility to run mozprocess on versions of Python higher than 3.5.3

More details can be found also in https://bugzilla.mozilla.org/show_bug.cgi?id=1428713#c49

Run tests command: ./mach python-test --python=3.6 testing/mozbase/mozrunner/tests/test_start.py

The error is happening at line: https://searchfox.org/mozilla-central/source/testing/mozbase/mozprocess/mozprocess/winprocess.py#167

Stacktrace:

self = <mozprocess.winprocess.EnvironmentBlock object at 0x000001D54F83D470>
 1:24.03 env = {b'!EXITCODE': b'00000001', b'ALLUSERSPROFILE': b'C:\\ProgramData', b'APPDATA': b'C:\\Users\\AH\\AppData\\Roaming', b'COMMONPROGRAMFILES': b'C:\\Program Files\\Common Files', ...}
 1:24.05
 1:24.06     def __init__(self, env):
 1:24.06         if not env:
 1:24.08             self._as_parameter_ = None
 1:24.08         else:
 1:24.09             values = []
 1:24.09             fs_encoding = sys.getfilesystemencoding() or 'mbcs'
 1:24.11             for k, v in env.items():
 1:24.11                 if isinstance(k, bytes):
 1:24.12                     k = k.decode(fs_encoding, 'replace')
 1:24.12                 if isinstance(v, bytes):
 1:24.14                     v = v.decode(fs_encoding, 'replace')
 1:24.14                 values.append("{}={}".format(k, v))
 1:24.14             values.append("")
 1:24.16 >           self._as_parameter_ = LPCWSTR("\0".join(values))
 1:24.17 E           ValueError: embedded null character
 1:24.17
 1:24.19 testing\mozbase\mozprocess\mozprocess\winprocess.py:167: ValueError
 1:24.19
 1:24.19 During handling of the above exception, another exception occurred:
 1:24.20
 1:24.20 runner = <mozrunner.base.browser.GeckoRuntimeRunner object at 0x000001D54F6D1240>
 1:24.20
 1:24.22     def test_start_with_outputTimeout(runner):
 1:24.22         """Start the process and set a timeout"""
 1:24.23 >       runner.start(outputTimeout=0.1)
 1:24.23
 1:24.23 testing\mozbase\mozrunner\tests\test_start.py:45:
 1:24.27 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 1:24.27 testing\mozbase\mozrunner\mozrunner\base\browser.py:85: in start
 1:24.27     BaseRunner.start(self, *args, **kwargs)
 1:24.27 testing\mozbase\mozrunner\mozrunner\base\runner.py:141: in start
 1:24.28     reraise(RunnerNotStartedError, "Failed to start the process: %s" % value, tb)
 1:24.28 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 1:24.28
 1:24.28 tp = <class 'mozrunner.errors.RunnerNotStartedError'>
 1:24.28 value = 'Failed to start the process: embedded null character'
 1:24.28 tb = <traceback object at 0x000001D54F6ECBC8>
 1:24.28
 1:24.28     def reraise(tp, value, tb=None):
 1:24.28         if value is None:
 1:24.28             value = tp()
 1:24.28 >       if value.__traceback__ is not tb:
 1:24.28 E       AttributeError: 'str' object has no attribute '__traceback__'
Workaround for Python BUG https://bugs.python.org/issue32745 - ctypes string pointer fields should accept embedded null characters
Which affects our possibility to run mozprocess on versions of Python higher than 3.5.3

More details can be found also in https://bugzilla.mozilla.org/show_bug.cgi?id=1428713#c49

Run tests command: ./mach python-test --python=3.6 testing/mozbase/mozrunner/tests/test_start.py

The error is happening at line: https://searchfox.org/mozilla-central/source/testing/mozbase/mozprocess/mozprocess/winprocess.py#167

Stacktrace:
```
self = <mozprocess.winprocess.EnvironmentBlock object at 0x000001D54F83D470>
 1:24.03 env = {b'!EXITCODE': b'00000001', b'ALLUSERSPROFILE': b'C:\\ProgramData', b'APPDATA': b'C:\\Users\\AH\\AppData\\Roaming', b'COMMONPROGRAMFILES': b'C:\\Program Files\\Common Files', ...}
 1:24.05
 1:24.06     def __init__(self, env):
 1:24.06         if not env:
 1:24.08             self._as_parameter_ = None
 1:24.08         else:
 1:24.09             values = []
 1:24.09             fs_encoding = sys.getfilesystemencoding() or 'mbcs'
 1:24.11             for k, v in env.items():
 1:24.11                 if isinstance(k, bytes):
 1:24.12                     k = k.decode(fs_encoding, 'replace')
 1:24.12                 if isinstance(v, bytes):
 1:24.14                     v = v.decode(fs_encoding, 'replace')
 1:24.14                 values.append("{}={}".format(k, v))
 1:24.14             values.append("")
 1:24.16 >           self._as_parameter_ = LPCWSTR("\0".join(values))
 1:24.17 E           ValueError: embedded null character
 1:24.17
 1:24.19 testing\mozbase\mozprocess\mozprocess\winprocess.py:167: ValueError
 1:24.19
 1:24.19 During handling of the above exception, another exception occurred:
 1:24.20
 1:24.20 runner = <mozrunner.base.browser.GeckoRuntimeRunner object at 0x000001D54F6D1240>
 1:24.20
 1:24.22     def test_start_with_outputTimeout(runner):
 1:24.22         """Start the process and set a timeout"""
 1:24.23 >       runner.start(outputTimeout=0.1)
 1:24.23
 1:24.23 testing\mozbase\mozrunner\tests\test_start.py:45:
 1:24.27 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 1:24.27 testing\mozbase\mozrunner\mozrunner\base\browser.py:85: in start
 1:24.27     BaseRunner.start(self, *args, **kwargs)
 1:24.27 testing\mozbase\mozrunner\mozrunner\base\runner.py:141: in start
 1:24.28     reraise(RunnerNotStartedError, "Failed to start the process: %s" % value, tb)
 1:24.28 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 1:24.28
 1:24.28 tp = <class 'mozrunner.errors.RunnerNotStartedError'>
 1:24.28 value = 'Failed to start the process: embedded null character'
 1:24.28 tb = <traceback object at 0x000001D54F6ECBC8>
 1:24.28
 1:24.28     def reraise(tp, value, tb=None):
 1:24.28         if value is None:
 1:24.28             value = tp()
 1:24.28 >       if value.__traceback__ is not tb:
 1:24.28 E       AttributeError: 'str' object has no attribute '__traceback__'
```
Workaround for Python BUG https://bugs.python.org/issue32745 - ctypes string pointer fields should accept embedded null characters
Which affects our possibility to run mozprocess on versions of Python higher than 3.5.3

More details can be found also in previous Mozprocess BUG https://bugzilla.mozilla.org/show_bug.cgi?id=1428713#c49

Run tests command: ./mach python-test --python=3.6 testing/mozbase/mozrunner/tests/test_start.py

The error is happening at line: https://searchfox.org/mozilla-central/source/testing/mozbase/mozprocess/mozprocess/winprocess.py#167

Stacktrace:
```
self = <mozprocess.winprocess.EnvironmentBlock object at 0x000001D54F83D470>
 1:24.03 env = {b'!EXITCODE': b'00000001', b'ALLUSERSPROFILE': b'C:\\ProgramData', b'APPDATA': b'C:\\Users\\AH\\AppData\\Roaming', b'COMMONPROGRAMFILES': b'C:\\Program Files\\Common Files', ...}
 1:24.05
 1:24.06     def __init__(self, env):
 1:24.06         if not env:
 1:24.08             self._as_parameter_ = None
 1:24.08         else:
 1:24.09             values = []
 1:24.09             fs_encoding = sys.getfilesystemencoding() or 'mbcs'
 1:24.11             for k, v in env.items():
 1:24.11                 if isinstance(k, bytes):
 1:24.12                     k = k.decode(fs_encoding, 'replace')
 1:24.12                 if isinstance(v, bytes):
 1:24.14                     v = v.decode(fs_encoding, 'replace')
 1:24.14                 values.append("{}={}".format(k, v))
 1:24.14             values.append("")
 1:24.16 >           self._as_parameter_ = LPCWSTR("\0".join(values))
 1:24.17 E           ValueError: embedded null character
 1:24.17
 1:24.19 testing\mozbase\mozprocess\mozprocess\winprocess.py:167: ValueError
 1:24.19
 1:24.19 During handling of the above exception, another exception occurred:
 1:24.20
 1:24.20 runner = <mozrunner.base.browser.GeckoRuntimeRunner object at 0x000001D54F6D1240>
 1:24.20
 1:24.22     def test_start_with_outputTimeout(runner):
 1:24.22         """Start the process and set a timeout"""
 1:24.23 >       runner.start(outputTimeout=0.1)
 1:24.23
 1:24.23 testing\mozbase\mozrunner\tests\test_start.py:45:
 1:24.27 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 1:24.27 testing\mozbase\mozrunner\mozrunner\base\browser.py:85: in start
 1:24.27     BaseRunner.start(self, *args, **kwargs)
 1:24.27 testing\mozbase\mozrunner\mozrunner\base\runner.py:141: in start
 1:24.28     reraise(RunnerNotStartedError, "Failed to start the process: %s" % value, tb)
 1:24.28 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 1:24.28
 1:24.28 tp = <class 'mozrunner.errors.RunnerNotStartedError'>
 1:24.28 value = 'Failed to start the process: embedded null character'
 1:24.28 tb = <traceback object at 0x000001D54F6ECBC8>
 1:24.28
 1:24.28     def reraise(tp, value, tb=None):
 1:24.28         if value is None:
 1:24.28             value = tp()
 1:24.28 >       if value.__traceback__ is not tb:
 1:24.28 E       AttributeError: 'str' object has no attribute '__traceback__'
```
Workaround for Python BUG https://bugs.python.org/issue32745 - ctypes string pointer fields should accept embedded null characters; Which affects our possibility to run mozprocess on versions of Python higher than 3.5.3

More details can be found also in previous Mozprocess BUG https://bugzilla.mozilla.org/show_bug.cgi?id=1428713#c49

Run tests command: ./mach python-test --python=3.6 testing/mozbase/mozrunner/tests/test_start.py

The error is happening at line: https://searchfox.org/mozilla-central/source/testing/mozbase/mozprocess/mozprocess/winprocess.py#167

Stacktrace:
```
self = <mozprocess.winprocess.EnvironmentBlock object at 0x000001D54F83D470>
 1:24.03 env = {b'!EXITCODE': b'00000001', b'ALLUSERSPROFILE': b'C:\\ProgramData', b'APPDATA': b'C:\\Users\\AH\\AppData\\Roaming', b'COMMONPROGRAMFILES': b'C:\\Program Files\\Common Files', ...}
 1:24.05
 1:24.06     def __init__(self, env):
 1:24.06         if not env:
 1:24.08             self._as_parameter_ = None
 1:24.08         else:
 1:24.09             values = []
 1:24.09             fs_encoding = sys.getfilesystemencoding() or 'mbcs'
 1:24.11             for k, v in env.items():
 1:24.11                 if isinstance(k, bytes):
 1:24.12                     k = k.decode(fs_encoding, 'replace')
 1:24.12                 if isinstance(v, bytes):
 1:24.14                     v = v.decode(fs_encoding, 'replace')
 1:24.14                 values.append("{}={}".format(k, v))
 1:24.14             values.append("")
 1:24.16 >           self._as_parameter_ = LPCWSTR("\0".join(values))
 1:24.17 E           ValueError: embedded null character
 1:24.17
 1:24.19 testing\mozbase\mozprocess\mozprocess\winprocess.py:167: ValueError
 1:24.19
 1:24.19 During handling of the above exception, another exception occurred:
 1:24.20
 1:24.20 runner = <mozrunner.base.browser.GeckoRuntimeRunner object at 0x000001D54F6D1240>
 1:24.20
 1:24.22     def test_start_with_outputTimeout(runner):
 1:24.22         """Start the process and set a timeout"""
 1:24.23 >       runner.start(outputTimeout=0.1)
 1:24.23
 1:24.23 testing\mozbase\mozrunner\tests\test_start.py:45:
 1:24.27 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 1:24.27 testing\mozbase\mozrunner\mozrunner\base\browser.py:85: in start
 1:24.27     BaseRunner.start(self, *args, **kwargs)
 1:24.27 testing\mozbase\mozrunner\mozrunner\base\runner.py:141: in start
 1:24.28     reraise(RunnerNotStartedError, "Failed to start the process: %s" % value, tb)
 1:24.28 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 1:24.28
 1:24.28 tp = <class 'mozrunner.errors.RunnerNotStartedError'>
 1:24.28 value = 'Failed to start the process: embedded null character'
 1:24.28 tb = <traceback object at 0x000001D54F6ECBC8>
 1:24.28
 1:24.28     def reraise(tp, value, tb=None):
 1:24.28         if value is None:
 1:24.28             value = tp()
 1:24.28 >       if value.__traceback__ is not tb:
 1:24.28 E       AttributeError: 'str' object has no attribute '__traceback__'
```
Workaround for Python BUG https://bugs.python.org/issue32745 - ctypes string pointer fields should accept embedded null characters; 
Which affects our possibility to run mozprocess on versions of Python higher than 3.5.3

More details can be found also in previous Mozprocess BUG https://bugzilla.mozilla.org/show_bug.cgi?id=1428713#c49

Run tests command: ./mach python-test --python=3.6 testing/mozbase/mozrunner/tests/test_start.py

The error is happening at line: https://searchfox.org/mozilla-central/source/testing/mozbase/mozprocess/mozprocess/winprocess.py#167

Stacktrace:
```
self = <mozprocess.winprocess.EnvironmentBlock object at 0x000001D54F83D470>
 1:24.03 env = {b'!EXITCODE': b'00000001', b'ALLUSERSPROFILE': b'C:\\ProgramData', b'APPDATA': b'C:\\Users\\AH\\AppData\\Roaming', b'COMMONPROGRAMFILES': b'C:\\Program Files\\Common Files', ...}
 1:24.05
 1:24.06     def __init__(self, env):
 1:24.06         if not env:
 1:24.08             self._as_parameter_ = None
 1:24.08         else:
 1:24.09             values = []
 1:24.09             fs_encoding = sys.getfilesystemencoding() or 'mbcs'
 1:24.11             for k, v in env.items():
 1:24.11                 if isinstance(k, bytes):
 1:24.12                     k = k.decode(fs_encoding, 'replace')
 1:24.12                 if isinstance(v, bytes):
 1:24.14                     v = v.decode(fs_encoding, 'replace')
 1:24.14                 values.append("{}={}".format(k, v))
 1:24.14             values.append("")
 1:24.16 >           self._as_parameter_ = LPCWSTR("\0".join(values))
 1:24.17 E           ValueError: embedded null character
 1:24.17
 1:24.19 testing\mozbase\mozprocess\mozprocess\winprocess.py:167: ValueError
 1:24.19
 1:24.19 During handling of the above exception, another exception occurred:
 1:24.20
 1:24.20 runner = <mozrunner.base.browser.GeckoRuntimeRunner object at 0x000001D54F6D1240>
 1:24.20
 1:24.22     def test_start_with_outputTimeout(runner):
 1:24.22         """Start the process and set a timeout"""
 1:24.23 >       runner.start(outputTimeout=0.1)
 1:24.23
 1:24.23 testing\mozbase\mozrunner\tests\test_start.py:45:
 1:24.27 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 1:24.27 testing\mozbase\mozrunner\mozrunner\base\browser.py:85: in start
 1:24.27     BaseRunner.start(self, *args, **kwargs)
 1:24.27 testing\mozbase\mozrunner\mozrunner\base\runner.py:141: in start
 1:24.28     reraise(RunnerNotStartedError, "Failed to start the process: %s" % value, tb)
 1:24.28 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 1:24.28
 1:24.28 tp = <class 'mozrunner.errors.RunnerNotStartedError'>
 1:24.28 value = 'Failed to start the process: embedded null character'
 1:24.28 tb = <traceback object at 0x000001D54F6ECBC8>
 1:24.28
 1:24.28     def reraise(tp, value, tb=None):
 1:24.28         if value is None:
 1:24.28             value = tp()
 1:24.28 >       if value.__traceback__ is not tb:
 1:24.28 E       AttributeError: 'str' object has no attribute '__traceback__'
```

Back to Bug 1531672 Comment 0