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

PyLong_AsSize_t returns (unsigned long)-1 #57172

Closed
skrah mannequin opened this issue Sep 12, 2011 · 5 comments
Closed

PyLong_AsSize_t returns (unsigned long)-1 #57172

skrah mannequin opened this issue Sep 12, 2011 · 5 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@skrah
Copy link
Mannequin

skrah mannequin commented Sep 12, 2011

BPO 12963
Nosy @mdickinson, @vstinner, @skrah
Files
  • pylong_as_size_t.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 2011-09-12.19:12:59.778>
    created_at = <Date 2011-09-12.12:13:46.282>
    labels = ['interpreter-core', 'type-bug']
    title = 'PyLong_AsSize_t returns (unsigned long)-1'
    updated_at = <Date 2011-09-12.19:12:59.777>
    user = 'https://github.com/skrah'

    bugs.python.org fields:

    activity = <Date 2011-09-12.19:12:59.777>
    actor = 'skrah'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-09-12.19:12:59.778>
    closer = 'skrah'
    components = ['Interpreter Core']
    creation = <Date 2011-09-12.12:13:46.282>
    creator = 'skrah'
    dependencies = []
    files = ['23130']
    hgrepos = []
    issue_num = 12963
    keywords = ['patch']
    message_count = 5.0
    messages = ['143896', '143900', '143901', '143903', '143927']
    nosy_count = 4.0
    nosy_names = ['mark.dickinson', 'vstinner', 'skrah', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'patch review'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue12963'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2', 'Python 3.3']

    @skrah
    Copy link
    Mannequin Author

    skrah mannequin commented Sep 12, 2011

    In one of the error branches PyLong_AsSize_t() returns (unsigned long)-1
    instead of (size_t)-1.

    @skrah skrah mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Sep 12, 2011
    @mdickinson
    Copy link
    Member

    Yep, clearly a bug. Please fix!

    @vstinner
    Copy link
    Member

    I suppose that you can test if the bug is tested on Windows 64 bits, where sizeof(long)=32 bits, whereas sizeof(size_t) is 64 bits.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 12, 2011

    New changeset d14f717b5e3d by Stefan Krah in branch '3.2':
    Issue bpo-12963: PyLong_AsSize_t() now returns (size_t)-1 in all error cases.
    http://hg.python.org/cpython/rev/d14f717b5e3d

    New changeset c91900e4e805 by Stefan Krah in branch 'default':
    Merge fix for issue bpo-12963.
    http://hg.python.org/cpython/rev/c91900e4e805

    @skrah
    Copy link
    Mannequin Author

    skrah mannequin commented Sep 12, 2011

    Yep, clearly a bug. Please fix!

    Done, thanks for reviewing.

    Victor, I don't think we need a unit test for this. I plan to go
    over some modules with gcov in the future, and I'll include
    longobject.c.

    @skrah skrah mannequin closed this as completed Sep 12, 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-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants