New submission from Serhiy Storchaka :
&DK_ENTRIES(k)[i] can be evaluated when i is -1. Getting the address before the
beginning of the array is an undefined behavior in C.
--
components: Interpreter Core
messages: 355122
nosy: inada.naoki, serhiy.storchaka
priority: normal
seve
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +16427
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16883
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
We could use __index__ for serializing numpy.int64. But what to do with
numpy.float32 and numpy.float128? It is a part of a much larger problem (which
includes other numbers, collections, encoded strings, named tuples and data
classes, etc). I am working
Serhiy Storchaka added the comment:
New changeset 2e3d873d3bd0ef4708c4fa06b6cd6972574cb9af by Serhiy Storchaka in
branch 'master':
bpo-38555: Fix an undefined behavior. (GH-16883)
https://github.com/python/cpython/commit/2e3d873d3bd0ef4708c4fa06b6cd69
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
It is easy:
diff --git a/Lib/functools.py b/Lib/functools.py
index 3192bd02d9..52c07db749 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -499,7 +499,9 @@ def lru_cache(maxsize=128, typed=False):
# The user_function was passed in directly
Serhiy Storchaka added the comment:
The rule used in the lru_cache implementation is: do not write in C that can be
written in Python.
--
___
Python tracker
<https://bugs.python.org/issue38
Change by Serhiy Storchaka :
--
nosy: +ncoghlan
versions: +Python 3.9 -Python 3.6
___
Python tracker
<https://bugs.python.org/issue38587>
___
___
Python-bug
Serhiy Storchaka added the comment:
I do not believe somebody uses handwritten regular expressions with more than
100 groups. But if you generate regular expression, you can use named groups
(?P...) (?P=g12345).
--
___
Python tracker
<ht
Serhiy Storchaka added the comment:
I do not think that adding an extra parameter to .read() will solve any problem.
You need to read the documentation of read() to use this feature. You need to
change your code, and this will work only in new version of Python, so you will
need to support
Serhiy Storchaka added the comment:
Thank you for your investigation LCatro! Do you mind to create a pull request?
--
components: +Interpreter Core
type: security -> crash
versions: +Python 2.7, Python 3.7, Python 3.9
___
Python tracker
<
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +16455
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16925
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
The part about "new tuple" can be removed. The documentation olready contains
an automatically generated note about a new reference.
PR 16925 improves the documentation for getting/setting items/slices of lists
and tuples.
-
Serhiy Storchaka added the comment:
New changeset 26ae9f6d3d755734c9f371b9356325afe5764813 by Serhiy Storchaka in
branch 'master':
bpo-38535: Fix positions for AST nodes for calls without arguments in
decorators. (GH-16861)
https://github.com/python/cpyt
Change by Serhiy Storchaka :
--
pull_requests: +16459
pull_request: https://github.com/python/cpython/pull/16930
___
Python tracker
<https://bugs.python.org/issue38
Change by Serhiy Storchaka :
--
pull_requests: +16460
pull_request: https://github.com/python/cpython/pull/16931
___
Python tracker
<https://bugs.python.org/issue38
Serhiy Storchaka added the comment:
New changeset 91fc9cf43cc2e3a2f236ef9944cf1f4bed701545 by Serhiy Storchaka in
branch '3.7':
[3.7] bpo-38535: Fix positions for AST nodes for calls without arguments in
decorators. (GH-16861). (GH-16930)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
New changeset 493fef60a7600f83fe6916ed89d0fb0c0aab484d by Serhiy Storchaka in
branch '2.7':
[2.7] bpo-38535: Fix positions for AST nodes for calls without arguments in
decorators. (GH-16861). (GH-16931)
https://github.com/python/cpyt
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
New changeset d898d20e8c228229eb68e545f544db13f246f216 by Serhiy Storchaka in
branch 'master':
bpo-38557: Improve documentation for list and tuple C API. (GH-16925)
https://github.com/python/cpython/commit/d898d20e8c228229eb68e545f544db
Change by Serhiy Storchaka :
--
components: -Extension Modules
___
Python tracker
<https://bugs.python.org/issue38597>
___
___
Python-bugs-list mailin
Change by Serhiy Storchaka :
--
components: +Interpreter Core, Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
___
Python tracker
<https://bugs.python.org/issue38
Change by Serhiy Storchaka :
--
pull_requests: +16466
pull_request: https://github.com/python/cpython/pull/16937
___
Python tracker
<https://bugs.python.org/issue38
Serhiy Storchaka added the comment:
PR 16937 is simpler. It does not change the decrypter.
--
___
Python tracker
<https://bugs.python.org/issue38334>
___
___
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Serhiy Storchaka :
Currently NULL is mostly marked up as *NULL* in the C API documentation
(although it is marked up as ``NULL`` outside of the C API documentation). It
is rendered with italic font as function parameters and contradicts with
formatting other macros and
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +16478
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16950
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
New changeset 5c32af7522d908e8c7da0243af37618433289cc5 by Serhiy Storchaka in
branch 'master':
bpo-38334: Fix seeking backward on an encrypted zipfile.ZipExtFile. (GH-16937)
https://github.com/python/cpython/commit/5c32af7522d908e8c7da0243af3761
Serhiy Storchaka added the comment:
Could you please test what performance effect it has on read()?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue37
Serhiy Storchaka added the comment:
> I got carried away refactoring the decrypter for a future scenario where
> there could be different decrypters (possibly using certificates too) :)
The decrypter was implemented with a generator for performance. The performance
of decrypting
Change by Serhiy Storchaka :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
I concur with David. The SRE_Scanner object is not public. Its search() method
is used for implementing finditer(). Its match() method could be useful for
implementing a functional equivalent of \G in Perl. But I do not know a use
case for its fullmatch
Serhiy Storchaka added the comment:
Interesting, why locals are not cleared when an exception leaves a frame?
--
___
Python tracker
<https://bugs.python.org/issue38
Serhiy Storchaka added the comment:
See also issue22367.
--
___
Python tracker
<https://bugs.python.org/issue38602>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
New changeset 3bfc8e0fcc707d200c267ff05b052fd6a63c985a by Serhiy Storchaka
(Dong-hee Na) in branch 'master':
bpo-38602: Add fcntl.F_OFD_ for fcntlmodule (GH-16956)
https://github.com/python/cpython/commit/3bfc8e0fcc707d200c267ff05b052f
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
type: -> enhancement
___
Python tracker
<https://bugs.python
Serhiy Storchaka added the comment:
Yes of course, but I'll fix them in a separate PR. PR 16950 is mostly automatic
replacements.
--
___
Python tracker
<https://bugs.python.org/is
Serhiy Storchaka added the comment:
See issue36346.
First we need to add compile-time deprecation warnings to all C API. Then add
runtime deprecation warnings. And since this is a major compatibility breakage,
it can take longer deprecation period
Serhiy Storchaka added the comment:
How does it work with dict subclasses?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue38
Serhiy Storchaka added the comment:
Because there is no need to use refcount.
And there is no need to use refcount in compile.c too.
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue38
Serhiy Storchaka added the comment:
The filename argument must be non-NULL. The code that uses c_filename requires
this.
Py_XDECREF in compiler_free() could be replaced with Py_DECREF. But this is too
tiny change which does not have significant effect.
Actually both Py_INCREF and
Serhiy Storchaka added the comment:
Both code are equivalent. There is reason to rewrite this. It would just
increase code churn.
--
nosy: +serhiy.storchaka
resolution: -> rejected
stage: patch review -> resolved
status: open -> closed
_
Serhiy Storchaka added the comment:
There are examples which show the hex is lowercase. I do not think a special
note is needed. All conversions to hex are lowercase by default.
If you need uppercase, you can use str.upper().
--
nosy: +serhiy.storchaka
Change by Serhiy Storchaka :
--
resolution: -> not a bug
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
> There is a use case of this (which some of tools depends) about checking if
> configuration exists and if not, raising an error. Now, they can solve this
> by just adding check_exist argument.
No, it can be solved by using open() and read_file(
Serhiy Storchaka added the comment:
What result would you expect of `"" in ""` and `"".count("")`?
--
___
Python trac
Change by Serhiy Storchaka :
--
resolution: -> rejected
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
There is no bug. We can add Py_INCREF/Py_DECREF in ast.c. We can remove
Py_INCREF/Py_DECREF from compile.c. But all this would just add code churn.
--
resolution: -> rejected
stage: -> resolved
status: open -&g
Serhiy Storchaka added the comment:
But what if a dict subclass overrides __iter__? You can get different result if
set(d) != set(d.keys()).
--
___
Python tracker
<https://bugs.python.org/issue38
Serhiy Storchaka added the comment:
Since shutil.copy() accepts path-like object, I do not think there is a need to
add the copy method to Path.
As for additional limitation, it looks arbitrary and application specific. You
can easy implement a simple helper function as you just
Serhiy Storchaka added the comment:
Thank you Daniel. But profiling is not good for benchmarking, it adds too much
overhead. It can help to find narrow places, but for measuring effect of
optimization you need to measure the raw time on non-debug build.
Semantically your changes are correct
Serhiy Storchaka added the comment:
New changeset da6ce58dd5ac109485af45878fca6bfd265b43e9 by Serhiy Storchaka
(Daniel Hillier) in branch 'master':
bpo-36993: Improve error reporting for zipfiles with bad zip64 extra data.
(GH-14656)
https://github.com/python/cpyt
Change by Serhiy Storchaka :
--
pull_requests: +16507
pull_request: https://github.com/python/cpython/pull/16981
___
Python tracker
<https://bugs.python.org/issue28
Serhiy Storchaka added the comment:
There are expected some relations between str methods. For example,
s.replace(a, b, n) == s.replace(a, b) if n >= s.count(a)
len(s.replace(a, b, n)) == len(s) + (len(b)-len(a)) * n if 0 <= n <=
s.count(a)
len(s.replace(a, b, n)) == len(s) + (l
Serhiy Storchaka added the comment:
Note that no tests were affected by this change.
--
___
Python tracker
<https://bugs.python.org/issue28029>
___
___
Pytho
Serhiy Storchaka added the comment:
Thank you for your contribution Daniel.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
If float.__ceil__ is only needed for typeshed, maybe add a special case for
typeshed?
I have doubts about adding a C code which is never even executed.
--
nosy: +serhiy.storchaka
___
Python tracker
<ht
Serhiy Storchaka added the comment:
Oh, you are right. I misunderstood the original issue and thought that the code
first checks PyFloat_Check() or PyFloat_CheckExact().
If float.__ceil__ will be executed it will add significant overhead for
creating and executing the method object
Serhiy Storchaka added the comment:
Interesting, but all extra after the Extended Timestamp field is a UTF-8
encoded text:
b"\n\x00
\x00\x00\x00\x00\x00\x01\x00\x18\x00\x00\xeb\x93\x91'\xef\xbf\xbd\xef\xbf\xbd\x01\x00\xde\xa8\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x01\x00\xde\xa8\x
New submission from Serhiy Storchaka :
The decoding code can be much shorter and efficient.
Also, the Info-ZIP unzip utility is tolerant to extra bytes. We can be too.
--
components: Library (Lib)
messages: 355676
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +16514
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16988
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
Raymond, the link is about str.split(), not str.replace().
--
___
Python tracker
<https://bugs.python.org/issue28
Serhiy Storchaka added the comment:
There are also ncurses functions get_tabsize() and get_escdelay(). In other
implementations they can be modeled by returning the TABSIZE and ESCDELAY
global variables.
--
nosy: +serhiy.storchaka
___
Python
New submission from Serhiy Storchaka :
Currently math.floor(), math.ceil() and math.trunc() look up special methods
__floor__, __ceil__ and __trunc__ correspondingly and execute them if found.
Otherwise they execute common code for floats. There are no special slots for
these methods, so
Change by Serhiy Storchaka :
--
title: Optimize floor() and ceil() for floats -> Optimize floor(), ceil() and
trunc() for floats
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +16517
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16991
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
New changeset 865c3b257fe38154a4320c7ee6afb416f665b9c2 by Serhiy Storchaka in
branch 'master':
bpo-28029: Make "".replace("", s, n) returning s for any n != 0. (GH-16981)
https://github.com/python/cpython/commit/865c3b257f
Serhiy Storchaka added the comment:
New changeset 25fc088607c855060ed142296dc1bd0125fad1af by Serhiy Storchaka in
branch 'master':
bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950)
https://github.com/python/cpython/commit/25fc088607c855060ed142296dc1bd
Serhiy Storchaka added the comment:
Because of possible compatibility issue (very unlikely) this change is done
only in master and will not be backported.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9 -Python 2.7, P
Change by Serhiy Storchaka :
--
keywords: +3.8regression
nosy: +pablogsal, serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue38640>
___
___
Pytho
Change by Serhiy Storchaka :
--
pull_requests: +16526
pull_request: https://github.com/python/cpython/pull/16999
___
Python tracker
<https://bugs.python.org/issue38
Change by Serhiy Storchaka :
--
pull_requests: +16527
pull_request: https://github.com/python/cpython/pull/17000
___
Python tracker
<https://bugs.python.org/issue38
Change by Serhiy Storchaka :
--
pull_requests: +16528
pull_request: https://github.com/python/cpython/pull/17001
___
Python tracker
<https://bugs.python.org/issue38
Serhiy Storchaka added the comment:
New changeset 7f7f986cc485c40d80bae504333e3946ce9e96ba by Serhiy Storchaka in
branch '3.7':
[3.7] bpo-38600: Change the mark up of NULL in the C API documentation.
(GH-16950) (GH-17000)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
New changeset f2ba17be2aec873741c2d8a55b1342afa360aec2 by Serhiy Storchaka in
branch '3.8':
[3.8] bpo-38600: Change the mark up of NULL in the C API documentation.
(GH-16950) (GH-16999)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
New changeset e835b31d2b212c3c7820364398979cae2a9740b2 by Serhiy Storchaka in
branch 'master':
bpo-38600: NULL -> ``NULL``. (GH-17001)
https://github.com/python/cpython/commit/e835b31d2b212c3c78203643989
Change by Serhiy Storchaka :
--
pull_requests: +16530
pull_request: https://github.com/python/cpython/pull/17003
___
Python tracker
<https://bugs.python.org/issue38
Change by Serhiy Storchaka :
--
pull_requests: +16531
pull_request: https://github.com/python/cpython/pull/17004
___
Python tracker
<https://bugs.python.org/issue38
New submission from Serhiy Storchaka :
Currently the variable PyStructSequence_UnnamedField has type "char *". It is
used as a special value for setting to the name field of
PyStructSequence_Field. But the type of the name field is "const char *".
I propose to chang
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +16532
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17005
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
New changeset 951b6c314a8567be3b5d901059fde866c79f5ff0 by Serhiy Storchaka in
branch '3.7':
[3.7] bpo-38600: NULL -> ``NULL``. (GH-17001) (GH-17004)
https://github.com/python/cpython/commit/951b6c314a8567be3b5d901059f
Serhiy Storchaka added the comment:
New changeset 2c921c65e9d0aa7e3a38c96a22d5eec56724da72 by Serhiy Storchaka in
branch '3.8':
[3.8] bpo-38600: NULL -> ``NULL``. (GH-17001) (GH-17003)
https://github.com/python/cpython/commit/2c921c65e9d0aa7e3a38c96a22d
Serhiy Storchaka added the comment:
New changeset b32cb97bce472dad337c6b2f071883f6234e21d8 by Serhiy Storchaka
(Anthony Sottile) in branch 'master':
bpo-38312: Add curses.{get,set}_escdelay and curses.{get,set}_tabsize.
(GH-16938)
https://github.com/python/cpyt
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
There is nothing wrong with using {} as default value.
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue38
Serhiy Storchaka added the comment:
It is not needed. There is no bug. Nothing to change.
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
These two regexes are not the same.
>>> re.compile('([-_.a-zA-Z0-9]+)').match('ä')
>>> re.compile(r'([-\w.]+)').match('ä')
As Ammar said checking that two regexes always matches the same is very
Serhiy Storchaka added the comment:
Yes, the width is the width of the formatted value, not the number of digits.
What is your proposition?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue38
Serhiy Storchaka added the comment:
Python's regular expressions are not actually regular. Lookarounds and groups
make things more complex. Even it it is possible to build an ambiguous graph,
its size and the time of building can be too large for practical use. Dealing
with unicode is
Serhiy Storchaka added the comment:
This looks like a duplicate of issue24159.
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue38
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue38661>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
Matthew referred to the code of the regex module (of which he is the author).
https://pypi.org/project/regex/
--
___
Python tracker
<https://bugs.python.org/issue23
Serhiy Storchaka added the comment:
I am not sure there is much in common between this and issue33721. There are
many ways to get a file path unrepresentable at the OS level. But I do not know
any valid case for getting an out-of-range file descriptor. I am not convinced
there is a bug here
Serhiy Storchaka added the comment:
These types are obsolete. The compiler never generates an AST tree containing
them.
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue38
Serhiy Storchaka added the comment:
0.95 is actually 278419646001971/4503599627370496 which is smaller than 95/100.
>>> from fractions import Fraction
>>> Fraction(0.95)
Fraction(4278419646001971, 4503599627370496)
>>> Fraction(0.95) - Fraction(95, 100)
Fraction(-1
Serhiy Storchaka added the comment:
assertTrue() does not assert that the value is True. It asserts that it is
true. For example, non-zero number or non-empty collections will pass the check.
--
nosy: +serhiy.storchaka
resolution: -> not a bug
stage: patch review -> resolved
Serhiy Storchaka added the comment:
I am not English expert, but traditionally "true" is used as a synonym of a
truthy value everywhere in the Python documentation and code. There are almost
2000 occurrences. If it is a wrong word, it should be fixed in all these cases.
-
Serhiy Storchaka added the comment:
There are almost 500 occurrences of "is true".
--
___
Python tracker
<https://bugs.python.org/issue38706>
___
___
901 - 1000 of 25874 matches
Mail list logo