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 does not support pathlib #72413

Closed
ethanfurman opened this issue Sep 21, 2016 · 7 comments
Closed

compileall does not support pathlib #72413

ethanfurman opened this issue Sep 21, 2016 · 7 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@ethanfurman
Copy link
Member

BPO 28226
Nosy @brettcannon, @ned-deily, @ethanfurman, @berkerpeksag
PRs
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • Files
  • open-compileall.stoneleaf.patch
  • issue28226_v2.diff
  • issue28226_v3.diff
  • 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-10-01.01:09:49.601>
    created_at = <Date 2016-09-21.07:28:34.041>
    labels = ['3.7', 'type-bug', 'library']
    title = 'compileall does not support pathlib'
    updated_at = <Date 2017-03-31.16:36:22.058>
    user = 'https://github.com/ethanfurman'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:22.058>
    actor = 'dstufft'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-10-01.01:09:49.601>
    closer = 'berker.peksag'
    components = ['Library (Lib)']
    creation = <Date 2016-09-21.07:28:34.041>
    creator = 'ethan.furman'
    dependencies = []
    files = ['44768', '44886', '44887']
    hgrepos = []
    issue_num = 28226
    keywords = ['patch']
    message_count = 7.0
    messages = ['277392', '277736', '277773', '277774', '277775', '277777', '277784']
    nosy_count = 5.0
    nosy_names = ['brett.cannon', 'ned.deily', 'ethan.furman', 'python-dev', 'berker.peksag']
    pr_nums = ['552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue28226'
    versions = ['Python 3.6', 'Python 3.7']

    @ethanfurman ethanfurman added the type-bug An unexpected behavior, bug, or error label Sep 21, 2016
    @ned-deily ned-deily added the 3.7 (EOL) end of life label Sep 23, 2016
    @brettcannon
    Copy link
    Member

    Is there a fix for compileall missing from the patch? All I see are a new test.

    @berkerpeksag
    Copy link
    Member

    Is there a fix for compileall missing from the patch?

    No, os.path.* functions have taken care of the conversion, but the output was in the following format:

    Compiling PosixPath('/tmp/tmp_nfh98lw/_test.py')...
    

    I fixed it, added a test for the ddir argument and simplified tests a bit.

    @berkerpeksag berkerpeksag added the stdlib Python modules in the Lib dir label Sep 30, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 30, 2016

    New changeset a6f0cc1820f4 by Berker Peksag in branch '3.6':
    Issue bpo-28226: compileall now supports pathlib
    https://hg.python.org/cpython/rev/a6f0cc1820f4

    New changeset fcce24bc9416 by Berker Peksag in branch 'default':
    Issue bpo-28226: Merge from 3.6
    https://hg.python.org/cpython/rev/fcce24bc9416

    @berkerpeksag
    Copy link
    Member

    I found a similar problem in compile_dir() and fixed it in the commit.

    @ethanfurman
    Copy link
    Member Author

    Thanks, Berker Peksag!

    @ethanfurman ethanfurman removed their assignment Sep 30, 2016
    @berkerpeksag
    Copy link
    Member

    Windows buildbots didn't like a6f0cc1820f4 :) Fix is incoming.

    ======================================================================
    FAIL: test_compile_dir_pathlike (test.test_compileall.CompileallTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "D:\buildarea\3.6.ware-win81-release\build\lib\test\test_compileall.py", line 161, in test_compile_dir_pathlike
        self.assertIn("Listing '{}'...".format(self.directory), stdout.getvalue())
    AssertionError: "Listing 'D:\\temp\\tmpuziqv_kw'..." not found in "Listing 'D:\\\\temp\\\\tmpuziqv_kw'...\nListing 'D:\\\\temp\\\\tmpuziqv_kw\\\\_subdir'...\nCompiling 'D:\\\\temp\\\\tmpuziqv_kw\\\\_subdir\\\\_test3.py'...\nCompiling 'D:\\\\temp\\\\tmpuziqv_kw\\\\_test.py'...\nCompiling 'D:\\\\temp\\\\tmpuziqv_kw\\\\_test2.py'...\n"

    ======================================================================
    FAIL: test_compile_file_pathlike (test.test_compileall.CompileallTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "D:\buildarea\3.6.ware-win81-release\build\lib\test\test_compileall.py", line 111, in test_compile_file_pathlike
        "Compiling '{}'...\n".format(self.source_path))
    AssertionError: "Compiling 'D:\\\\temp\\\\tmpqvjkm0fm\\\\_test.py'...\n" != "Compiling 'D:\\temp\\tmpqvjkm0fm\\_test.py'...\n"
    - Compiling 'D:\\temp\\tmpqvjkm0fm\\_test.py'...
    ?              -     -            -
    + Compiling 'D:\temp\tmpqvjkm0fm\_test.py'...

    @berkerpeksag berkerpeksag reopened this Sep 30, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 30, 2016

    New changeset 13cd90bdcfbe by Berker Peksag in branch '3.6':
    Issue bpo-28226: Fix test_compileall on Windows
    https://hg.python.org/cpython/rev/13cd90bdcfbe

    New changeset ff80d77200ed by Berker Peksag in branch 'default':
    Issue bpo-28226: Merge from 3.6
    https://hg.python.org/cpython/rev/ff80d77200ed

    @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

    4 participants