This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: compileall.compile_dir(workers=) does not raise ValueError if multithreading disabled
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Claudiu.Popa, martin.panter, python-dev
Priority: normal Keywords: patch

Created on 2016-10-20 07:39 by martin.panter, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mt-compile.patch martin.panter, 2016-10-20 07:39 review
Messages (2)
msg279018 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-10-20 07:39
According to the documentation and tests, a negative value for the “workers” parameter to compileall.compile_dir() should trigger ValueError. But if Python is built with “configure --without-threads”, the parameter is not checked. So I propose a patch to fix the implementation.

======================================================================
FAIL: test_compile_workers_non_positive (test.test_compileall.CompileallTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/proj/python/cpython/Lib/test/test_compileall.py", line 172, in test_compile_workers_non_positive
    compileall.compile_dir(self.directory, workers=-1)
AssertionError: ValueError not raised
msg280099 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-11-05 02:23
New changeset 532b0b9f41e0 by Martin Panter in branch '3.5':
Issue #28485: Check for negative workers even without ProcessPoolExecutor
https://hg.python.org/cpython/rev/532b0b9f41e0

New changeset a7c76c3843af by Martin Panter in branch '3.6':
Issue #28485: Merge single-threading fix from 3.5 into 3.6
https://hg.python.org/cpython/rev/a7c76c3843af

New changeset 7d9885fd6777 by Martin Panter in branch 'default':
Issue #28485: Merge single-threading fix from 3.6
https://hg.python.org/cpython/rev/7d9885fd6777
History
Date User Action Args
2022-04-11 14:58:38adminsetgithub: 72671
2016-11-05 03:05:33martin.pantersetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2016-11-05 02:23:46python-devsetnosy: + python-dev
messages: + msg280099
2016-10-31 12:23:29berker.peksagsetcomponents: + Library (Lib)
stage: patch review -> commit review
2016-10-20 07:39:19martin.pantercreate