Running attached "test_zipfile.py" on Python 3.10 will lead to the following error messages:
----------------------------------------------------------------------------------------------------
Exception ignored in: <generator object temp_dir at 0x7f13f30ff2e0>
Traceback (most recent call last):
File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 401, in temp_dir
File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 358, in rmtree
File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 322, in _rmtree
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <generator object temp_dir at 0x7f13f30bd5f0>
Traceback (most recent call last):
File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 401, in temp_dir
File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 358, in rmtree
File "/usr/local/python310/lib/python3.10/test/support/os_helper.py", line 322, in _rmtree
ImportError: sys.meta_path is None, Python is likely shutting down
----------------------------------------------------------------------------------------------------
However, if we run this program with os.system, the return value is 0 instead of 256. 0 represent no fails in this running! This is obviously incorrect.
Reproduce:
=========================================
import os
scode = os.system('python310 test_zipfile.py')
print("The system code of this execution is:", scode)
=========================================
The expected output: "The system code of this execution is: 256"
The actual output: "The system code of this execution is: 0"
Version info:
>>python310 -V
Python 3.10.0a2
>>uname -v
16.04.1-Ubuntu SMP Fri Sep 13 09:56:18 UTC 2019
|