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

PyImport_ImportModuleLevel doesn't have 'const' on its argument #56382

Closed
Rosuav opened this issue May 25, 2011 · 2 comments
Closed

PyImport_ImportModuleLevel doesn't have 'const' on its argument #56382

Rosuav opened this issue May 25, 2011 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@Rosuav
Copy link
Contributor

Rosuav commented May 25, 2011

BPO 12173
Nosy @brettcannon, @vstinner, @Rosuav
Files
  • importconst.patch: Patch to add 'const' to argument of PyImport_ImportModuleLevel
  • 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 2011-05-25.14:28:49.250>
    created_at = <Date 2011-05-25.07:10:30.811>
    labels = ['interpreter-core', 'type-feature']
    title = "PyImport_ImportModuleLevel doesn't have 'const' on its argument"
    updated_at = <Date 2011-05-25.14:28:49.248>
    user = 'https://github.com/Rosuav'

    bugs.python.org fields:

    activity = <Date 2011-05-25.14:28:49.248>
    actor = 'python-dev'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-05-25.14:28:49.250>
    closer = 'python-dev'
    components = ['Interpreter Core']
    creation = <Date 2011-05-25.07:10:30.811>
    creator = 'Rosuav'
    dependencies = []
    files = ['22103']
    hgrepos = []
    issue_num = 12173
    keywords = ['patch', 'needs review']
    message_count = 2.0
    messages = ['136829', '136849']
    nosy_count = 4.0
    nosy_names = ['brett.cannon', 'vstinner', 'python-dev', 'Rosuav']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue12173'
    versions = ['Python 3.3']

    @Rosuav
    Copy link
    Contributor Author

    Rosuav commented May 25, 2011

    An anomaly in the argument types of similar functions: PyImport_ImportModuleLevel takes char *, while the related functions PyImport_AddModule, PyImport_ImportModule, and PyImport_ImportModuleNoBlock all take const char *. This made a nuisance of itself for me when I tried to compile my code against Python.h (embedding Python). Attached is a relatively trivial patch to add const. Should not impact existing code, as the compiler will happily pass a char* to a const char* (just not the other way).

    @Rosuav Rosuav added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels May 25, 2011
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 25, 2011

    New changeset a9126e8770e5 by Benjamin Peterson in branch 'default':
    make PyImport_ImportModuleLevel's first arg const like similiar functions (closes bpo-12173)
    http://hg.python.org/cpython/rev/a9126e8770e5

    @python-dev python-dev mannequin closed this as completed May 25, 2011
    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant