[issue46656] Compile fails if Py_NO_NAN is defined

2022-02-06 Thread Mark Dickinson
Mark Dickinson added the comment: Here's the first point of failure on my machine. Fixing this shows up more failures. gcc -c -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes

[issue46656] Compile fails if Py_NO_NAN is defined

2022-02-06 Thread Mark Dickinson
New submission from Mark Dickinson : The macro Py_NAN may or may not be defined: in particular, a platform that doesn't have NaNs is supposed to be able to define Py_NO_NAN in pyport.h to indicate that. But not all of our uses of `Py_NAN` are guarded by suitable #ifdef conditionals. As a

[issue46656] Compile fails if Py_NO_NAN is defined

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-46640 "Python can now use the C99 NAN constant or __builtin_nan()". -- ___ Python tracker ___

[issue46648] `test.test_urllib2.MiscTests.test_issue16464` started to fail

2022-02-06 Thread miss-islington
miss-islington added the comment: New changeset 1b8a34ae65688cfadc81e0174b5aea979b264b3e by Miss Islington (bot) in branch '3.9': bpo-46648: Skip test_urllib2.test_issue16464() (GH-31161) https://github.com/python/cpython/commit/1b8a34ae65688cfadc81e0174b5aea979b264b3e --

[issue46648] `test.test_urllib2.MiscTests.test_issue16464` started to fail

2022-02-06 Thread miss-islington
miss-islington added the comment: New changeset c88407ccf5e72d00e909c2399ff7163501aa7089 by Miss Islington (bot) in branch '3.10': bpo-46648: Skip test_urllib2.test_issue16464() (GH-31161) https://github.com/python/cpython/commit/c88407ccf5e72d00e909c2399ff7163501aa7089 --

[issue46656] Compile fails if Py_NO_NAN is defined

2022-02-06 Thread Mark Dickinson
Mark Dickinson added the comment: > See the explanations in the source. Hmm. Those explanations made more sense before PR GH-28882. :-( -- ___ Python tracker ___

[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-06 Thread Meer Suri
Meer Suri added the comment: (First time contributor here seeking guidance) I see that this problem of automatically linking to the unintended page has occurred in other parts of the docs and has been handled in another way - In Doc/library/functions.rst, local targets are used with

[issue46657] Add mimalloc memory allocator

2022-02-06 Thread Christian Heimes
Christian Heimes added the comment: New features: - vendored mimalloc 2.0.3 + two patches from mimalloc dev branch. Mimalloc is embedded in obmalloc.o. Symbols are either hidden or names are mangled to have a _Py_ prefix. - ./configure --with[out]-mimalloc (default: yes), fails if atomics

[issue46187] Optionally support rounding for math.isqrt()

2022-02-06 Thread Mark Dickinson
Mark Dickinson added the comment: Ah, https://math.mit.edu/research/highschool/primes/materials/2019/Gopalakrishna.pdf is interesting - they conjecture a bound on the number of iterations required, and note that under that conjecture the mod can be replaced by a subtraction. --

[issue46656] Compile fails if Py_NO_NAN is defined

2022-02-06 Thread Mark Dickinson
Mark Dickinson added the comment: Okay, the comments I made on #46640 still apply (even though they didn't properly apply on that issue). I think this needs a python-dev discussion before it can be moved forward - requiring the existence of NaNs is very close to requiring IEEE 754

[issue46648] `test.test_urllib2.MiscTests.test_issue16464` started to fail

2022-02-06 Thread miss-islington
Change by miss-islington : -- pull_requests: +29336 pull_request: https://github.com/python/cpython/pull/31163 ___ Python tracker ___

[issue46648] `test.test_urllib2.MiscTests.test_issue16464` started to fail

2022-02-06 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +29335 pull_request: https://github.com/python/cpython/pull/31162 ___ Python tracker

[issue46648] `test.test_urllib2.MiscTests.test_issue16464` started to fail

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: New changeset 1578de2fcd685c71f9c84e09bac32901dea192c1 by Victor Stinner in branch 'main': bpo-46648: Skip test_urllib2.test_issue16464() (GH-31161) https://github.com/python/cpython/commit/1578de2fcd685c71f9c84e09bac32901dea192c1 --

[issue46657] Add mimalloc memory allocator

2022-02-06 Thread Dong-hee Na
Dong-hee Na added the comment: I add Neil to the nosy list since he is one of the kick-off members with this amazing works :) -- ___ Python tracker ___

[issue46654] urllib.request.urlopen doesn't handle UNC paths produced by pathlib's as_uri() (but can handle UNC paths with additional slashes)

2022-02-06 Thread Eryk Sun
Eryk Sun added the comment: > The value of req.selector never starts with "//", for which file_open() > checks, but rather a single slash, such as "/Z:/test.py" or > "/share/test.py". To correct myself, actually req.selector will start with "//" for a "file:" URI, such as

[issue46652] Use code.co_qualname to provide richer information

2022-02-06 Thread Gabriele N Tornetta
Gabriele N Tornetta added the comment: code.co_qualname was introduced in 2021 with bpo-44530 and shuold give the same guarantees as code.co_name. The __qualname__ attribute is derived from code.co_qualname, so perhaps Cython can benefit from accessing code.co_qualname directly instead?

[issue46644] typing: remove callable() check from typing._type_check

2022-02-06 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +29332 pull_request: https://github.com/python/cpython/pull/31159 ___ Python tracker ___

[issue46644] typing: remove callable() check from typing._type_check

2022-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There were two reasons of accepting arbitrary callables in _type_check(): 1. NewType() returned a function. 2. xml.etree.cElementTree.Element was a function in Python 2. Now NewType is a class, and Python 2 no longer supported. I agree that we should get

[issue46656] Compile fails if Py_NO_NAN is defined

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +29333 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31160 ___ Python tracker ___

[issue46657] Add mimalloc memory allocator

2022-02-06 Thread Christian Heimes
Change by Christian Heimes : -- keywords: +patch pull_requests: +29337 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31164 ___ Python tracker

[issue46656] Compile fails if Py_NO_NAN is defined

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: Python uses Py_NAN without "#ifdef Py_NAN" guard since 2008. Building Python with Py_NO_NAN never worked. Nobody reported such build failure in the last 14 years... IMO it's time to stop supporting platforms without NaN support. >

[issue46640] Python can now use the C99 NAN constant or __builtin_nan()

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: I merged my change, thanks for the reviews. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: Python can now use the C99 NAN constant -> Python can now use the C99 NAN constant or __builtin_nan()

[issue46642] typing: tested TypeVar instance subclass TypeError is incidental

2022-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that instances of most other types are non-subclassable "by accident". >>> class A(42): pass ... Traceback (most recent call last): File "", line 1, in TypeError: int() takes at most 2 arguments (3 given) >>> class B: ... def __init__(self,

[issue46656] Compile fails if Py_NO_NAN is defined

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: If someone suddenly requires platforms without NaN support, they can maintain a (downstream) patch, or we can revert the change in Python. -- ___ Python tracker

[issue46648] `test.test_urllib2.MiscTests.test_issue16464` started to fail

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29334 pull_request: https://github.com/python/cpython/pull/31161 ___ Python tracker ___

[issue23952] cgi: Document the 'maxlen' member of the cgi module

2022-02-06 Thread Ethan Furman
Ethan Furman added the comment: New changeset 6c4e44ef8ab550f846ba056d4561efb8256b8eab by Hugo van Kemenade in branch 'main': bpo-23952: Document cgi module's maxlen variable (GH-30338) https://github.com/python/cpython/commit/6c4e44ef8ab550f846ba056d4561efb8256b8eab --

[issue23952] cgi: Document the 'maxlen' member of the cgi module

2022-02-06 Thread Ethan Furman
Change by Ethan Furman : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-06 Thread Ethan Furman
Ethan Furman added the comment: In case a future reader has the same question: A tilde (~) creates a link to whatever follows (so `enum.property` above), but only shows the last segment in the text (so `property`). -- ___ Python tracker

[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-06 Thread Ethan Furman
Change by Ethan Furman : -- Removed message: https://bugs.python.org/msg412634 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46656] Compile fails if Py_NO_NAN is defined

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: Is the macro PY_NO_SHORT_FLOAT_REPR also related to platforms which don't support IEEE 754? In 2022, which platforms don't support IEEE 754? -- ___ Python tracker

[issue46657] Add mimalloc memory allocator

2022-02-06 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10, nascheme ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46655] typing.TypeAlias is not in the list of allowed plain _SpecialForm typeforms

2022-02-06 Thread Gregory Beauregard
Change by Gregory Beauregard : -- keywords: +patch pull_requests: +29331 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31156 ___ Python tracker

[issue46640] Python can now use the C99 NAN constant

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: New changeset 54842e4311bb0e34012d1984b42eab41eeeaea6a by Victor Stinner in branch 'main': bpo-46640: Py_NAN now uses the C99 NAN constant (GH-31134) https://github.com/python/cpython/commit/54842e4311bb0e34012d1984b42eab41eeeaea6a --

[issue46187] Optionally support rounding for math.isqrt()

2022-02-06 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Tim; very interesting. I hadn't seen this factoring algorithm before. > That wants the _ceiling_ of the square root. Looks like what it actually wants is the ceiling analog of isqrtrem: that is, it needs both the ceiling of the square root *and* the

[issue46656] Compile fails if Py_NO_NAN is defined

2022-02-06 Thread Mark Dickinson
Mark Dickinson added the comment: > Is the macro PY_NO_SHORT_FLOAT_REPR also related to platforms which don't > support IEEE 754? Yes, though it's a bit more than that: we also need the platform either not to have issues with double rounding for normal numbers, or we need to be able to

[issue46657] Add mimalloc memory allocator

2022-02-06 Thread Christian Heimes
New submission from Christian Heimes : >From https://github.com/microsoft/mimalloc > mimalloc (pronounced "me-malloc") is a general purpose allocator with > excellent performance characteristics. Initially developed by Daan Leijen for > the run-time systems of the Koka and Lean languages.

[issue46648] `test.test_urllib2.MiscTests.test_issue16464` started to fail

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46658] shutil Lib enables sendfile on solaris for regular files

2022-02-06 Thread David CARLIER
New submission from David CARLIER : - sendfile on solaris supports copy between regular file descriptors as well. -- components: Library (Lib) messages: 412643 nosy: devnexen priority: normal pull_requests: 29338 severity: normal status: open title: shutil Lib enables sendfile on

[issue46660] datetime.fromtimestamp() fails for naive-datetime values prior to the start of the epoch

2022-02-06 Thread Sam Roberts
Change by Sam Roberts : -- title: datetime.datetime.fromtimestamp -> datetime.fromtimestamp() fails for naive-datetime values prior to the start of the epoch ___ Python tracker

[issue46644] typing: remove callable() check from typing._type_check

2022-02-06 Thread Gregory Beauregard
Gregory Beauregard added the comment: List[42] is already accepted, and your proposed patch does not change it to make it not accepted. The issue is _type_check is only called in a few particular locations; this is part of the technical reason I'm not very concerned about relaxing the

[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : Removed file: https://bugs.python.org/file50605/cal_locale.py ___ Python tracker ___ ___ Python-bugs-list

[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : Added file: https://bugs.python.org/file50606/cal_locale.py ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46657] Add mimalloc memory allocator

2022-02-06 Thread Christian Heimes
Christian Heimes added the comment: Buildbots "PPC64 Fedora PR" and all RHEL 7 build bots provided by David Edelsohn are failing because compiler is missing support for stdatomic.h. -- ___ Python tracker

[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: New changeset 04dd60e50cd3da48fd19cdab4c0e4cc600d6af30 by Victor Stinner in branch 'main': bpo-46659: Update the test on the mbcs codec alias (GH-31168) https://github.com/python/cpython/commit/04dd60e50cd3da48fd19cdab4c0e4cc600d6af30 --

[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: > Please see the discussion on https://bugs.python.org/issue43552: > locale.getpreferredencoding() needs to be deprecated as well. Instead we > should have a single locale.getencoding() as outlined there... perhaps in a > separate ticket ?! Thanks. Yeah, I

[issue46657] Add mimalloc memory allocator

2022-02-06 Thread Neil Schemenauer
Neil Schemenauer added the comment: Thanks, I'm indeed interested. Most credit goes to Christian for advancing this. For the missing stdatomic.h, would it be appropriate to have an autoconfig check for it? Can just disable mimalloc if it doesn't exist. --

[issue46664] PY_SSIZE_T_MAX is not an integer constant expression

2022-02-06 Thread ov2k
Change by ov2k : -- type: compile error -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46667] SequenceMatcher & autojunk - false negative

2022-02-06 Thread Tim Peters
Tim Peters added the comment: SequenceMatcher looks for the longest _contiguous_ match. "UNIQUESTRING" isn't the longest by far when autojunk is False, but is the longest when autojunk is True. All those bpopular characters then effectively prevent finding a longer match than 'QUESTR'

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: The alias was created in 2003 to fix bpo-671666: --- commit 4eab486476c0082087a8460a5ab1064e64cc1a6b Author: Martin v. Löwis Date: Mon Mar 3 09:34:01 2003 + Patch #671666: Alias ANSI code page to "mbcs". --- In 2003, bpo-671666 was created because

[issue46661] Duplicat deprecation warnings in docs for asyncio

2022-02-06 Thread Guido van Rossum
Guido van Rossum added the comment: Kumar are you interested in fixing this? -- ___ Python tracker ___ ___ Python-bugs-list

[issue46669] Add types.Self

2022-02-06 Thread Raymond Hettinger
New submission from Raymond Hettinger : Typeshed now has a nice self-describing type variable to annotate context managers: Self = TypeVar('Self') def __enter__(self: Self) -> Self: return self It would be nice to have that in the standard library types module as well. --

[issue46655] typing.TypeAlias is not in the list of allowed plain _SpecialForm typeforms

2022-02-06 Thread Gregory Beauregard
Change by Gregory Beauregard : -- pull_requests: +29346 pull_request: https://github.com/python/cpython/pull/31175 ___ Python tracker ___

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29348 pull_request: https://github.com/python/cpython/pull/31177 ___ Python tracker ___

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29350 pull_request: https://github.com/python/cpython/pull/31179 ___ Python tracker ___

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-06 Thread hydroflask
hydroflask added the comment: @corona10 Thank you for looking into it. The benchmark you did is not reflective of my use-case. I have a codebase that I have completely converted into a C extension using mypyc. So the ctypes callback does not call into interpreted Python code but actually

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: New changeset 16f96a4cf9ab1e91e6e8e18232378bc4b42bb796 by Victor Stinner in branch 'main': bpo-46670: Remove unused get_frame_state() function (GH-31177) https://github.com/python/cpython/commit/16f96a4cf9ab1e91e6e8e18232378bc4b42bb796 --

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29351 pull_request: https://github.com/python/cpython/pull/31180 ___ Python tracker ___

[issue46671] "ValueError: min() arg is an empty sequence" is wrong (builtins.min/max)

2022-02-06 Thread Nnarol
Change by Nnarol : -- keywords: +patch pull_requests: +29352 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31181 ___ Python tracker ___

[issue46666] IDLE Add indent guide

2022-02-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: [Please just select the current development version. Others can be marked if and when backported. 3.8 and before only get security fixes. Same for 3.9 after about next May 31.] Please explain exactly what you want and rewrite something like the

[issue46611] Improve coverage of `__instancecheck__` and `__subclasscheck__` methods in `typing.py`

2022-02-06 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 067c03bf40d13393209f0138fa9c4d5980c4ff8a by Nikita Sobolev in branch 'main': bpo-46611: add coverage to instance and class checks in `typing.py` (GH-31078) https://github.com/python/cpython/commit/067c03bf40d13393209f0138fa9c4d5980c4ff8a

[issue46589] Improve documentation for typing._GenericAlias

2022-02-06 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset a335d98f19b7fa66159d12932cc9a05eb2d8395f by Matthew Rahtz in branch 'main': bpo-46589: Improve documentation for typing._GenericAlias (GH-31026) https://github.com/python/cpython/commit/a335d98f19b7fa66159d12932cc9a05eb2d8395f --

[issue43882] [security] CVE-2022-0391: urllib.parse should sanitize urls containing ASCII newline and tabs.

2022-02-06 Thread Mike Lissner
Mike Lissner added the comment: Looks like that CVE isn't public yet. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0391 Any chance I can get access (I originally reported this vuln.). My email is m...@free.law, if it's possible and my email is needed. Thanks! --

[issue45955] Calling read() on HTTPError may cause KeyError in tempfile

2022-02-06 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-06 Thread STINNER Victor
New submission from STINNER Victor : While working on bpo-46659, I found a bug in the encodings "mbcs" alias. Even if the function has 2 tests (in test_codecs and test_site), both tests missed the bug :-( I fixed the alias with this change: --- commit 04dd60e50cd3da48fd19cdab4c0e4cc600d6af30

[issue46657] Add mimalloc memory allocator

2022-02-06 Thread Christian Heimes
Christian Heimes added the comment: We have an autoconf check for stdatomic.h. The test even verifies that a program with atomic_load_explicit() compiles and links. How do we want to use mimalloc in the future? Is it going to stay optional in 3.12? Then the default setting for

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: Python 3.11 supports the 40 code pages: * 037 * 273 * 424 * 437 * 500 * 720 * 737 * 775 * 850 * 852 * 855 * 856 * 857 * 858 * 860 * 861 * 862 * 863 * 864 * 865 * 866 * 869 * 874 * 875 * 932 * 949 * 950 * 1006 * 1026 * 1125 * 1140 * 1250 * 1251 * 1252 * 1253 *

[issue46669] Add types.Self

2022-02-06 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: PEP 673 (which was accepted) adds typing.Self already. bpo-46534 tracks implementing it. -- ___ Python tracker ___

[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: > New changeset 04dd60e50cd3da48fd19cdab4c0e4cc600d6af30 by Victor Stinner in > branch 'main': > bpo-46659: Update the test on the mbcs codec alias (GH-31168) This change is not correct, I created bpo-46668 to fix it. --

[issue43882] [security] CVE-2022-0391: urllib.parse should sanitize urls containing ASCII newline and tabs.

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: CVE-2022-0391 has been assigned to this vulnerability. -- nosy: +vstinner title: [security] urllib.parse should sanitize urls containing ASCII newline and tabs. -> [security] CVE-2022-0391: urllib.parse should sanitize urls containing ASCII newline

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-06 Thread Dong-hee Na
Dong-hee Na added the comment: @hydroflask It does not show impressive performance enhancement, so I decided not to change it See PR 31138 -- resolution: -> wont fix stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-06 Thread Eryk Sun
Eryk Sun added the comment: > The Python 3.6 and 3.7 "codecs.register(_alias_mbcs)" doesn't work > because "search_function()" is tested before and it works for "cpXXX" > encodings. Isn't the 3.6-3.10 ordering of search_function() and _alias_mbcs() correct as a fallback? In this case,

[issue46671] "ValueError: min() arg is an empty sequence" is wrong (builtins.min/max)

2022-02-06 Thread Nnarol
New submission from Nnarol : Incorrect error message by min_max(): "ValueError: min() arg is an empty sequence" when using the form min(iterable, *[, default=obj, key=func]) -> value and "iterable" is empty, like so: min([]) or: min(set()) "Sequence" is referred to, even

[issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec

2022-02-06 Thread Guido van Rossum
Guido van Rossum added the comment: Super subtle stuff. Tonight I do not have time to really dive into this, but I think Serhiy is on to something. KJ or Jelle, do you have the guts to dive in here? -- ___ Python tracker

[issue46644] typing: remove callable() check from typing._type_check

2022-02-06 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46655] typing.TypeAlias is not in the list of allowed plain _SpecialForm typeforms

2022-02-06 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 77b025be4a4cd5a3bfc1b1af560cc57e8e956c98 by Gregory Beauregard in branch 'main': bpo-46655: allow stringized TypeAlias with get_type_hints (GH-31156) https://github.com/python/cpython/commit/77b025be4a4cd5a3bfc1b1af560cc57e8e956c98

[issue46655] typing.TypeAlias is not in the list of allowed plain _SpecialForm typeforms

2022-02-06 Thread Guido van Rossum
Guido van Rossum added the comment: Looks like the more likely use case would be PEP 563: from __future__ import annotations from typing import TypeAlias, get_type_hints import typing class C: a: TypeAlias = int print(get_type_hints(C)) This prints Traceback (most recent call last):

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +29345 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31174 ___ Python tracker ___

[issue46648] `test.test_urllib2.MiscTests.test_issue16464` flaky due to external connection

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-06 Thread STINNER Victor
New submission from STINNER Victor : Building Python with "gcc -Wundef" emits many warnings about usage of undefined macros. If a macro is not defined, it is equal to 0. The problem is that a macro can be undefined because of a missing #include, or because of a typo in its name, or because

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +29347 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31176 ___ Python tracker ___

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29349 pull_request: https://github.com/python/cpython/pull/31178 ___ Python tracker ___

[issue46665] IDLE Windows shortcuts by default

2022-02-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: I wish it were otherwise, but configuration defaults cannot be changed as some people would not like it and it would badly interact with custom configurations. We can add new themes and keysets, but that should be very rare. We can consider adding

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: New changeset 097f74a5a37e2a8a26d529cede456ede7011b66f by Victor Stinner in branch 'main': bpo-46670: Define all macros for stringlib (GH-31176) https://github.com/python/cpython/commit/097f74a5a37e2a8a26d529cede456ede7011b66f --

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: New changeset b556f53785cb9ad8cc088ad8c10efee91fe3da58 by Victor Stinner in branch 'main': bpo-46670: Test if a macro is defined, not its value (GH-31178) https://github.com/python/cpython/commit/b556f53785cb9ad8cc088ad8c10efee91fe3da58 --

[issue46671] "ValueError: min() arg is an empty sequence" is wrong (builtins.min/max)

2022-02-06 Thread Nnarol
Change by Nnarol : -- components: +Interpreter Core -Library (Lib) ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-06 Thread Dong-hee Na
Dong-hee Na added the comment: @hydroflask I am one of the big fans of applying vectorcall :) > The benchmark you did is not reflective of my use-case. I have a codebase > that I have completely converted into a C extension using mypyc. Can you provide me a minimal benchmarkable script(if

[issue46665] IDLE Windows shortcuts by default

2022-02-06 Thread primexx
primexx added the comment: > I wish it were otherwise, but configuration defaults cannot be changed as > some people would not like it and it would badly interact with custom > configurations. that is a good point. perhaps just adding alternate keysets. this is clearly not a high priority

[issue46666] IDLE Add indent guide

2022-02-06 Thread primexx
primexx added the comment: > Please just select the current development version. Others can be marked if > and when backported oh sorry about that! > Please explain exactly what you want these dotted lines in the attached screenshot > What you see in the editor is what is saved

[issue46642] typing: tested TypeVar instance subclass TypeError is incidental

2022-02-06 Thread Gregory Beauregard
Gregory Beauregard added the comment: The issue in real code I had in mind was internal to cpython: if we remove the callable() check from _type_check naively, this test starts to fail. Both of our proposed changes happen to not fail this check. Given your second example, would you prefer

[issue46660] datetime.timestamp() fails for naive-datetime values prior to the start of the epoch

2022-02-06 Thread Sam Roberts
Sam Roberts added the comment: the first sentence should have read: datetime.timestamp() fails for naive-datetime values prior to the start of the epoch, but for some reason works properly for aware-datetime values prior to the start of the epoch. -- title: datetime.fromtimestamp()

[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29340 pull_request: https://github.com/python/cpython/pull/31167 ___ Python tracker ___

[issue46662] Lib/sqlite3/dbapi2.py: convert_timestamp function failed to correctly parse timestamp

2022-02-06 Thread Bo-wei Chen
New submission from Bo-wei Chen : convert_timestamp function in Lib/sqlite3/dbapi2.py fails to parse a timestamp correctly, if it does not have microseconds but comes with timezone information, e.g. b"2022-02-01 16:09:35+00:00" Traceback: Traceback (most recent call last): File

[issue46662] Lib/sqlite3/dbapi2.py: convert_timestamp function failed to correctly parse timestamp

2022-02-06 Thread Bo-wei Chen
Change by Bo-wei Chen : -- keywords: +patch pull_requests: +29342 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31169 ___ Python tracker ___

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29343 pull_request: https://github.com/python/cpython/pull/31171 ___ Python tracker ___

[issue46644] typing: remove callable() check from typing._type_check

2022-02-06 Thread Gregory Beauregard
Gregory Beauregard added the comment: I'm referring to within type annotations, where this code path isn't used: try a: List[42] This code path can show up in type aliases though. -- ___ Python tracker

[issue29240] PEP 540: Add a new UTF-8 mode

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: > New changeset 91106cd9ff2f321c0f60fbaa09fd46c80aa5c266 by Victor Stinner in > branch 'master': > bpo-29240: PEP 540: Add a new UTF-8 Mode (#855) > https://github.com/python/cpython/commit/91106cd9ff2f321c0f60fbaa09fd46c80aa5c266 Oh, this change broke the

[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: New changeset 06b8f1615b09099fae5c5393334b8716a4144d20 by Victor Stinner in branch 'main': bpo-46659: test.support avoids locale.getdefaultlocale() (GH-31167) https://github.com/python/cpython/commit/06b8f1615b09099fae5c5393334b8716a4144d20 --

[issue46664] PY_SSIZE_T_MAX is not an integer constant expression

2022-02-06 Thread ov2k
New submission from ov2k : PY_SSIZE_T_MAX is currently defined in Include/pyport.h as: #define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1)) This is not an integer constant expression, which means it can't be used in preprocessor conditionals. For example: #if PY_SSIZE_T_MAX >

[issue46648] `test.test_urllib2.MiscTests.test_issue16464` flaky due to external connection

2022-02-06 Thread Gregory P. Smith
Gregory P. Smith added the comment: The merged PRs disable the test without anything tracking fixing or re-re-enabling it. Reopening & retitling this issue. This specific test does not need to use an external server. That has nothing to do with what the purposes of the test is which is all

[issue46667] SequenceMatcher & autojunk - false negative

2022-02-06 Thread Jonathan
Jonathan added the comment: (Like the idiot I am, the example code is wrong. `autojunk` parameter should *not* be set for either of them to get the stated wrong results). In place of "UNIQUESTRING", any unique 3 character string triggers it (QQQ, EEE, ZQU...). And in those cases you get a

  1   2   >