Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compileall.compile_dir(workers=<negative>) does not raise ValueError if multithreading disabled #72671

Closed
vadmium opened this issue Oct 20, 2016 · 2 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@vadmium
Copy link
Member

vadmium commented Oct 20, 2016

BPO 28485
Nosy @PCManticore, @vadmium
Files
  • mt-compile.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2016-11-05.03:05:33.390>
    created_at = <Date 2016-10-20.07:39:19.788>
    labels = ['3.7', 'type-bug', 'library']
    title = 'compileall.compile_dir(workers=<negative>) does not raise ValueError if multithreading disabled'
    updated_at = <Date 2016-11-05.03:05:33.389>
    user = 'https://github.com/vadmium'

    bugs.python.org fields:

    activity = <Date 2016-11-05.03:05:33.389>
    actor = 'martin.panter'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-11-05.03:05:33.390>
    closer = 'martin.panter'
    components = ['Library (Lib)']
    creation = <Date 2016-10-20.07:39:19.788>
    creator = 'martin.panter'
    dependencies = []
    files = ['45149']
    hgrepos = []
    issue_num = 28485
    keywords = ['patch']
    message_count = 2.0
    messages = ['279018', '280099']
    nosy_count = 3.0
    nosy_names = ['Claudiu.Popa', 'python-dev', 'martin.panter']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue28485'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    @vadmium
    Copy link
    Member Author

    vadmium commented Oct 20, 2016

    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

    @vadmium vadmium added 3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error labels Oct 20, 2016
    @berkerpeksag berkerpeksag added the stdlib Python modules in the Lib dir label Oct 31, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 5, 2016

    New changeset 532b0b9f41e0 by Martin Panter in branch '3.5':
    Issue bpo-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 bpo-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 bpo-28485: Merge single-threading fix from 3.6
    https://hg.python.org/cpython/rev/7d9885fd6777

    @vadmium vadmium closed this as completed Nov 5, 2016
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants