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

Patch to add imp.get_codingspec() #47842

Closed
brettcannon opened this issue Aug 18, 2008 · 3 comments
Closed

Patch to add imp.get_codingspec() #47842

brettcannon opened this issue Aug 18, 2008 · 3 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@brettcannon
Copy link
Member

BPO 3592
Nosy @brettcannon, @tiran, @benjaminp
Files
  • reviewed_get_encodingspec.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 2010-08-09.21:01:28.990>
    created_at = <Date 2008-08-18.21:13:51.462>
    labels = ['type-feature', 'library']
    title = 'Patch to add imp.get_codingspec()'
    updated_at = <Date 2010-08-09.21:01:28.989>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2010-08-09.21:01:28.989>
    actor = 'brett.cannon'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-08-09.21:01:28.990>
    closer = 'brett.cannon'
    components = ['Library (Lib)']
    creation = <Date 2008-08-18.21:13:51.462>
    creator = 'brett.cannon'
    dependencies = []
    files = ['11149']
    hgrepos = []
    issue_num = 3592
    keywords = ['patch']
    message_count = 3.0
    messages = ['71379', '71380', '113412']
    nosy_count = 3.0
    nosy_names = ['brett.cannon', 'christian.heimes', 'benjamin.peterson']
    pr_nums = []
    priority = 'low'
    resolution = 'out of date'
    stage = None
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue3592'
    versions = ['Python 3.2']

    @brettcannon
    Copy link
    Member Author

    Attached is a patch to add imp.get_codingspec(); a function that returns
    the encoding of a source file.

    The motivation is to remove the import of the re module in linecache to
    speed up interpreter startup.

    @brettcannon brettcannon added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Aug 18, 2008
    @brettcannon
    Copy link
    Member Author

    It should be noted the original patch by Christian had a check for bad
    tokenizing. Turns out that if you have that in several tests fail,
    including test_modulefinder. This might mean there is a deeper problem
    in the parser.

    @benjaminp
    Copy link
    Contributor

    We don't need this. We have tokenize.detect_encoding().

    @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
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants