[issue42784] issues with object.h includes

2020-12-29 Thread Big Boss


New submission from Big Boss :

using #include  in header files is known to cause conflict with other 
projects using similar  header file. Best workaround should be 
renaming to . Probably better to do the same thing to other header 
files as well. Or wrap it around with a folder. Like 

--
components: C API
messages: 384050
nosy: bigbossbro08
priority: normal
severity: normal
status: open
title: issues with object.h includes
type: compile error
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2020-12-29 Thread hai shi


hai shi  added the comment:

After PR 23405 and PR 24006 merged, I think this bpo can be closed.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2020-12-29 Thread hai shi


hai shi  added the comment:

> I wrote PR 24006 to fix the leak.
Oh, thanks for your fix, victor.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42763] Exposing a race in the "_warnings" resulting Python parser crash

2020-12-29 Thread Xinmeng Xia


Xinmeng Xia  added the comment:

Now I see. By the way, I think this case should be moved back to 
"cpython/Lib/test/crashers/" since the bug still exists.  It is not fixed 
completely, the old case is outdated. I suggest we can put the new case into 
directory "crashers".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42717] The python interpreter crashed with "_enter_buffered_busy"

2020-12-29 Thread Xinmeng Xia


Xinmeng Xia  added the comment:

Thank you for your patient reply. I see now. Hoping that some one can figure 
out a good idea to fix this problem.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42780] os.set_inheritable() fails for O_PATH file descriptors on Linux

2020-12-29 Thread cptpcrd


cptpcrd  added the comment:

> I like this approach!

Should I put together unit tests to go with the patch? Maybe 
`test_os.FDInheritanceTests.test_set_inheritable_o_path()`?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2020-12-29 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ba0e49a4648e727d1a16b3ce479499eb39f22311 by Victor Stinner in 
branch 'master':
bpo-40137: Fix refleak in _functools_exec() (GH-24006)
https://github.com/python/cpython/commit/ba0e49a4648e727d1a16b3ce479499eb39f22311


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-12-29 Thread STINNER Victor


STINNER Victor  added the comment:

> No refs leaking anymore!?

Well, there is another test:

$ ./python -X showrefcount -c pass
[23547 refs, 6589 blocks]

Python still leaks 23547 refs at exit.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag?

2020-12-29 Thread STINNER Victor


STINNER Victor  added the comment:

Ah, I see that there is a misunderstanding. The flag is used for two things:

(*) Create/Declare a type

IMO Py_TPFLAGS_HAVE_VERSION_TAG and Py_TPFLAGS_HAVE_FINALIZE are useless for 
that.

(*) Check if a type has the flag

An extension built with the stable ABI *can* use PyType_HasFeature(type, 
Py_TPFLAGS_HAVE_VERSION_TAG).

I'm only aware of PyQt which uses the stable ABI. Is there other projects using 
it? Do these projects check for Py_TPFLAGS_HAVE_VERSION_TAG or 
Py_TPFLAGS_HAVE_FINALIZE flag?

If we cannot be used that no extension module built with the stable ABI for 
these flags, the safe option is to keep them, deprecate them, and always define 
them. For example, add the flags to Py_TPFLAGS_DEFAULT and/or add them in 
type_new() or PyType_Ready().

--

Py_TPFLAGS_HAVE_VERSION_TAG is really an internal tag. It should only be used 
by _PyType_Lookup().

I'm not sure why someone would like to check explicitly for the 
Py_TPFLAGS_HAVE_FINALIZE flag. I would expect that only Python internals call 
the tp_finalize slot.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag?

2020-12-29 Thread STINNER Victor


STINNER Victor  added the comment:

Serhiy Storchaka:
> I don't think that it was right thing to break binary compatibility. It 
> virtually buried the stable ABI.

IMO there is a misunderstanding about the stable ABI. PyType_FromSpec() doesn't 
need Py_TPFLAGS_HAVE_xxx flags: this function allocates a heap type which *has* 
all these members (set to 0/NULL by default).

And it's not possible to define a static type using the limited C API, since 
the PyTypeObject structure is excluded from it on purpose.

See bpo-32388 for a similar discussion.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-12-29 Thread Paulo Henrique Silva


Paulo Henrique Silva  added the comment:

Repeated msg355187 testing on master[056c08211b].

---
#include 

void func()
{
Py_Initialize(); Py_Finalize();
Py_ssize_t cnt = _Py_GetRefTotal();
printf("sys.gettotalrefcount(): %zd\n", cnt);
}

int main(int argc, char *argv[])
{
Py_SetProgramName(L"./_testembed");
for (int i=0; i < 10; i++) {
func();
}
}
---

No refs leaking anymore!?

---
sys.gettotalrefcount(): 10241
sys.gettotalrefcount(): 10241
sys.gettotalrefcount(): 10241
sys.gettotalrefcount(): 10241
sys.gettotalrefcount(): 10241
sys.gettotalrefcount(): 10241
sys.gettotalrefcount(): 10241
sys.gettotalrefcount(): 10241
sys.gettotalrefcount(): 10241
sys.gettotalrefcount(): 10241

---

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42749] test_tcl failed on 32-bit POWER6 AIX 3.9: big int issue with 9223372036854775808

2020-12-29 Thread STINNER Victor


STINNER Victor  added the comment:

I confirm that test_tcl pass again on POWER6 AIX 3.9. Thanks Serhiy for the fix!

I checked the following build: 
https://buildbot.python.org/all/#/builders/330/builds/229

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2020-12-29 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 24006 to fix the leak.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2020-12-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22848
pull_request: https://github.com/python/cpython/pull/24006

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2020-12-29 Thread STINNER Victor


STINNER Victor  added the comment:

The following commit introduces a reference leak:

commit dd39123970892733c317f235808638ae5c0ccf04
Author: Hai Shi 
Date:   Tue Dec 29 20:45:07 2020 +0800

bpo-40137: Convert _functools module to use PyType_FromModuleAndSpec. 
(GH-23405)

 Lib/test/test_functools.py |   3 +-
 .../2020-11-19-23-12-57.bpo-40137.bihl9O.rst   |   1 +
 Modules/_functoolsmodule.c | 475 +++--
 3 files changed, 255 insertions(+), 224 deletions(-)
 create mode 100644 Misc/NEWS.d/next/Core and 
Builtins/2020-11-19-23-12-57.bpo-40137.bihl9O.rst


Leaks:

test_interpreters leaked [2038, 2034, 2038] references, sum=6110
test_threading leaked [452, 452, 452] references, sum=1356
test_capi leaked [452, 452, 452] references, sum=1356
test__xxsubinterpreters leaked [6332, 6328, 6332] references, sum=18992
test_ast leaked [226, 226, 226] references, sum=678

https://buildbot.python.org/all/#/builders/129/builds/144

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42780] os.set_inheritable() fails for O_PATH file descriptors on Linux

2020-12-29 Thread STINNER Victor


STINNER Victor  added the comment:

> 2. On Linux, fall back on fcntl() if ioctl(FIOCLEX) fails with EBADF.

I like this approach!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42781] functools.cached_property docs should explain that it is non-overriding

2020-12-29 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy:  -rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27640] add the '--disable-test-suite' option to configure

2020-12-29 Thread STINNER Victor


STINNER Victor  added the comment:

pr23886_files.diff: see 
https://github.com/python/cpython/pull/23886#issuecomment-752279731

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27640] add the '--disable-test-suite' option to configure

2020-12-29 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file49707/pr23886_files.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h

2020-12-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22847
pull_request: https://github.com/python/cpython/pull/24005

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h

2020-12-29 Thread miss-islington


miss-islington  added the comment:


New changeset 056c08211b402b4dbc1530a9de9d00ad5309909f by Petr Viktorin in 
branch 'master':
bpo-40052: Fix alignment issue in PyVectorcall_Function() (GH-23999)
https://github.com/python/cpython/commit/056c08211b402b4dbc1530a9de9d00ad5309909f


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42781] functools.cached_property docs should explain that it is non-overriding

2020-12-29 Thread Luciano Ramalho


Luciano Ramalho  added the comment:

> FYI, the usual term is "data descriptor" instead of "overriding descriptor".

Yes, the Python docs are consistent in always using "data descriptor", but I've 
adopted "overriding descriptor" from Martelli's Python in a Nutshell--in Fluent 
Python I also put a note saying that "data descriptor" is used in the docs. I 
think "overriding descriptor" is more descriptive. In particular, I find 
"non-data descriptor" quite puzzling. But this issue is not about changing the 
jargon.

> Normally the docs for things like property() and cached_property()
> don't mention the term descriptor at all.  From the user point of
> view, that is an implementation detail.

I'd agree, if I wasn't personally bitten by the issue I reported. I was 
refactoring an existing class which had hand-made caches in a couple of methods 
decorated with @property. When I discovered @cached_property, I tried to 
simplify my code by using it, and it broke my code in one place, but not in the 
other. Leonardo Rochael had experience with cached_property and told me about 
the difference.

I suggest a warning noting the different behavior regarding existing instance 
attributes. The warning doesn't need to assume the user knows what is a 
descriptor, but it should in my opinion point to your excellent Descriptor 
HowTo Guide for more information.

> I would suggest a small amendment, and say "cached as a normal attribute with 
> the same name". The choice of attribute isn't arbitrary, it is exactly the 
> same as the cached property.

That's good too.

>> In the future, perhaps we can add an argument to @cached_property
>> to optionally make it produce overriding descriptors.

> That doesn't make any sense to me.  It would defeat the entire mechanism for 
> cached_property().

My idea would be to add a dummy __set__ method if the overriding option was 
True (default would be False). The method could raise an exception. But its 
presence would make @cached_property behave more like @property in the most 
common use case of @property: as an overriding descriptor emulating a read-only 
attribute.

>> If a user replaces a @property with a @cached_property, her 
>> code may or may not break depending on the existence of an 
>> instance attribute with the same name as the decorated method. 

> We've never had a report of an issue like this and I don't expect to see over.

You just did ;-). I filed this issue after spending hours trying to figure out 
what the problem was in my code on my second attempt at using @cached_property. 
I expected @cached_property would work as a drop-in replacement for @property 
when emulating a read-only attribute, and it did not.

> One other possible addition is to note that the attribute is writeable:

Yes, the code snippet you suggested is a good way of saying "this produces a 
non-overriding descriptor". 

However we want to say it, I think it is important to contrast the behavior of 
@cached_property v. @property regarding the presence of attributes with the 
same name.

Cheers and a happy 2021 with two doses of vaccine for you and your loved ones, 
Raymond!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2020-12-29 Thread FredInChina


FredInChina  added the comment:

Ah, I understand now, thank you for the clear explanation @epaine, appreciated. 
Thanks also for the link to Pr. Shipman's docs mirror on tkdocs.

It is not my place to argue what to do in such a case, but please allow me to 
re-emphasize the need for better tkinter documentation. It would, of course be 
imperfect, but not out of place to offer docs for the latest version of python, 
and the latest stable version of Tk? Even those that still have to rely on a 
previous version would surely find it useful.

Thank you for listening.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42773] build.yml workflow not testing on pushes

2020-12-29 Thread Filipe Laíns

Filipe Laíns  added the comment:

This is due to a typo, I commented on the original PR and opened a PR fixing 
it. Cheers :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42773] build.yml workflow not testing on pushes

2020-12-29 Thread Filipe Laíns

Change by Filipe Laíns :


--
keywords: +patch
pull_requests: +22846
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24004

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42780] os.set_inheritable() fails for O_PATH file descriptors on Linux

2020-12-29 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

Doing two syscalls does not seem so bad.

Linux may allow FIOCLEX on O_PATH in the future.

--
nosy: +benjamin.peterson
versions: +Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42780] os.set_inheritable() fails for O_PATH file descriptors on Linux

2020-12-29 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


--
components: +Library (Lib)
nosy: +vstinner
versions:  -Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42762] infinite loop resulted by "yield"

2020-12-29 Thread Steve Stagg


Steve Stagg  added the comment:

(sorry for spam!)

So, this is a retained reference issue.
If I change the script to be this:


---
import gc

DEPTH = 100

def foo():
global DEPTH
try:
yield
except BaseException as e:
DEPTH -= 1
if DEPTH < 1:
return
gc.collect()
yield from foo()


def x():
for m in foo():
print(i)

try:
x()
except:
pass


ges = [o for o in gc.get_objects() if isinstance(o, GeneratorExit)]
if ges:
ge, = ges
print(gc.get_referrers(ge))
---

Then there's a reference to the GeneratorExit being retained (I guess from the 
exception frames, althought I thought exception frames were cleared up these 
days?):

[[GeneratorExit()], {'__name__': '__main__', '__doc__': None, '__package__': 
None, '__loader__': <_frozen_importlib_external.SourceFileLoader object at 
0x7fac8899ceb0>, '__spec__': None, '__annotations__': {}, '__builtins__': 
, '__file__': '/home/sstagg/tmp/fuzztest/tx.py', 
'__cached__': None, 'gc': , 'DEPTH': 99, 'foo': 
, 'x': , 'ges': 
[GeneratorExit()], 'ge': GeneratorExit()}, ]
Exception ignored in: 
RuntimeError: generator ignored GeneratorExit.

Given the infinite loop happens during the finalization of the generator, I 
think this reference is stopping the loop from going forever.

I tried removing the "as e" from the above script, and no references are 
retained.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42762] infinite loop resulted by "yield"

2020-12-29 Thread Steve Stagg


Steve Stagg  added the comment:

That /is/ weird.  I tried a few variations, and it looks like something is 
being stored on the exception that is stopping the loop behaviour.

"except BaseException:"  <- infinite loop
"except BaseException as e:" <- NO loop
"except BaseException as e:
   del e
   yield from foo()" <- infinite loop

So is this a reference being retained somewhere?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42742] Add abc.Mapping to dataclass

2020-12-29 Thread Anton Abrosimov


Anton Abrosimov  added the comment:

Link to python-ideas thread:
https://mail.python.org/archives/list/python-id...@python.org/thread/XNXCUJVNOOVPAPL6LF627EOCBUUUX2DG/

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42783] asyncio.sleep(0) idiom is not documented

2020-12-29 Thread Simon Willison


Change by Simon Willison :


--
keywords: +patch
pull_requests: +22845
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24002

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42783] asyncio.sleep(0) idiom is not documented

2020-12-29 Thread Simon Willison


New submission from Simon Willison :

asyncio.sleep(0) is the recommended idiom for co-operatively yielding control 
of the event loop to another task: https://github.com/python/asyncio/issues/284 
and https://til.simonwillison.net/python/yielding-in-asyncio

This isn't currently explained in the documentation.

--
assignee: docs@python
components: Documentation, asyncio
messages: 384025
nosy: asvetlov, docs@python, simonw, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.sleep(0) idiom is not documented
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42781] functools.cached_property docs should explain that it is non-overriding

2020-12-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

FYI, the usual term is "data descriptor" instead of "overriding descriptor".

Normally the docs for things like property() and cached_property() don't 
mention the term descriptor at all.  From the user point of view, that is an 
implementation detail.  What is important is what it does and how to use it.

In the case of cached_property(), the docs do a pretty good job, "Transform a 
method of a class into a property whose value is computed once and then cached 
as a normal attribute for the life of the instance."

>From a user point of view, that is exactly what happens.  The method is called 
>exactly once.  The result is cached in an attribute and it behaves like a 
>normal attribute for the remaining life (effectively, the descriptor is gone.

I would suggest a small amendment, and say "cached as a normal attribute with 
the same name".   The choice of attribute isn't arbitrary, it is exactly the 
same as the cached property.

> In the future, perhaps we can add an argument to @cached_property
> to optionally make it produce overriding descriptors.

That doesn't make any sense to me.  It would defeat the entire mechanism for 
cached_property().

> If a user replaces a @property with a @cached_property, her 
> code may or may not break depending on the existence of an 
> instance attribute with the same name as the decorated method. 

We've never had a report of an issue like this and I don't expect to see over.  
In general, if someone is using property(), it is already a bit challenging to 
store and retrieve attributes that have the same name as the property.

I think it is sufficient to just state that cached_property() uses the 
attribute with the same name as the property.  That way, it won't be a 
"surprise" that attribute with the same name gets used :-)

One other possible addition is to note that the attribute is writeable:

class A:
@cached_property
def x(self):
print('!')
return 42

>>> a = A()
>>> vars(a)   # Initially, there is no instance variable
{}
>>> a.x   # Method is called
!
42
>>> vars(a)   # Data is stored in the instance variable
{'x': 42}
>>> a.x   # Method is not called again
42  
>>> a.x = 10  # Attribue is writeable
>>> vars(a)
{'x': 10}
>>> a.x
10

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42782] shutil.move creates a new directory even on failure

2020-12-29 Thread Winson Luk


Winson Luk  added the comment:

To replicate:

$ mkdir foo
$ sudo chown root foo
$ sudo touch foo/child
$ python3
>>> import shutil
>>> shutil.move('foo', 'bar')
PermissionError
$ ls foo
child
$ ls bar
child

If shutil.move() encountered a permission error and failed, bar should not have 
been created.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42560] Improve Tkinter Documentation

2020-12-29 Thread E. Paine


E. Paine  added the comment:

> shouldn't the docs be made available for the currently maintained version of 
> python?

Problem is the Tk version (which underpins tkinter) varies by distribution. 
Currently, Windows and MacOS Intel installers are packaged with 8.6.8, while 
MacOS Universal2 is soon to be packaged with a head later than 8.6.10. The 
situation gets worse on Linux, where different distros provide very different 
versions (CentOS 7, for example, runs Tk 8.5.13 which was released back in 
2012). As the available options vary by version, we face an issue of what we 
actually describe in the docs.

As a side note, Shipman's docs are now also hosted at tkdocs.com/shipman, a 
site maintained by Mark Roseman, which should be more reliable than a github.io 
page (see issue37149 - he will also handle any copyright claims, etc. that may 
arise that meant we couldn't host it on docs.python.org).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42782] shutil.move creates a new directory even on failure

2020-12-29 Thread Winson Luk


New submission from Winson Luk :

shutil.move calls shutil.copytree(), then os.rmtree() (in that order). If the 
user does not have permission to delete the source directory, copytree succeeds 
but rmtree fails. The user sees an error (Permission Denied), but the 
destination directory is still created. The expected behavior should be a 
Permission Denied without the creation of the destination directory.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42782] shutil.move creates a new directory even on failure

2020-12-29 Thread Winson Luk


Change by Winson Luk :


--
keywords: +patch
pull_requests: +22843
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24001

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42782] shutil.move creates a new directory even on failure

2020-12-29 Thread Winson Luk


Change by Winson Luk :


--
components: Library (Lib)
nosy: winsonluk
priority: normal
severity: normal
status: open
title: shutil.move creates a new directory even on failure
type: behavior
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42775] __init_subclass__ should be called in __init__

2020-12-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

I see this as a backwards incompatible change and it's not worth doing for what 
seems to me a very minor benefit.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42781] functools.cached_property docs should explain that it is non-overriding

2020-12-29 Thread Luciano Ramalho


New submission from Luciano Ramalho :

functools.cached_property is a great addition to the standard library, thanks!

However, the docs do not say that @cached_property produces a non-overriding 
descriptor, in contrast with @property.

If a user replaces a @property with a @cached_property, her code may or may not 
break depending on the existence of an instance attribute with the same name as 
the decorated method. This is surprising and may affect correctness, so it 
deserves even more attention than the possible performance loss already 
mentioned in the docs, related to the shared-dict optimization.

In the future, perhaps we can add an argument to @cached_property to optionally 
make it produce overriding descriptors.

--
assignee: docs@python
components: Documentation
messages: 384019
nosy: docs@python, ramalho
priority: normal
severity: normal
status: open
title: functools.cached_property docs should explain that it is non-overriding
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42762] infinite loop resulted by "yield"

2020-12-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Even weirder, the old behavior returns if "except:" is replaced by "except 
BaseException as e:".


def foo():
try:
yield
except BaseException as e:
yield from foo()

for m in foo():
print(i)

--
nosy: +Mark.Shannon, rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42673] Optimize round_size for rehashing

2020-12-29 Thread Jurjen N.E. Bos


Jurjen N.E. Bos  added the comment:

Harsh, but fair.
I'll do a better job next time!

Op di 29 dec. 2020 13:42 schreef Serhiy Storchaka :

>
> Serhiy Storchaka  added the comment:
>
> Since no benchmarking data was provided, I suggest to close this issue. We
> do not accept optimization changes without evidences of performance boost.
>
> --
> status: open -> pending
>
> ___
> Python tracker 
> 
> ___
>

--
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2020-12-29 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +22842
pull_request: https://github.com/python/cpython/pull/24000

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42780] os.set_inheritable() fails for O_PATH file descriptors on Linux

2020-12-29 Thread cptpcrd


New submission from cptpcrd :

Note: I filed this bug report after seeing 
https://github.com/rust-lang/rust/pull/62425 and verifying that it was also 
reproducible on Python. Credit for discovering the underlying issue should go 
to Aleksa Sarai, and further discussion can be found there.

# Background

Linux has O_PATH file descriptors. These are file descriptors that refer to a 
specific path, without allowing any other kind of access to the file. They 
can't be used to read or write data; instead, they're intended to be used for 
use cases like the *at() functions. In that respect, they have similar 
semantics to O_SEARCH on other platforms (except that they also work on other 
file types, not just directories).

More information on O_PATH file descriptors can be found in open(2) 
(https://www.man7.org/linux/man-pages/man2/open.2.html), or in the Rust PR 
linked above.

# The problem

As documented in the Rust PR linked above, *no* ioctl() calls will succeed on 
O_PATH file descriptors (they always fail with EBADF). Since 
os.set_inheritable() uses ioctl(FIOCLEX)/ioctl(FIONCLEX), it will fail on 
O_PATH file descriptors.

This is easy to reproduce:

>>> import os
>>> a = os.open("/", os.O_RDONLY)
>>> b = os.open("/", os.O_PATH)
>>> os.set_inheritable(a, True)
>>> os.set_inheritable(b, True)  # Should succeed!
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 9] Bad file descriptor
>>>

I believe this affects all versions of Python going back to version 3.4 (where 
os.set_inheritable()/os.get_inheritable() were introduced).

# Possible fixes

I see two potential paths for fixing this:

1. Don't use ioctl(FIOCLEX) at all on Linux.

This is what Rust did. However, based on bpo-22258 I'm guessing there would be 
opposition to implementing this strategy in Python, on the grounds that the 
fcntl() route takes an extra syscall (which is fair).

2. On Linux, fall back on fcntl() if ioctl(FIOCLEX) fails with EBADF.

This could be a very simple patch to Python/fileutils.c. I've attached a basic 
version of said patch (not sure if it matches standard coding conventions).

Downsides: This would add 2 extra syscalls for O_PATH file descriptors, and 1 
extra syscall for actual cases of invalid file descriptors (i.e. EBADF). 
However, I believe these are edge cases that shouldn't come up frequently.

--
files: set-inheritable-o-path.patch
keywords: patch
messages: 384016
nosy: cptpcrd
priority: normal
severity: normal
status: open
title: os.set_inheritable() fails for O_PATH file descriptors on Linux
type: behavior
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49706/set-inheritable-o-path.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37157] shutil: add reflink=False to file copy functions to control clone/CoW copies (use copy_file_range)

2020-12-29 Thread Albert Zeyer


Albert Zeyer  added the comment:

Is FICLONE really needed? Doesn't copy_file_range already supports the same?

I posted the same question here: 
https://stackoverflow.com/questions/65492932/ficlone-vs-ficlonerange-vs-copy-file-range-for-copy-on-write-support

--
nosy: +Albert.Zeyer

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h

2020-12-29 Thread Petr Viktorin


Change by Petr Viktorin :


--
nosy: +petr.viktorin
nosy_count: 4.0 -> 5.0
pull_requests: +22841
pull_request: https://github.com/python/cpython/pull/23999

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42762] infinite loop resulted by "yield"

2020-12-29 Thread Steve Stagg


Steve Stagg  added the comment:

Ok, so I now understand a bit more, and think it's not a bug!  But explaining 
it involves some fairly deep thinking about generators.

I'll try to explain my reasoning.

Let's take a simple example:

