[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-07 Thread STINNER Victor
STINNER Victor added the comment: Thanks Antti Haapala for the bug report and thanks Zackery Spytz for the fix! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset 2bfc2dc214445550521074f428245b502d215eac by Victor Stinner (Zackery Spytz) in branch '2.7': [2.7] bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() (GH-13860) (GH-13898)

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-07 Thread Zackery Spytz
Change by Zackery Spytz : -- pull_requests: +13773 pull_request: https://github.com/python/cpython/pull/13898 ___ Python tracker ___

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset e36ed475ea429f7cc80a4d65f80b44686a74b246 by Victor Stinner (Zackery Spytz) in branch '3.7': [3.7] bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() (GH-13860) (GH-13896)

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-07 Thread Zackery Spytz
Change by Zackery Spytz : -- pull_requests: +13771 pull_request: https://github.com/python/cpython/pull/13896 ___ Python tracker ___

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset dd492d9c352eb0fa2bc48ea9acc47e47a7fab8a0 by Victor Stinner (Zackery Spytz) in branch '3.8': [3.8] bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() (GH-13860) (GH-13891)

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-07 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +13765 pull_request: https://github.com/python/cpython/pull/13891 ___ Python tracker ___

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-06 Thread STINNER Victor
STINNER Victor added the comment: New changeset dc2476500d91082f0c907772c83a044bf49af279 by Victor Stinner (Zackery Spytz) in branch 'master': bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() (GH-13860)

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-06 Thread Zackery Spytz
Change by Zackery Spytz : -- nosy: +ZackerySpytz versions: -Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-06 Thread STINNER Victor
STINNER Victor added the comment: Python 2.7 - 3.9 are affected. Python 3.6 no longer accept bugfixes. -- versions: -Python 3.5 ___ Python tracker ___

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-06 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-06 Thread Antti Haapala
Antti Haapala added the comment: Unsigned long long needs to be at least 64 bits wide, so it is probably all 32-bit platforms and 64-bit window at least. These functions are not used only in a few places within the CPython code and when they are they're guarded with `PyLong_Check`s or

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-06 Thread STINNER Victor
STINNER Victor added the comment: > Victor, as a friendly reminder, (unsigned long)-1 is not necessarily the same > number as (unsigned long long)-1. The documentation means the latter. Aaaah, I didn't notice that the function returns unsigned *long long*, sorry :-) Which platform is

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-06 Thread Eric V. Smith
Eric V. Smith added the comment: As ztane says, the issue isn't the -1, it's the type of the cast. This looks like a legitimate issue to me. -- nosy: +eric.smith resolution: not a bug -> stage: resolved -> patch review status: closed -> open ___

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-06 Thread Zackery Spytz
Change by Zackery Spytz : -- pull_requests: +13734 pull_request: https://github.com/python/cpython/pull/13860 ___ Python tracker ___

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-06 Thread Antti Haapala
Antti Haapala added the comment: Victor, as a friendly reminder, (unsigned long)-1 is not necessarily the same number as (unsigned long long)-1. The documentation means the latter. -- ___ Python tracker

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-06 Thread STINNER Victor
STINNER Victor added the comment: -1 is documented: https://docs.python.org/dev/c-api/long.html#c.PyLong_AsUnsignedLongLongMask It's not a bug but a deliberate behavior. See also the general behavior described at: https://docs.python.org/dev/c-api/long.html#integer-objects -- nosy:

[issue37170] Wrong return value from PyLong_AsUnsignedLongLongMask on PyErr_BadInternalCall

2019-06-06 Thread Antti Haapala
New submission from Antti Haapala : Hi, while checking the longobject implementation for a Stack Overflow answer, I noticed that the functions `_PyLong_AsUnsignedLongLongMask` and `PyLong_AsUnsignedLongLongMask` erroneously return `(unsigned long)-1` on error when bad internal call is