Message316949
Multiprocessing on Windows is supposed to start child processes using
the same sys.flags as the current process (see issue 12098).
However, at least sys.flags.tabcheck is not propagated.
I've attached small test program that reproduces this bug.
On Linux, as expected, it fails with TabError if you use -tt:
$ python -tt test-tabcheck.py
Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 267, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "test-tabcheck.py", line 6, in test_ast_parse
ast.parse('if 1:\n\t1\n' + '\x20' * 8 +'1')
File "/usr/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 3
1
^
TabError: inconsistent use of tabs and spaces in indentation
But it doesn't on Windows:
>python -tt test-tabcheck.py
Process Process-1:
Traceback (most recent call last):
File "C:\Python27\lib\multiprocessing\process.py", line 267, in _bootstrap
self.run()
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "...\test-tabcheck.py", line 7, in test_ast_parse
assert sys.flags.tabcheck == expected_tabcheck, 'sys.flags.tabcheck == {0} != {1}'.format(sys.flags.tabcheck, expected_tabcheck)
AssertionError: sys.flags.tabcheck == 0 != 2
This was tested with Python 2.7.15. |
|
Date |
User |
Action |
Args |
2018-05-17 15:38:07 | jwilk | set | recipients:
+ jwilk, paul.moore, tim.golden, zach.ware, steve.dower |
2018-05-17 15:38:07 | jwilk | set | messageid: <1526571487.53.0.682650639539.issue33557@psf.upfronthosting.co.za> |
2018-05-17 15:38:07 | jwilk | link | issue33557 messages |
2018-05-17 15:38:07 | jwilk | create | |
|