Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Serhiy Storchaka :
There are design flaws in PyDict_GetItem(), PyDict_GetItemString() and
_PyDict_GetItemId().
1. They suppress all exceptions raised internally. Most common of are
MemoryError, KeyboardInterrupt and RecursionError whose raising is out of
control of the
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +21622
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/22648
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
pull_requests: +21623
pull_request: https://github.com/python/cpython/pull/22649
___
Python tracker
<https://bugs.python.org/issue41
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: -Python 3.8
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
resolution: -> out of date
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
nosy: +gvanrossum, levkivskyi
___
Python tracker
<https://bugs.python.org/issue42010>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
Do you mind to create a PR Yannick?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue42
Serhiy Storchaka added the comment:
Thank you Yannick for your report and PR!
--
___
Python tracker
<https://bugs.python.org/issue42015>
___
___
Python-bug
Change by Serhiy Storchaka :
--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
___
Python tracker
<https://bugs.python.org/issue42
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
type: -> enhancement
versions: +Python 3.10, Python 3.8
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
Few things I forget about. The new C API function should be exported in
PC/python3dll.c.
Also, in Include/abstract.h it should only be available for limited C API >=
3.10:
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A
...
#endif
Serhiy Storchaka added the comment:
New changeset 04b8631d84a870dda456ef86039c1baf34d08500 by Yannick Jadoul in
branch 'master':
bpo-42015: Reorder dereferencing calls in meth_dealloc, to make sure m_self is
kept alive long enough (GH-22670)
https://github.com/python/cpyt
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 391a544f2a52673f6630c672e89840fd6ac36723 by Miss Skeleton (bot)
in branch '3.9':
bpo-41993: Fix possible issues in remove_module() (GH-22631) (GH-22647)
https://github.com/python/cpython/commit/391a544f2a52673f6630c672e89840
Serhiy Storchaka added the comment:
Added Hynek, the original committer of this code.
--
nosy: +giampaolo.rodola, hynek, serhiy.storchaka, tarek
versions: -Python 3.5, Python 3.6, Python 3.7
___
Python tracker
<https://bugs.python.org/issue42
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 b4d895336a4692c95b4533adcc5c63a489e5e4e4 by Anatoliy Platonov in
branch 'master':
bpo-41876: Overload __repr__ for tkinter Font objects (GH-22450)
https://github.com/python/cpython/commit/b4d895336a4692c95b4533adcc5c63
Change by Serhiy Storchaka :
--
pull_requests: +21664
pull_request: https://github.com/python/cpython/pull/22693
___
Python tracker
<https://bugs.python.org/issue20
Serhiy Storchaka added the comment:
$ python3.8 -m timeit -s "a = {'a': 1}" "dict(**a)"
200 loops, best of 5: 113 nsec per loop
$ python3.9 -m timeit -s "a = {'a': 1}" "dict(**a)"
200 loops, best
Change by Serhiy Storchaka :
--
resolution: -> out of date
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
Python does not set the meaning and the value of these fields itself. It
exposes C constants. Should we just copy definitions from corresponding C or
floating-point standards?
--
___
Python tracker
<ht
Serhiy Storchaka added the comment:
Oh, seems it was what Raymond proposed initially.
--
___
Python tracker
<https://bugs.python.org/issue41822>
___
___
Pytho
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
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
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:
Seems that we can not control entity definitions and expansions. We only can
limit the number of expanded entities per element (the size of self.data).
What is the reasonable default limit (taking into account that every < and
〹 is a separate entity)?
Serhiy Storchaka added the comment:
Oh, I missed that there is a handler for EntityDecl. Well, then we can fix this
issue in few lines of code.
I think it should be backported. We can add private flag (global or class
variable) to enable entity declarations, but do not support them in 3.10
Serhiy Storchaka added the comment:
New changeset a0c603cb9d4dbb9909979313a88bcd1f5fde4f62 by Ma Lin in branch
'master':
bpo-38252: Use 8-byte step to detect ASCII sequence in 64bit Windows build
(GH-16334)
https://github.com/python/cpython/commit/a0c603cb9d4dbb9909979313a88bcd
Serhiy Storchaka added the comment:
New changeset c304c9a7efa8751b5bc7526fa95cd5f30aac2b92 by scaramallion in
branch 'master':
bpo-41966: Fix pickling pure datetime.time subclasses (GH-22731)
https://github.com/python/cpython/commit/c304c9a7efa8751b5bc7526fa95cd5
Serhiy Storchaka added the comment:
New changeset 1bcaa81e520e30f920bd69e46fbf1d67a9107ce1 by Serhiy Storchaka in
branch 'master':
bpo-20184: Convert termios to Argument Clinic. (GH-22693)
https://github.com/python/cpython/commit/1bcaa81e520e30f920bd69e46fbf1d
Serhiy Storchaka added the comment:
New changeset a055ced9d43630cadc3c1d5edab0884f2c5131ea by Miss Skeleton (bot)
in branch '3.9':
bpo-41966: Fix pickling pure datetime.time subclasses (GH-22731) (GH-22747)
https://github.com/python/cpython/commit/a055ced9d43630cadc3c1d5edab088
Serhiy Storchaka added the comment:
New changeset 1040299e9283609f3de0f6e32a0d43458fe7f4f6 by Miss Skeleton (bot)
in branch '3.8':
bpo-41966: Fix pickling pure datetime.time subclasses (GH-22731) (GH-22748)
https://github.com/python/cpython/commit/1040299e9283609f3de0f6e32a0d43
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 b81c833ab51fb7d7f0f8eaace37f60ef7455aa85 by Irit Katriel in
branch 'master':
bpo-28660: Make TextWrapper break long words on hyphens (GH-22721)
https://github.com/python/cpython/commit/b81c833ab51fb7d7f0f8eaace37f60
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 5368c2b6e23660cbce7e38dc68f859c66ac349ee by Bar Harel in branch
'master':
bpo-19270: Fixed sched.scheduler.cancel to cancel correct event (GH-22729)
https://github.com/python/cpython/commit/5368c2b6e23660cbce7e38dc68f859
Change by Serhiy Storchaka :
--
pull_requests: +21724
pull_request: https://github.com/python/cpython/pull/22759
___
Python tracker
<https://bugs.python.org/issue13
Serhiy Storchaka added the comment:
Other problem is that the repr looks like an evaluable expression, but
evaluating it will always produce error.
>>> st = os.stat('/dev/null')
>>> st
os.stat_result(st_mode=8630, st_ino=6, st_dev=6, st_nlink=1, st_uid=0,
s
Change by Serhiy Storchaka :
--
pull_requests: +21762
pull_request: https://github.com/python/cpython/pull/22805
___
Python tracker
<https://bugs.python.org/issue38
Serhiy Storchaka added the comment:
Thank you for catching this. It was an error introduced by merge.
--
___
Python tracker
<https://bugs.python.org/issue38
Serhiy Storchaka added the comment:
Does plutil support octal (0o) and binary (0b) literals?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue41
Serhiy Storchaka added the comment:
New changeset 1d3469988e2c1f53ca84ffdc979d548c04ba3906 by Serhiy Storchaka in
branch 'master':
bpo-38144: Re-add accidentally removed audition for glob. (GH-22805)
https://github.com/python/cpython/commit/1d3469988e2c1f53ca84ffdc979d54
Serhiy Storchaka added the comment:
Callable is very special generic. It differs in many ways from List or
Awaitable. You cannot just use GenericAlias.
Also, in contrary to list() or dict(), callable() is not a constructor, it is a
predicate. callable[[int], str]() does not make sense
Change by Serhiy Storchaka :
--
pull_requests: +21812
pull_request: https://github.com/python/cpython/pull/22870
___
Python tracker
<https://bugs.python.org/issue41
Serhiy Storchaka added the comment:
I came to the same conclusion after trying to fix it. But we cannot just do it
now. We have to fix bugs in Python 3.9 and support protocols 0 and 1 for some
deprecation period.
Also protocols 0 and 1 are used in some third-party implementations for other
Serhiy Storchaka added the comment:
There are two issues here.
The simple one is building a large format string for struct.unpack(). It has
simple solution: use f'>{n}{_BINARY_FORMAT[size]}'.
The hard issue is that read(n) allocates n bytes in memory even if there are
not so
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +21822
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/22882
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
PR 22882 fixes problem in _read_ints(), adds validation for string size, and
adds many tests for mailformed binary Plists.
There may be problems with recursive collections. I'll try to solve the
Serhiy Storchaka added the comment:
No, with recursive collections all is good.
Then I'll just add a NEWS entry and maybe few more tests.
--
___
Python tracker
<https://bugs.python.org/is
Serhiy Storchaka added the comment:
I agree that it is not worth to add this optimization.
--
___
Python tracker
<https://bugs.python.org/issue24165>
___
___
Change by Serhiy Storchaka :
--
resolution: -> rejected
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
New changeset 8cd1dbae32d9303caac3a473d3332f17bc98c921 by Serhiy Storchaka in
branch 'master':
bpo-41052: Fix pickling heap types implemented in C with protocols 0 and 1
(GH-22870)
https://github.com/python/cpyt
Change by Serhiy Storchaka :
--
pull_requests: +21880
pull_request: https://github.com/python/cpython/pull/22963
___
Python tracker
<https://bugs.python.org/issue41
Serhiy Storchaka added the comment:
New changeset 0aaecb30483e98fc29c1f4253967d05da092f0c5 by Serhiy Storchaka in
branch '3.9':
[3.9] bpo-41052: Fix pickling heap types implemented in C with protocols 0 and
1 (GH-22870). (GH-22963)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
Sorry, but I do not think it is worth. If there are any issues with multiplying
by 1, it may be worth to optimize multiplication of integers in general. But
iterating range(1 << 1000, (1 << 1000) + 100) looks a pretty artificial example.
---
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 fb5db7ec58624cab0797b4050735be865d380823 by Serhiy Storchaka in
branch 'master':
bpo-42006: Stop using PyDict_GetItem, PyDict_GetItemString and
_PyDict_GetItemId. (GH-22648)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
My plan is to deprecate PyDict_GetItem() and functions with same design flaw
and finally remove them (in 4.0?).
We cannot start to ignore exceptions in PyDict_GetItem(). It would not fix the
original flaw when the user code does not check an exception
Change by Serhiy Storchaka :
--
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Use PyDict_Contains() and PyDict_SetDefault() instead of
PyDict_GetItemIdWithError
___
Python tracker
<https://bugs.python.org/issue42
New submission from Serhiy Storchaka :
It was common to use the code PyDict_GetItem(dict, key) == NULL to check
whether the key is in the dict. PyDict_GetItem() returns borrowed reference, so
no clean up is needed. And if we need to check only existence of the key, we do
not need to store a
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +21900
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/22986
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
The code uses also _PyDict_ContainsId() added in issue42006 instead of
_PyDict_GetItemIdWithError().
Few uses of _PyDict_GetItemStringWithError() are left as is. I do not think it
is worth to introduce _PyDict_ContainsString(). They could be rewritten
Serhiy Storchaka added the comment:
I think that In sum(range(1 << 1000, (1 << 1000) + 100)) it is dwarfed by
repeated addition of long integers in sum(). I expect the the effect of this
optimization is even less that 13% in this case. In any case, for sum(range(a,
b)) it is b
Serhiy Storchaka added the comment:
New changeset b510e101f8b5b31276bf97b921ca9247162881d2 by Serhiy Storchaka in
branch 'master':
bpo-42152: Use PyDict_Contains and PyDict_SetDefault if appropriate. (GH-22986)
https://github.com/python/cpython/commit/b510e101f8b5b31276bf97b921ca92
New submission from Serhiy Storchaka :
Documentation says that parsedate_to_datetime() performs the same function as
parsedata(), but on success returns a datetime.
parsedata() returns None when date cannot be parsed, but
parsedate_to_datetime() raises TypeError.
>>> email.utils.
Change by Serhiy Storchaka :
--
assignee: -> serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue42096>
___
___
Python-bugs-list mailing list
Un
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue42096>
___
___
Python-bugs-list mailing list
Unsub
Change by Serhiy Storchaka :
--
nosy: +jaraco, rhettinger
___
Python tracker
<https://bugs.python.org/issue42163>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
specified_attributes = True is also set in xml.dom.expatbuilder. Should not it
be set to true in the C implementation of ElementTree?
--
___
Python tracker
<https://bugs.python.org/issue42
Serhiy Storchaka added the comment:
Seems that np.float64 implements the buffer protocol, i.e. it can be accepted
in any function that supports the buffer protocol (for example
b'abc\xc1\x1c=~o\xd3\xd5?def'.index(np.float64(0.34103))). And pickle.loads()
is one of such functions,
Serhiy Storchaka added the comment:
>>> email.utils.parsedate_to_datetime(None)
Traceback (most recent call last):
File "", line 1, in
File "/home/serhiy/py/cpython/Lib/email/utils.py", line 200, in
parsedate_to_datetime
raise ValueError('Invalid dat
Serhiy Storchaka added the comment:
This is a duplicate of issue28494.
I concur with Gregory. What we can do -- improve the documentation.
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> is_zipfile fal
Serhiy Storchaka added the comment:
It cannot use LOAD_GLOBAL because the name can be not global. For example:
def f(self): ...
f = property(f)
It cannot use STORE_FAST and LOAD_FAST because they work with specific
representation of locals as array, but in a class body it can be
Serhiy Storchaka added the comment:
It points on strcmp(lower, "us_ascii") == 0.
Seems that the compiler optimizes calling strcmp() with compile-time constant
"us_ascii" by reading and comparing first 8 bytes as single word. But if lower
contains "latin1" i
Change by Serhiy Storchaka :
--
nosy: +jaraco
___
Python tracker
<https://bugs.python.org/issue42189>
___
___
Python-bugs-list mailing list
Unsubscribe:
Serhiy Storchaka added the comment:
New changeset 350526105fa9b131d8b941ae753378b741dabb2f by Yonatan Goldschmidt
in branch 'master':
bpo-42143: Ensure PyFunction_NewWithQualName() can't fail after creating the
func object (GH-22953)
https://github.com/python
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8, Python 3.9
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
New changeset 60324d26b58c89d68abb23fb42f1563d395c3910 by Miss Skeleton (bot)
in branch '3.9':
bpo-42143: Ensure PyFunction_NewWithQualName() can't fail after creating the
func object (GH-22953) (GH-23021)
https://github.com/python
Serhiy Storchaka added the comment:
Are annotations now always known at compile time?
As for representation, it can also be a sequence of pairs (('x', 'int'), ('z',
'float'), ('return', 'Hoge')) or a pair of sequences (('x
Serhiy Storchaka added the comment:
It can happen if the code is executed very late at the shutdown stage. The
builtin module is restored to its initial state (open is imported from io) to
get rid of reference cycles.
--
nosy: +serhiy.storchaka, vinay.sajip
Serhiy Storchaka added the comment:
> Yes, but it is bit larger than my single tuple idea in most cases.
Yes, but the code for creating a dict can be simpler. In any case we will
better see what format is better when try to write a code.
> I am not sure this is the best option because
Serhiy Storchaka added the comment:
I think this is a multi-level problem, and it perhaps should be solved on
different levels separately.
As for logging, it can be used at shutdown by user code, it may help to
understand the problem with the user code, and it may work most of time. But if
Serhiy Storchaka added the comment:
Yes, solving any of issue26789 or issue39513 will likely solve also this issue.
But this issue is the one which relates to asyncio tests, so there may be some
flaw in tests which should be fixed too. Solving issue26789 or issue39513 will
eliminate
Serhiy Storchaka added the comment:
I am not sure that its all the same issue. There may be several different
issues:
* Issue39513. Logging fails with confusing traceback when called late at
shutdown. I think that if logging cannot work at this stage it should either do
nothing or emit a
Serhiy Storchaka added the comment:
Issue26789 is about asyncio, but this issue about logging.
--
___
Python tracker
<https://bugs.python.org/issue39
Serhiy Storchaka added the comment:
Would not be better to change typing.Callable?
Attributes __origin__, __args__ and __parameters__ are not documented in the
typing module. They are also not mentioned in any PEP except PEP 585. So I
don't know what is intention and correct value of
Serhiy Storchaka added the comment:
Do you mean sharing values of co_code and co_lnotab between code objects of the
same module?
How much memory does this save (in absolute and relative value)? Which
functions have the same co_code?
--
nosy: +serhiy.storchaka
Serhiy Storchaka added the comment:
Both changes add significant amount of code (100 and 85 lines correspondingly).
Even if they speed up a particular case of dict constructor it is not common
use case.
I think that it would be better to reject these changes. They make maintenance
harder
Serhiy Storchaka added the comment:
See also issue30030.
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue42160>
___
___
Python-bug
Serhiy Storchaka added the comment:
Nice catch Zac!
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue42218>
___
___
Python-bugs-list m
Serhiy Storchaka added the comment:
Instead of os.getpid() we can use a global variable, and the single callback
can reset it.
But is it worth? Is os.getpid() so slow?
--
___
Python tracker
<https://bugs.python.org/issue42
Serhiy Storchaka added the comment:
Do not overestimate the importance of _PyStack_AsDict(). Most of calls (~90-95%
or like) are with positional only arguments, and most of functions do not have
var-keyword parameter. So efforts in last years were spent on optimizing common
cases, in
Serhiy Storchaka added the comment:
I have tested my idea, such optimization speeds up _RandomNameSequence by 16%.
At the cost of more complex code. It is not worth.
--
resolution: -> rejected
stage: patch review -> resolved
status: open -&g
Serhiy Storchaka added the comment:
It changes the behavior. Currently randrange(10.0) works, but with PR 23064 it
would fail.
See issue40046 with a ready PR for increasing coverage for the random module.
If it would accepted, some tests would fail with PR 23064.
If you want to deprecate
Serhiy Storchaka added the comment:
I think and always thought that integer domain functions should not accept
non-integer arguments even with integer value. This is why I submitted numerous
patches for deprecating and finally removing support of non-integer arguments
in most of integer
4001 - 4100 of 25874 matches
Mail list logo