GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — compile_file's stripdir does not accept pathlib.Path · Issue #84627 · python/cpython

compile_file's stripdir does not accept pathlib.Path #84627

New issue
Copy link
New issue
Copy link
Closed
Closed
compile_file's stripdir does not accept pathlib.Path#84627
Copy link
Labels
3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@hauntsaninja
hauntsaninja
opened on Apr 30, 2020
Issue body actions
BPO 40447
Nosy @tirkarthi, @FFY00, @hauntsaninja
PRs
  • bpo-40447: accept all path-like objects in compileall.compile_file #19883
  • 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 = None
    created_at = <Date 2020-04-30.06:18:15.892>
    labels = ['type-bug', 'library', '3.9']
    title = "compile_file's stripdir does not accept pathlib.Path"
    updated_at = <Date 2020-05-03.12:55:07.004>
    user = 'https://github.com/hauntsaninja'

    bugs.python.org fields:

    activity = <Date 2020-05-03.12:55:07.004>
    actor = 'FFY00'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2020-04-30.06:18:15.892>
    creator = 'hauntsaninja'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40447
    keywords = ['patch']
    message_count = 2.0
    messages = ['367740', '367741']
    nosy_count = 3.0
    nosy_names = ['xtreak', 'FFY00', 'hauntsaninja']
    pr_nums = ['19883']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue40447'
    versions = ['Python 3.9']

    Activity

    1. hauntsaninja commented on Apr 30, 2020

      @hauntsaninja
      hauntsaninja
      on Apr 30, 2020
      ContributorAuthor
      More actions

      Python 3.9 added the stripdir argument to compileall functions. From https://docs.python.org/3.9/library/compileall.html#compileall.compile_file:

      The stripdir, prependdir and limit_sl_dest arguments correspond to the -s, -p and -e options described above. They may be specified as str, bytes or os.PathLike.

      ~ λ python3.9
      Python 3.9.0a6+ (heads/master:360371f, Apr 29 2020, 15:44:56) 
      [Clang 11.0.0 (clang-1100.0.33.17)] on darwin
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import compileall, pathlib
      >>> compileall.compile_file(pathlib.Path("tmp/test.py"), stripdir=pathlib.Path("tmp"))
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/Users/shantanu/.pyenv/versions/3.9-dev/lib/python3.9/compileall.py", line 161, in compile_file
          stripdir_parts = stripdir.split(os.path.sep)
      AttributeError: 'PosixPath' object has no attribute 'split'
      

      Found by Jelle Zijlstra in python/typeshed#3956 (comment)

    2. hauntsaninja
      added
      3.9 (EOL)end of lifeend of life
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      on Apr 30, 2020
    3. hauntsaninja commented on Apr 30, 2020

      @hauntsaninja
      hauntsaninja
      on Apr 30, 2020
      ContributorAuthor
      More actions

      If it helps triage, this is the BPO for where the changes to compileall were made: https://bugs.python.org/issue38112

    4. tirkarthi
      added
      type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
      on Apr 30, 2020
    5. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    6. brettcannon
      added
      topic-pathlib
      on Jun 21, 2022
    7. hauntsaninja
      closed this as completedon Dec 23, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        You are visitor 01402503 — GeezerVison does not store the pages you look up.
        Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.