---

def foo():
try:
yield
except:
print("ERROR")

for x in foo():
print(1)
---


It's convenient to think of it as python adding an implicit throw 
StopIteration() at the end of the generator function, I'll also rewrite the 
code to be roughly equivalent:

---
 1. def foo():
 2. try:
 3. yield None
 4. except:
 5. print("ERROR")
 6. #throw StopIteration():
 7. 
 8. foo_gen = foo()
 9. while True:
10. try:
11. x = next(foo_gen)
12.except StopIteration:
13. break
14.print(1)
15. del foo_gen
---

Now, if we step through how python runs the code starting at line 8.:

8. Create foo() <- this just creates a generator object
9. Enter while loop (not interesting for now)
10. try:
11. call next() on our generator to get the next value
2. try: <- we're running the generator until we get a yield now
3. yield None <- yield None to parent code
11. x = None <- assign yielded value to x
12. except StopIteration <- no exception raised so this doesn't get triggered
14. print(1) <- Print 1 to the output
9. Reached end of while loop, return to the start
10. try:
11. Re-enter the generator to get the next value, starting from where we left 
it..
4. except: <- there was no exception raised, so this doesn't get triggered
6. (implicit) throw StopIteration because generator finished
12. `except StopIteration` <- this is triggered because generator threw 
StopIteration
13. break <- break out of while loop
15. remove foo_gen variable, and clean up generator.

<- Deleting `foo_gen` causes `.close()` to be called on the generator which 
causes a GeneratorExit exception to be raised in the generator, BUT generator 
has already finished, so the GeneratorExit does nothing.

--

This is basically how the for-loop in your example works, and you can see that 
there's no generator exception, BUT if we change the print(1) to print(i) and 
try again:

8. Create foo() <- this just creates a generator object
9. Enter while loop (not interesting for now)
10. try:
11. call next() on our generator to get the next value
2. try: <- we're running the generator until we get a yield now
3. yield None <- yield None to parent code
11. x = None <- assign yielded value to x
12. except StopIteration <- no exception raised so this doesn't get triggered
*** CHANGED BIT ***
14. print(i) <- i doesn't exist, so throw NameError
14. The exception made us exit the current stack frame, so start cleaning 
up/deleting local variables

<- Deleting `foo_gen` causes `.close()` to be called on the generator which 
causes GeneratorExit() to be raised within the generator, but the generator is 
currently paused on line 3. so raise exception as-if we're currently running 
line 3:

4. except: <- this broad except catches the GeneratorExit exception because it 
appears to have happened on line 3.
5. print("ERROR") <- We only get here if the above steps happened.

---

So, if you don't let a generator naturally finish itself, but stop consuming 
the generator before it's raised its final StopIteration, then when the 
variable goes out-of-scope, a GeneratorExit will be raised at the point of the 
last yield that it ran.

If you then catch that GeneratorExit, and enter a new un-consumed loop (as in 
your `yield from foo()` line), then that line will also create the same 
situation again in a loop..

I understand that this used to "work" in previous python versions, but 
actually, having dug into things a lot more, I think the current behaviour is 
correct, and previous behaviors were not correct.

The "bug" here is in the example code that is catching GeneratorExit and then 
creating a new generator in the except:, rather than anything in Python

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42762] infinite loop resulted by "yield"

2020-12-29 Thread Steve Stagg


Steve Stagg  added the comment:

I'm sorry, I did get a bit confused earlier, I'd mentally switched to context 
managers.

I agree this is a bug, and a kinda weird one!

I've narrowed it down to this:

If an exception causes flow to exit a for-loop that's powered by a generator, 
then when the generator object is deleted, GeneratorExit() is incorrectly 
raised in the generator.

This can be shown with the following example (easier to debug without the 
infinite loop):

---
def foo():
try:
yield
except:
print("!!! WE SHOULDN'T BE HERE!!!")

x = foo()
try:
for _ in x:
   print(i)
except NameError:
pass 

print("LOOP DONE")
del x   # <--- We shouldn't be here printed on this line.
print("FINAL")
---

As you discovered, if you change print(i) to print(1), then the "shouldn't be 
here" line is NOT printed, but if you leave it as print(i) then the exception 
is printed.

You can see that the error doesn't happen until after LOOP DONE, which is 
because `del x` is finalizing the generator object, and the invalid exception 
logic happens then.

I'm trying to get more info here, if I don't by the time you come online, I'd 
recommend creating a *new* issue, with the non-loop example above, and 
explanation because I think on this issue, I've caused a lot of noise (sorry 
again!).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42658] os.path.normcase() is inconsistent with Windows file system

2020-12-29 Thread Eryk Sun

Eryk Sun  added the comment:

> "lowercase two strings by means of LCMapStringEx() and then wcscmp
> the two" always gives the same result as "compare the two strings 
> with CompareStringOrdinal()"

For checking case-insensitive equality, it shouldn't matter whether names are 
converted to uppercase or lowercase when using invariant non-linguistic casing. 
It's based on symmetric mappings between pairs of uppercase and lowercase 
codes, which avoids problems such as 'ϴ' (U+03F4) and 'Θ' (U+0398) both 
lowercasing as 'θ' (U+03B8), or 'ß' uppercasing as 'SS'.

That said, when sorting filenames, you need to use LCMAP_UPPERCASE in order to 
match the case-insensitive sort order of Windows. For example, 'Ÿ' (U+0178) is 
greater than 'Ŷ' (U+0176), but -- respectively lowercase -- 'ÿ' (U+00FF) is 
less than 'ŷ' (U+0177). In particular, if you have an NTFS directory with two 
files named 'ÿ' and 'ŷ', the listing will be ['ŷ', 'ÿ'] -- in uppercase order. 
(An NTFS directory is stored on disk as a b-tree sorted by uppercase filenames.)

For the implementation, _winapi.LCMapStringEx and related constants could be 
added.

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2020-12-29 Thread Wüstengecko

Wüstengecko  added the comment:

Hello,
I can confirm that the PR resolves the issue.
Thanks for the quick fix!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42763] Exposing a race in the "_warnings" resulting Python parser crash

2020-12-29 Thread Steve Stagg


Steve Stagg  added the comment:

