Serhiy Storchaka added the comment:
Path-like objects are now unintentionally accepted for many non-path things,
like hostname in socket.sethostname() and username in os.initgroups(). I also
think it was a mistake, and we should not make new mistakes
Serhiy Storchaka added the comment:
Even if we change the repr of functions (I like this idea), this will not solve
the general problem: many reprs contain an object id.
In your case I suggest to post-process the pydoc output and replace parts
matching ' at 0x[0-9a
Serhiy Storchaka added the comment:
reduce(gcd, [a, b, c, d, e])
--
___
Python tracker
<https://bugs.python.org/issue39479>
___
___
Python-bugs-list mailin
Change by Serhiy Storchaka :
--
nosy: +akuchling
___
Python tracker
<https://bugs.python.org/issue39480>
___
___
Python-bugs-list mailing list
Unsubscribe:
Serhiy Storchaka added the comment:
According to the documentation the attrs parameter does not have default value.
I think that the C implementation should be changed.
https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.TreeBuilder.start
Serhiy Storchaka added the comment:
Since the behavior was changed, I think we need a versionchanged directive.
This function was added in 3.0. Prior to 3.3 it was always successful (if you
pass an unicode object, that is required for most of PyUnicode API).
Py_FatalError was added in 3.3
Serhiy Storchaka added the comment:
New changeset 38c878b56cff997de8fb04a586c963039b69b414 by damani42 in branch
'master':
bpo-39424: Use assertRaisesRegex instead of assertRaisesRegexp. (GH-18277)
https://github.com/python/cpython/commit/38c878b56cff997de8fb04a586c963
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
If a < b, what is better,
a // gcd(a, b) * b
or
b // gcd(a, b) * a
? Or there is no difference?
--
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
I used COUNT_ALLOCS for curiosity. But I needed slightly different information,
so in any case I patched the code.
AFAIK COUNT_ALLOCS is used in some large projects (maybe Fedora). It was
already discussed somewhere on the tracker, but I have no a link
Serhiy Storchaka added the comment:
Other examples are:
* PyObject_HasAttr
* PyObject_HasAttrString
* PyMapping_HasKey
* PyMapping_HasKeyString
They are bad examples, but can't be changed for backward compatibility. I
wonder whether PyUnicode_IsIdentifier should also kept unchange
Serhiy Storchaka added the comment:
It was many years ago, and I used it to get some statistics about using Python
objects of some types. But it did not work as I wanted for cached integers etc.
In any case I can patch Python again if I need such information.
Seems Fedora was the main user
Serhiy Storchaka added the comment:
It is not convenient to check the result for error. After we remove support of
old PyUnicode API, PyUnicode_IsIdentifier() will be always succeeded.
Note that PyUnicode_IsIdentifier() still can crash if you pass a non-PyUnicode
object or NULL. It is a
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue39484>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
In general I agree with Raymond, although I am warmer to this feature. And I
think we should have a mechanism to deprecate not only options, but subcommands.
* The warnings module is used for warning about the use of API. It outputs the
file and the line
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +17679
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/18302
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
NetBSD also uses non-ncurses implementation of curses, but it supports
ESCDELAY, set_escdelay(), etc. This is not a difference between ncurses and
non-ncurse, but a problem specific to the AIX implementation of curses.
Please check that PR 18302 fixes the
Serhiy Storchaka added the comment:
Thank you Michael. Sorry, I just missed that you are working on your PR.
--
___
Python tracker
<https://bugs.python.org/issue39
Serhiy Storchaka added the comment:
Symptoms as when try to log very late at shutdown stage, when the content of
the builtin module is restored to its original value which does not include
open imported from io.
--
nosy: +serhiy.storchaka
Serhiy Storchaka added the comment:
1.30 is the same as 1.3 in Python.
You perhaps want to use '1.30'.
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.o
Serhiy Storchaka added the comment:
Will asyncio.get_event_loop() be removed or made an alias of
asyncio.get_running_loop()? The latter could minimize the disruption of the
existing code.
--
nosy: +serhiy.storchaka
___
Python tracker
<ht
Serhiy Storchaka added the comment:
Yes, it is what I meant.
Many code written before 3.7 use get_event_loop() because there was no
get_running_loop() yet. Now, to avoid deprecation (and making the code more
robust) it should be rewritten with using get_running_loop() or
get_event_loop
New submission from Serhiy Storchaka :
The C implementation raises a SystemError after setting Element.attrib to
non-dict.
>>> from xml.etree import ElementTree as ET
>>> e = ET.Element('a')
>>> e.attrib = 1
>>> e.get('x')
Traceback (mo
Serhiy Storchaka added the comment:
The problem is that there is a double rounding in
time = float(time_ns) / 1e9
1. When convert time_ns to float.
2. When divide it by 1e9.
The formula
time = time_ns / 10**9
may be more accurate.
--
nosy: +lemburg, mark.dickinson
Serhiy Storchaka added the comment:
But they are not single-digit integers. And more, int(float(a)) != a.
--
___
Python tracker
<https://bugs.python.org/issue39
Serhiy Storchaka added the comment:
>>> 1580301619906185300/10**9
1580301619.9061854
>>> 1580301619906185300/1e9
1580301619.9061852
>>> float(F(1580301619906185300/10**9) * 10**9 - 1580301619906185300)
88.5650634765625
>>> float(F(158030161990618530
New submission from Serhiy Storchaka :
The following code is compiled in 3.7, but is a syntax error in 3.6.
async def f(x):
f"{await x}"
I have not found mentioning this change in What's New, and it looks
grammatically correct. It looks as a bug in 3.6.
It may be too lat
Serhiy Storchaka added the comment:
Yes, await was recognized only in asynchronous functions. f-strings involve a
separate parsing step for subexpressions, and it is not aware that it is in an
asynchronous function. Seems the fix was unintentional, but it should
documented in any case
Serhiy Storchaka added the comment:
I planned to add a table for end line numbers, so every instruction will be
associated with a range of lines.
For example, in
x = {
a,
b
}
the BUILD_SET instruction will be associated with lines 1-4. Currently it is
associated only with line
Serhiy Storchaka added the comment:
I do not understand what the problem is.
If the isinstance tuple iteration were to start using __iter__ in the future,
it should start to handle all corner cases. But what is wrong now?
--
nosy: +serhiy.storchaka
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +17735
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/18360
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
New changeset 8b6f6526f857bb7523b0fcff09b45bc6471289e9 by Shantanu in branch
'master':
bpo-39559: Remove unused, undocumented argument from uuid.getnode (GH-18369)
https://github.com/python/cpython/commit/8b6f6526f857bb7523b0fcff09b45b
Serhiy Storchaka added the comment:
I agree. It was added in issue32502, but was never documented and used.
Thank you Sebastian and Shantanu.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Pytho
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue39562>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
New changeset 3d06953c34fd6421dd1dfdb615578cde676ee0eb by Andy Lester in branch
'master':
bpo-39127: Make _Py_HashPointer's argument be const (GH-17690)
https://github.com/python/cpython/commit/3d06953c34fd6421dd1dfdb615578cde676ee0eb
New submission from Serhiy Storchaka :
See issue38149.
There is an audit for os.scandir(), but it would be useful to have information
about higher-level operations.
--
components: Library (Lib)
messages: 361472
nosy: serhiy.storchaka, steve.dower
priority: normal
severity: normal
Change by Serhiy Storchaka :
--
title: Add audit for os.walk, os.fwalk, Path.glob() and Path.rglob() -> Add
audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob()
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +17748
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/18372
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
New changeset 54b4f14712b9350f11c983f1c8ac47a3716958a7 by Serhiy Storchaka in
branch 'master':
bpo-38149: Call sys.audit() only once per call for glob.glob(). (GH-18360)
https://github.com/python/cpython/commit/54b4f14712b9350f11c983f1c8ac47
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
You have merged so much PRs today. What they do?
PyObject cannot just be made an opaque structure. The user code reads and
writes its fields directly and via macros. This change would break working code.
We can encourage the user code to prepare to making
Serhiy Storchaka added the comment:
See a discussion on Python-Dev:
https://mail.python.org/archives/list/python-...@python.org/message/YMIGWRUERUG66CKRJXDXNPCIDHRQJY6V/
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.
Serhiy Storchaka added the comment:
They cannot. PyObject cannot be const because the code that uses it can change
its reference counter even if it does not change any other fields.
--
nosy: +serhiy.storchaka
___
Python tracker
<ht
Change by Serhiy Storchaka :
--
resolution: -> rejected
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
Yes, Py_INCREF and Py_DECREF change the type, and therefore constness.
--
___
Python tracker
<https://bugs.python.org/issue39
Serhiy Storchaka added the comment:
Even if the object is not modified currently in common case, it does not
guarantee that it cannot be modified in uncommon cases, or that it cannot be
modified in future after introducing changes in different files.
For example, if names was created by the
Serhiy Storchaka added the comment:
Needed also notes in 3.7+.
--
resolution: fixed ->
stage: resolved ->
status: closed -> open
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
pull_requests: +17830
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/18456
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
pull_requests: +17833
pull_request: https://github.com/python/cpython/pull/18459
___
Python tracker
<https://bugs.python.org/issue39
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue39474>
___
___
Python-bugs-list mailing list
Unsub
Change by Serhiy Storchaka :
--
assignee: -> serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue39474>
___
___
Python-bugs-list mailing list
Un
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +17847
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/18477
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
New changeset f4f445b69306c68a2ba8ce8eb8c6cb3064db5fe7 by Serhiy Storchaka in
branch 'master':
bpo-39567: Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob().
(GH-18372)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
New changeset 0cc6b5e559b8303b18fdd56c2befd900fe7b5e35 by Serhiy Storchaka in
branch 'master':
bpo-39219: Fix SyntaxError attributes in the tokenizer. (GH-17828)
https://github.com/python/cpython/commit/0cc6b5e559b8303b18fdd56c2befd9
Serhiy Storchaka added the comment:
New changeset 8c579b1cc86053473eb052b76327279476740c9b by Serhiy Storchaka in
branch 'master':
bpo-32856: Optimize the assignment idiom in comprehensions. (GH-16814)
https://github.com/python/cpython/commit/8c579b1cc86053473eb052b7632727
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:
Thank you Łukasz. I considered this as a bug fix, but was not sure that we
should fix these bugs. They were here from the beginning.
Josh, as for using total_ordering, I think it is a different issue. I did not
want to change the behavior except fixing
Serhiy Storchaka added the comment:
New changeset 6e619c48b8e804ece9521453fc8da0640a04d5b1 by Serhiy Storchaka in
branch 'master':
bpo-39474: Fix AST pos for expressions like (a)(b), (a)[b] and (a).b. (GH-18477)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
It was reverted because it is backward incompatible change. It breaks a code
which assigns to the tp_getattr field without explicit type cast to getattrfunc.
--
nosy: +serhiy.storchaka
___
Python tracker
<ht
Change by Serhiy Storchaka :
--
pull_requests: +17873
pull_request: https://github.com/python/cpython/pull/18499
___
Python tracker
<https://bugs.python.org/issue39
Serhiy Storchaka added the comment:
Oh, I did not know about the audit-event directive. Thanks Karthikeyan.
As for backporting this to 3.8 I left it on to the RM.
--
nosy: +lukasz.langa
resolution: fixed ->
stage: resolved -> patch review
status: closed -
Serhiy Storchaka added the comment:
New changeset fbeba8f2481411d608a616366394e07cdc52e0bb by mpheath in branch
'master':
bpo-39524: Fixed doc-string in ast._pad_whitespace (GH-18340)
https://github.com/python/cpython/commit/fbeba8f2481411d608a616366394e0
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
Every bytecode is generated from some AST node which has an associated range of
lines. So there should not be bytecodes that have no line number.
If for some reasons you generate bytecodes that have no line number, you can
just set lineno > end_lineno
Change by Serhiy Storchaka :
--
pull_requests: +17891
pull_request: https://github.com/python/cpython/pull/18514
___
Python tracker
<https://bugs.python.org/issue32
Serhiy Storchaka added the comment:
Updated the PR.
I can obviously be biased about my changes, so I need an approval of other core
developer to merge them.
I created several PRs to popular third-party projects which work with AST to
support both old and new AST schemes
Serhiy Storchaka added the comment:
fsync() may be slower than fdatasync(). There may be cases in which you prefer
to not call fsync() or call it less often if POSIX fdatasync() is not
available. To do this you should know whether Python fdatasync() calls POSIX
fdatasync() or fsync(). The
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue39382>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
Thank you for your report and patch. Agree that the code does not look safe. Do
you mind to create a pull request?
Would be nice to add a test for it. The three references to the Python class
are:
* the __dict__ descriptor
* the __weakref__ descriptor
Serhiy Storchaka added the comment:
What is binary addition, how it differs from just addition, what type of
objects it operates?
--
___
Python tracker
<https://bugs.python.org/issue39
Serhiy Storchaka added the comment:
What problems it will create?
--
___
Python tracker
<https://bugs.python.org/issue39648>
___
___
Python-bugs-list mailin
Serhiy Storchaka added the comment:
Should it take variable number of positional arguments or a single iterable
argument as max() and min()?
What should it return for 0 arguments?
--
___
Python tracker
<https://bugs.python.org/issue39
Serhiy Storchaka added the comment:
Python as programming language provides builtin blocks. This is a good example
of using functools.reduce().
But if you can provide an algorithm for calculating the GCD and LCM more
efficient than sequential applying gcd() and lcm() for two arguments, it
Serhiy Storchaka added the comment:
New changeset 85a2eef473a2c9ed3ab9c6ee339891fe99adbbc9 by Serhiy Storchaka in
branch 'master':
bpo-32892: Update the documentation for handling constants in AST. (GH-18514)
https://github.com/python/cpython/commit/85a2eef473a2c9ed3ab9c6ee339891
Serhiy Storchaka added the comment:
Yes, I got the same error message when tried to get such class.
super() is called implicitly by the type constructor to call __init_subclass__
on the parent of a newly generated type.
--
nosy: +serhiy.storchaka
Serhiy Storchaka added the comment:
Agree. Do you want to provide a PR?
Although it may be too later for 3.6 which only takes security fixes.
--
keywords: +easy
nosy: +serhiy.storchaka
stage: -> needs patch
versions: +Python 3.7, Python 3.8, Python
Serhiy Storchaka added the comment:
No, this PR does not change the Python syntax. It only changes the AST
representation.
--
___
Python tracker
<https://bugs.python.org/issue34
Serhiy Storchaka added the comment:
It is correct and documented behavior. ".*" matches two substrings: the whole
string "bc" and an empty string at the end of the string.
See https://docs.python.org/3/library/re.html#re.sub and
https://docs.python.org/3/whatsnew/3.7
New submission from Serhiy Storchaka :
Objects/clinic/unicodeobject.c.h: In function ‘unicode_isidentifier’:
Objects/unicodeobject.c:12245:22: warning: ‘wstr’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
ch = wstr[i];
^~~
Objects
Serhiy Storchaka added the comment:
See similar issue for SimpleNamespace: https://bugs.python.org/issue31655.
We should add a similar check in str.format(). Accepting a non-string keys is
an implementation detail. There is no guarantee that it works in other
implementations.
It should not
Serhiy Storchaka added the comment:
For more informative representation you can use ast.dump().
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue39
Serhiy Storchaka added the comment:
Sorry, Ananthakrishnan, but I think this problem is too difficult to you.
Adding math.lcm() taken 2 weeks and produced 200 messages. It is simpler to
implement this feature myself to me.
--
___
Python tracker
Change by Serhiy Storchaka :
--
pull_requests: +17970
pull_request: https://github.com/python/cpython/pull/18604
___
Python tracker
<https://bugs.python.org/issue39
Serhiy Storchaka added the comment:
I'm always ready to help a beginner, but this is the first time that it takes
so much effort. It would be easier if you started with the simple problems you
could handle. Even in simple cases you would be able to get tips that you can
understan
Serhiy Storchaka added the comment:
If expand math.gcd() to accept multiple arguments, it is worth to do the same
with math.lcm().
--
title: Update math.gcd() to accept "n" arguments. -> Expand math.gcd() and
math.lcm() to accept multi
Serhiy Storchaka added the comment:
New changeset 1c56f8ffad44478b4214a2bf8eb7cf51c28a347a by Yonatan Goldschmidt
in branch 'master':
bpo-39382: Avoid dangling object use in abstract_issubclass() (GH-18530)
https://github.com/python/cpython/commit/1c56f8ffad44478b4214a2bf8eb7cf
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
Interesting problem.
Example which does not depend on os.environ:
import traceback
try:
try:
raise TypeError
except:
try:
raise ValueError
except:
raise KeyError from None
except BaseException as exc
Serhiy Storchaka added the comment:
For reference: PEP 3134 (and superseded PEP 344), PEP 409, PEP 415.
--
___
Python tracker
<https://bugs.python.org/issue39
Serhiy Storchaka added the comment:
It is more complicated. In the following example
try:
try:
raise TypeError
except:
try:
try:
raise OverflowError
except:
raise ValueError
except:
raise
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
nosy_count: 4.0 -> 5.0
pull_requests: +17994
pull_request: https://github.com/python/cpython/pull/18629
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
nosy: +ned.deily, ronaldoussoren
___
Python tracker
<https://bugs.python.org/issue39732>
___
___
Python-bugs-list mailin
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +17996
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/18629
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
pull_requests: -17994
___
Python tracker
<https://bugs.python.org/issue39019>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue38913>
___
___
Python-bugs-list mailing list
Unsub
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +18017
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/18656
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
I have doubts that such small change can lead to significant speed up. It is
likely a compiler glitch.
But this change makes the code clearer. If you remove a NEWS entry with a
doubtful promise I will accept it
Serhiy Storchaka added the comment:
Yes, this is how exceptions are pickled. You save an information which which
allows you to recreate the exception. If you fake args, you do not able to
recreate it.
Just do not do this.
--
nosy: +serhiy.storchaka
2401 - 2500 of 25874 matches
Mail list logo