bpo-35802: Clean up code which checked presence of os.{stat,lstat,chmod}#11643
bpo-35802: Clean up code which checked presence of os.{stat,lstat,chmod}#11643giampaolo merged 1 commit into
Conversation
|
Hummmm, I do not feel very comfortable removing these checks. Autotools actually is checking at least for https://github.com/python/cpython/blob/master/configure.ac#L3505 |
Sorry, something went wrong.
Unless I'm reading incorrectly, it is unconditionally defined in the cpython/Modules/clinic/posixmodule.c.h Lines 68 to 69 in 7a23680 The actual implementation chooses whether to use Lines 2123 to 2170 in 7a23680 |
Sorry, something went wrong.
|
the ifdefs are a bit tricky but if |
Sorry, something went wrong.
|
Note that the os module falls back outside https://github.com/python/cpython/blob/master/Lib/os.py#L68
Nervermind, the |
Sorry, something went wrong.
|
On windows, the Lines 4 to 5 in 7a23680 |
Sorry, something went wrong.
|
Apparently, there is nothing missing in the logic that leads to clean up the code as this PR is doing, but I would like Gregory to take a look in case I am missing something :) |
Sorry, something went wrong.
giampaolo
left a comment
There was a problem hiding this comment.
LGTM (good change).
Sorry, something went wrong.
|
@gpshead @giampaolo anything left for me to do here? |
Sorry, something went wrong.
|
It was already approved. You can merge. |
Sorry, something went wrong.
|
I am a mere pleb without green-button access <3 |
Sorry, something went wrong.
|
@giampaolo: Please replace |
Sorry, something went wrong.
|
Sorry, my bad. |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot x86 Gentoo Non-Debug with X 3.x has failed when building commit 8377cd4. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/99/builds/2198 Click to see traceback logsTraceback (most recent call last):
File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_descr.py", line 4341, in test_vicious_descriptor_nonsense
self.assertEqual(c.attr, 1)
File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_descr.py", line 4328, in __eq__
del C.attr
AttributeError: attr
----------------------------------------------------------------------
Ran 140 tests in 2.449s
FAILED (errors=1, skipped=2, expected failures=2)
Traceback (most recent call last):
File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_descr.py", line 4341, in test_vicious_descriptor_nonsense
self.assertEqual(c.attr, 1)
File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_descr.py", line 4328, in __eq__
del C.attr
AttributeError: attr
----------------------------------------------------------------------
Ran 140 tests in 2.229s
FAILED (errors=1, skipped=2, expected failures=2)
|
Sorry, something went wrong.
* Clean up code which checked presence of os.{stat,lstat,chmod} (GH-11643)
(cherry picked from commit 8377cd4)
* bpo-36725: regrtest: add TestResult type (GH-12960)
* Add TestResult and MultiprocessResult types to ensure that results
always have the same fields.
* runtest() now handles KeyboardInterrupt
* accumulate_result() and format_test_result() now takes a TestResult
* cleanup_test_droppings() is now called by runtest() and mark the
test as ENV_CHANGED if the test leaks support.TESTFN file.
* runtest() now includes code "around" the test in the test timing
* Add print_warning() in test.libregrtest.utils to standardize how
libregrtest logs warnings to ease parsing the test output.
* support.unload() is now called with abstest rather than test_name
* Rename 'test' variable/parameter to 'test_name'
* dash_R(): remove unused the_module parameter
* Remove unused imports
(cherry picked from commit 4d29983)
* bpo-36725: Refactor regrtest multiprocessing code (GH-12961)
Rewrite run_tests_multiprocess() function as a new MultiprocessRunner
class with multiple methods to better report errors and stop
immediately when needed.
Changes:
* Worker processes are now killed immediately if tests are
interrupted or if a test does crash (CHILD_ERROR): worker
processes are killed.
* Rewrite how errors in a worker thread are reported to
the main thread. No longer ignore BaseException or parsing errors
silently.
* Remove 'finished' variable: use worker.is_alive() instead
* Always compute omitted tests. Add Regrtest.get_executed() method.
(cherry picked from commit 3cde440)
* bpo-36719: regrtest always detect uncollectable objects (GH-12951)
regrtest now always detects uncollectable objects. Previously, the
check was only enabled by --findleaks. The check now also works with
-jN/--multiprocess N.
--findleaks becomes a deprecated alias to --fail-env-changed.
(cherry picked from commit 75120d2)
* bpo-34060: Report system load when running test suite for Windows (GH-8357)
While Windows exposes the system processor queue length, the raw value
used for load calculations on Unix systems, it does not provide an API
to access the averaged value. Hence to calculate the load we must track
and average it ourselves. We can't use multiprocessing or a thread to
read it in the background while the tests run since using those would
conflict with test_multiprocessing and test_xxsubprocess.
Thus, we use Window's asynchronous IO API to run the tracker in the
background with it sampling at the correct rate. When we wish to access
the load we check to see if there's new data on the stream, if there is,
we update our load values.
(cherry picked from commit e16467a)
* bpo-36719: Fix regrtest re-run (GH-12964)
Properly handle a test which fail but then pass.
Add test_rerun_success() unit test.
(cherry picked from commit 837acc1)
* bpo-36719: regrtest closes explicitly WindowsLoadTracker (GH-12965)
Regrtest.finalize() now closes explicitly the WindowsLoadTracker
instance.
(cherry picked from commit 00db7c7)
https://bugs.python.org/issue35802