If we take your minimal example (that /sometimes/ crashes), and look at what 
python is doing:

import threading
t = threading.Thread(target=1, daemon=True).start()

---

The main thread does the following:

M1. Startup interpreter, parse code
M2. Import & execute threading module
M3. Create thread `T`, set target=1, set daemon=True
M4. Start thread
M5. Finalize local variables & state
M6. Terminate daemon threads
M7. Acquire IO lock to clean up IO
M8. Shutdown interpreter

Whereas the thread `T` does this:

T1. Startup
T2. Try to call target
T3. Realise that target is not callable & raise exception ('int' object is not 
callable)
T4. Acquire IO lock to print traceback
T5. Print traceback line 1
T6. Print traceback line n
T7. Release IO lock
T8. Shutdown thread


Now steps T1->T8 can happen *at any time* between M4 and M6.  But the moment M6 
runs, the thread disappears without warning.

If the T4 step is run, then the daemon thread owns the IO lock, and must 
release it, but if step T7 doesn't run, then that lock is never released.

So in the case where you get a crash, the order is something like:

M1. M2. M3. M4.  T1. T2. T3. T4. T5. M5. [thread killed] M6. M7. <- Crash, 
because M7 can't acquire lock

But when there is no crash, the order is probably:

M1. M2. M3. M4.  T1. T2. T3. T4. T5. T6. T7. T8. M5. M6. M7. M8. <- No Crash 
because IO lock released in T7.

So you can see that this is the same fundamental thing as issue42717  (Where 
the shutdown during output was caused by spamming output repeatedly), but 
caused by a different route.

It might be possible to add handlers to the daemonic thread shutdown to clean 
up IO locks more cleanly?  But it's tricky, it seems like daemonic threads 
shutdown when they attempt to re-acquire the GIL after the interpreter has 
shutdown, so we're in pretty complex state management territory here.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42779] pow() of huge input does not complete

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The computational complexity of algorithm used to convert integer to decimals 
is proportional to the cube of the size of the number. It is known issue. There 
are better algorithms (perhaps gmpy2 uses them), but they benefit only 
extremely large numbers, for which exact decimal form is not very useful.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42779] pow() of huge input does not complete

2020-12-29 Thread minipython


minipython <599192...@qq.com> added the comment:

oh.You are right.If i directly compute the huge result without 
printing,it only takes 115s.Thank you very much.I'm sorry to forget noting the 
print function.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42717] The python interpreter crashed with "_enter_buffered_busy"

2020-12-29 Thread Steve Stagg


Steve Stagg  added the comment:

It's one of those ugly multithreading issues that's really hard to reason about 
unfortunately.

In this case, it's not the size of the loop so much as you've discovered a way 
to make it very likely that the background thread is doing IO (and holding the 
IO lock) during shutdown.

Here's an example that reproduces the abort for me (again, it's multithreading, 
so you may have a different experience) with a smaller range value:

---
import sys, threading

def run():
for i in range(100):
sys.stderr.write(' =.= ' * 1)

if __name__ == '__main__':
threading.Thread(target=run, daemon=True).start()
---

The problem with daemon threads is that they get killed fairly suddenly and 
without much ability to correct bad state during shutdown, so any fix here 
would likely be around re-visiting the thread termination code as linked in the 
issue above.

There may be a fix possible, but it's going to be a complex thread state 
management fix, not just a limit on loop counts, unfortunately

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42749] test_tcl failed on 32-bit POWER6 AIX 3.9: big int issue with 9223372036854775808

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

test_tcl is passed: https://buildbot.python.org/all/#/builders/330/builds/228 .

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42779] pow() of huge input does not complete

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Are you sure that this is a time of calculating pow() and not the time of 
calculating decimal representation of the result?

On my computer:

>>> t = time(); a = pow(c, 2**14+1); time()-t
11.957276344299316
>>> t = time(); a = pow(c, 2**15+1); time()-t
36.08853316307068
>>> t = time(); a = pow(c, 2**16+1); time()-t
107.43462753295898

The computational complexity is O((log(c)*e)**1.5). And it needs not so much 
memory: around 20 MB for final result, and few times more for intermediate 
results, so this is not matter of swapping.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42655] Fix subprocess extra_groups gid conversion

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your contribution Jakub.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42700] xml.parsers.expat.errors description of codes/messages is flipped

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your contribution Michael.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41224] Document is_annotate() in symtable and update doc strings

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The method was added in 3.6. Please backport documentation changes to 3.9 and 
3.8.

--
stage: resolved -> needs patch
status: closed -> open
versions: +Python 3.8, Python 3.9 -Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41224] Document is_annotate() in symtable and update doc strings

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2edfc86f69d8a74f4821974678f664ff94a9dc22 by Andre Delfino in 
branch 'master':
bpo-41224: Add versionadded for Symbol.is_annotated (GH-23861)
https://github.com/python/cpython/commit/2edfc86f69d8a74f4821974678f664ff94a9dc22


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40956] Use Argument Clinic in sqlite3

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 84d79cfda947f6bc28a5aa11db8055aa40a6b03a by Erlend Egeberg 
Aasland in branch 'master':
bpo-40956: Convert _sqlite3.Row to Argument Clinic (GH-23964)
https://github.com/python/cpython/commit/84d79cfda947f6bc28a5aa11db8055aa40a6b03a


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42655] Fix subprocess extra_groups gid conversion

2020-12-29 Thread miss-islington


miss-islington  added the comment:


New changeset 3966e2ea412a5f190dc8655d9aa7a15c08c4e280 by Miss Islington (bot) 
in branch '3.9':
bpo-42655: Fix subprocess extra_groups gid conversion (GH-23762)
https://github.com/python/cpython/commit/3966e2ea412a5f190dc8655d9aa7a15c08c4e280


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23328] urllib.request fails for proxy credentials that contain a '/' character

2020-12-29 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Merged in 

3.10 - 
https://github.com/python/cpython/commit/030a713183084594659aefd77b76fe30178e23c8

3.9 - 
https://github.com/python/cpython/commit/df794406a8803e3d6062af8404d7564833f9af28

3.8 - 
https://github.com/python/cpython/commit/741f22df24ca61db38b5a7a2a58b5939b7154a01

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42779] pow() of huge input does not complete

2020-12-29 Thread minipython


minipython <599192...@qq.com> added the comment:

Here are my information.
1.python 3.8.6
2.windows 10(build 19042 20h2)
3. 16Gb memory
4. It doesn't complete.It takes about 30 minutes but it gives no output.
5. It takes 6.346898794174194s
6. It takes 0.3690004348754883s.

--
versions: +Python 3.8 -Python 3.6, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37159] Use copy_file_range() in shutil.copyfile() (server-side copy)

2020-12-29 Thread Albert Zeyer


Albert Zeyer  added the comment:

According to the man page of copy_file_range 
(https://man7.org/linux/man-pages/man2/copy_file_range.2.html), copy_file_range 
also should support copy-on-write:

>   copy_file_range() gives filesystems an opportunity to implement
>   "copy acceleration" techniques, such as the use of reflinks
>   (i.e., two or more inodes that share pointers to the same copy-
>   on-write disk blocks) or server-side-copy (in the case of NFS).

Is this wrong?

However, while researching more about FICLONE vs copy_file_range, I found e.g. 
this: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24399

Which suggests that there are other problems with copy_file_range?

--
nosy: +Albert.Zeyer

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42655] Fix subprocess extra_groups gid conversion

2020-12-29 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +22840
pull_request: https://github.com/python/cpython/pull/23997

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42655] Fix subprocess extra_groups gid conversion

2020-12-29 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 0159e5efeebd12b3cf365c8569ca000eac7cb03e by Jakub Kulík in branch 
'master':
bpo-42655: Fix subprocess extra_groups gid conversion (GH-23762)
https://github.com/python/cpython/commit/0159e5efeebd12b3cf365c8569ca000eac7cb03e


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42700] xml.parsers.expat.errors description of codes/messages is flipped

2020-12-29 Thread miss-islington


miss-islington  added the comment:


New changeset cc7f745e80bc177dfc746b057e1c7656b78382e5 by Miss Islington (bot) 
in branch '3.9':
bpo-42700: Swap descriptions in pyexpat.errors (GH-23876)
https://github.com/python/cpython/commit/cc7f745e80bc177dfc746b057e1c7656b78382e5


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2020-12-29 Thread miss-islington


miss-islington  added the comment:


New changeset dd39123970892733c317f235808638ae5c0ccf04 by Hai Shi in branch 
'master':
bpo-40137: Convert _functools module to use PyType_FromModuleAndSpec. (GH-23405)
https://github.com/python/cpython/commit/dd39123970892733c317f235808638ae5c0ccf04


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42700] xml.parsers.expat.errors description of codes/messages is flipped

2020-12-29 Thread miss-islington


miss-islington  added the comment:


New changeset 70ced2dd27ee59abee9af6926e9ce7d93f06f885 by Miss Islington (bot) 
in branch '3.8':
bpo-42700: Swap descriptions in pyexpat.errors (GH-23876)
https://github.com/python/cpython/commit/70ced2dd27ee59abee9af6926e9ce7d93f06f885


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42673] Optimize round_size for rehashing

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Since no benchmarking data was provided, I suggest to close this issue. We do 
not accept optimization changes without evidences of performance boost.

--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42778] Add follow_symlinks=True parameter to both os.path.samefile() and Path.samefile()

2020-12-29 Thread Ross Rhodes


Ross Rhodes  added the comment:

Hi Tom,

Thanks for raising this issue. I've opened a PR to permit us to set 
`follow_symlinks` in both os.path and pathlib. Feel free to leave feedback.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42778] Add follow_symlinks=True parameter to both os.path.samefile() and Path.samefile()

2020-12-29 Thread Ross Rhodes


Change by Ross Rhodes :


--
keywords: +patch
nosy: +trrhodes
nosy_count: 1.0 -> 2.0
pull_requests: +22839
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23996

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41224] Document is_annotate() in symtable and update doc strings

2020-12-29 Thread Andrés Delfino

Change by Andrés Delfino :


--
nosy: +adelfino
nosy_count: 2.0 -> 3.0
pull_requests: +22838
pull_request: https://github.com/python/cpython/pull/23861

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42700] xml.parsers.expat.errors description of codes/messages is flipped

2020-12-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22837
pull_request: https://github.com/python/cpython/pull/23995

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42700] xml.parsers.expat.errors description of codes/messages is flipped

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 84402eb11086f97d31164aaa23e7238da3464f41 by Michael Wayne Goodman 
in branch 'master':
bpo-42700: Swap descriptions in pyexpat.errors (GH-23876)
https://github.com/python/cpython/commit/84402eb11086f97d31164aaa23e7238da3464f41


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42700] xml.parsers.expat.errors description of codes/messages is flipped

2020-12-29 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +22836
pull_request: https://github.com/python/cpython/pull/23994

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42728] Typo in documentation: importlib.metadata

2020-12-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23328] urllib.request fails for proxy credentials that contain a '/' character

2020-12-29 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
versions: +Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42779] pow() of huge input does not complete

2020-12-29 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
components: +Interpreter Core -C API
title: Pow compute can only available in python3.7 -> pow() of huge input does 
not complete
versions: +Python 3.6, Python 3.9 -Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38435] Start the deprecation cycle for subprocess preexec_fn

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Would not be more consistent with other parameters to name the new parameter 
"pgid" or "process_group"?

And why not use None as default, like for user and group?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23328] urllib.request fails for proxy credentials that contain a '/' character

2020-12-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22835
pull_request: https://github.com/python/cpython/pull/23993

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23328] urllib.request fails for proxy credentials that contain a '/' character

2020-12-29 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +22834
pull_request: https://github.com/python/cpython/pull/23992

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42779] Pow compute can only available in python3.7

2020-12-29 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I cannot replicate that. On my computer, I can compute pow(c, e) in 
approximately two minutes using Python 3.9:


>>> from time import time
>>> t = time(); a = pow(c, e); time()-t
122.07566785812378
>>> math.log10(a)
50473921.44753242


Can you give more information please?

- exact version number used
- OS
- how much memory?
- if you leave pow(c, e) running for 10 minutes, does it complete?
- can you compute pow(c, 1)? how long does that take?
- how about pow(c, 1000)?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40633] json.dumps() should encode float number NaN to null

2020-12-29 Thread Luca Barba


Luca Barba  added the comment:

I agree with arjanstaring

This implementation is not standard compliant and breaks interoperability with 
every ECMA compliant Javascript deserializer.

Technically is awful of course but interoperability and standardization come 
before than technical cleanliness IMHO

Regarding standardization:

If you consider https://tools.ietf.org/html/rfc7159

there is no way to represent the literal "nan" with the grammar supplied in 
section 6 hence the Infinity and Nan values are forbidden so as "nan"

For interoperability 

If you consider 
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

It is clearly stated in section 24.5.2 Note 4 that JSON.stringify produces null 
for Infinity and NaN

"Finite numbers are stringified as if by calling ToString(number). NaN and 
Infinity regardless of sign are represented as the String null"

It is clearly stated in section 24.5.1 that JSON.parse uses eval-like parsing 
as a reference for decoding. nan is not an allowed keyword at all. For 
interoperability NaN could be used but out from the JSON standard.

So what happens is that this will break all the ECMA compliant parsers (aka 
browsers) in the world. Which is what is happening to my project by the way

Pandas serialization methos (to_json) already adjusts this issue, but I really 
think the standard should too

--
nosy: +alucab

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41781] Typos in typing.py

2020-12-29 Thread hai shi


hai shi  added the comment:

Thanks Patrick for your PR.
Thanks Serhiy for your merge.

--
nosy: +shihai1991
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41781] Typos in typing.py

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset c1af128f5a5893839536453dcc8b2ed7b95b3c3a by Ross in branch 
'master':
bpo-41781: Fix typo in internal function name in typing (GH-23957)
https://github.com/python/cpython/commit/c1af128f5a5893839536453dcc8b2ed7b95b3c3a


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16396] Importing ctypes.wintypes on Linux gives a ValueError instead of an ImportError

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 71d73900ebd4a93a64dae9d2fbef4337fa975e66 by Miss Islington (bot) 
in branch '3.9':
bpo-16396: fix BPO number in changelog (GH-23951) (GH-23956)
https://github.com/python/cpython/commit/71d73900ebd4a93a64dae9d2fbef4337fa975e66


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42779] Pow compute can only available in python3.7

2020-12-29 Thread minipython


minipython <599192...@qq.com> added the comment:

The issue is that if i use function pow(c,e),it can be computed in python37 in 
3 minutes.But it cannot be computed in python36 or python39.Without gmpy2 
library,i find the bug.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42776] The string find method shows the problem

2020-12-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

'abcddd'.find('a', start=0) would appear to be allowed from the help text, but 
it isn't legal. This is because .find() does not allow keyword arguments.

It looks like find could be documented as
find(self, sub, start=None, end=None, /)

Although it doesn't look like any of the str methods use self in the 
documentation.

I'm reasonably sure None is correct as the default for start and end, but I 
suspect it's not universally true of str methods that None works as the 
default. So it wouldn't surprise me if not all of the str methods  can be 
expressed in python code.

--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42779] Pow compute can only available in python3.7

2020-12-29 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

What error are you getting?

Can you demonstrate the error without gmpy2, as that is a third-party library 
and nothing to do with us.

--
nosy: +steven.daprano

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42759] Take into acount a Tcl interpreter when compare variables and fonts

2020-12-29 Thread miss-islington


miss-islington  added the comment:


New changeset 578caafabe1de652a8f31dbeb8cc660e1ed725eb by Miss Islington (bot) 
in branch '3.9':
bpo-42759: Fix equality comparison of Variable and Font in Tkinter (GH-23968)
https://github.com/python/cpython/commit/578caafabe1de652a8f31dbeb8cc660e1ed725eb


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42749] test_tcl failed on 32-bit POWER6 AIX 3.9: big int issue with 9223372036854775808

2020-12-29 Thread miss-islington


miss-islington  added the comment:


New changeset 7bdb3e08251894b49e7893db1dc4868e2656b342 by Miss Islington (bot) 
in branch '3.9':
bpo-42749: Use dynamic version to test for unsupported bignum in Tk (GH-23966)
https://github.com/python/cpython/commit/7bdb3e08251894b49e7893db1dc4868e2656b342


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42749] test_tcl failed on 32-bit POWER6 AIX 3.9: big int issue with 9223372036854775808

2020-12-29 Thread miss-islington


miss-islington  added the comment:


New changeset 323cbb5531eb72527d0e3b02f28c1cdc5b7fce92 by Miss Islington (bot) 
in branch '3.8':
bpo-42749: Use dynamic version to test for unsupported bignum in Tk (GH-23966)
https://github.com/python/cpython/commit/323cbb5531eb72527d0e3b02f28c1cdc5b7fce92


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42759] Take into acount a Tcl interpreter when compare variables and fonts

2020-12-29 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +22833
pull_request: https://github.com/python/cpython/pull/23991

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42759] Take into acount a Tcl interpreter when compare variables and fonts

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 1df56bc0597a051c13d53514e120e9b6764185f8 by Serhiy Storchaka in 
branch 'master':
bpo-42759: Fix equality comparison of Variable and Font in Tkinter (GH-23968)
https://github.com/python/cpython/commit/1df56bc0597a051c13d53514e120e9b6764185f8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42749] test_tcl failed on 32-bit POWER6 AIX 3.9: big int issue with 9223372036854775808

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 156b7f7052102ee1633a18e9a136ad8c38f66db0 by Serhiy Storchaka in 
branch 'master':
bpo-42749: Use dynamic version to test for unsupported bignum in Tk (GH-23966)
https://github.com/python/cpython/commit/156b7f7052102ee1633a18e9a136ad8c38f66db0


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42749] test_tcl failed on 32-bit POWER6 AIX 3.9: big int issue with 9223372036854775808

2020-12-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22831
pull_request: https://github.com/python/cpython/pull/23989

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42749] test_tcl failed on 32-bit POWER6 AIX 3.9: big int issue with 9223372036854775808

2020-12-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22832
pull_request: https://github.com/python/cpython/pull/23990

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag?

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I don't think that it was right thing to break binary compatibility. It 
virtually buried the stable ABI.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >