[issue38301] If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling

2019-09-27 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


--
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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-27 Thread Tim Peters


Tim Peters  added the comment:

tp_clear implementations are necessary to reclaim trash cycles.  They're always 
best practice for objects that may be in trash cycles.   tuples are just "cute 
rebels" that way ;-)

Best guess is that the (some) extension isn't playing by the rules.  A weakref 
callback shouldn't be called at all unless the weakref is reachable - but in 
that case the callback function is necessarily reachable too (revealed by a 
weakrefobject's tp_traverse), so delete_garbage() should never have called 
clear() on the callback function to begin with.

Note:  I don't believe the weakref design gave any thought to cyclic gc.  The 
PEP didn't even mention it.  I got dragged into it when Zope started 
segfaulting.  They don't play well together voluntarily, but they've been 
forced to coexist, and Zope long ago provoked every fundamental problem I'm 
aware of.

That "the rules" are subtle doesn't excuse not following them ;-)

--

___
Python tracker 

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



[issue38242] Revert the new asyncio Streams API

2019-09-27 Thread Kyle Stanley


Change by Kyle Stanley :


--
pull_requests: +16035
pull_request: https://github.com/python/cpython/pull/16455

___
Python tracker 

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



[issue38301] If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling

2019-09-27 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:


New changeset 598f676880662fb453ff98fda42b7b7068e5be32 by Jesús Cea in branch 
'2.7':
[2.7] bpo-38301: In Solaris family, we must be sure to use '-D_REENTRANT' 
(GH-16446). (#16454)
https://github.com/python/cpython/commit/598f676880662fb453ff98fda42b7b7068e5be32


--

___
Python tracker 

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



[issue38304] PEP 587 implementation is not ABI forward compatible

2019-09-27 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, the API should now be ABI future proof thanks to this change.

I experimented a change locally: it's possible to support two sizes of the 
PyConfig structure (need to modify a few functions in initconfig.c).

I sent an email to python-dev:
https://mail.python.org/archives/list/python-...@python.org/thread/C7Z2NA2DTM3DLOZCFQAK5A2WFYO3PHHX/

--
priority: release blocker -> 
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



[issue38304] PEP 587 implementation is not ABI forward compatible

2019-09-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6e128382b3e7f83d91d5e73d83a051ff5fb6469c by Victor Stinner in 
branch '3.8':
bpo-38304: Add PyConfig.struct_size (GH-16451) (GH-16453)
https://github.com/python/cpython/commit/6e128382b3e7f83d91d5e73d83a051ff5fb6469c


--

___
Python tracker 

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



[issue38301] If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling

2019-09-27 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


--
pull_requests: +16034
pull_request: https://github.com/python/cpython/pull/16454

___
Python tracker 

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



[issue38304] PEP 587 implementation is not ABI forward compatible

2019-09-27 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16033
pull_request: https://github.com/python/cpython/pull/16453

___
Python tracker 

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



[issue38304] PEP 587 implementation is not ABI forward compatible

2019-09-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 441b10cf2855955c86565f8d59e72c2efc0f0a57 by Victor Stinner in 
branch 'master':
bpo-38304: Add PyConfig.struct_size (GH-16451)
https://github.com/python/cpython/commit/441b10cf2855955c86565f8d59e72c2efc0f0a57


--

___
Python tracker 

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



[issue38301] If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling

2019-09-27 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


--
pull_requests: +16032
pull_request: https://github.com/python/cpython/pull/16452

___
Python tracker 

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



[issue38301] If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling

2019-09-27 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:


New changeset 6112b91bb827b07ab83e3e720aa055772a2c8b9d by Jesús Cea (Miss 
Islington (bot)) in branch '3.7':
bpo-38301: In Solaris family, we must be sure to use '-D_REENTRANT' (GH-16446) 
(#16450)
https://github.com/python/cpython/commit/6112b91bb827b07ab83e3e720aa055772a2c8b9d


--

___
Python tracker 

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



[issue38301] If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling

2019-09-27 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:


New changeset 8750bce9884335d43ac06989f64473ed877c5b63 by Jesús Cea (Miss 
Islington (bot)) in branch '3.8':
bpo-38301: In Solaris family, we must be sure to use '-D_REENTRANT' (GH-16446) 
(#16449)
https://github.com/python/cpython/commit/8750bce9884335d43ac06989f64473ed877c5b63


--

___
Python tracker 

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



[issue38304] PEP 587 implementation is not ABI forward compatible

2019-09-27 Thread STINNER Victor


STINNER Victor  added the comment:

I updated the PEP 587:
https://github.com/python/peps/commit/afa38c0bef7738b8fcc3173daee8488e0420833d

--

___
Python tracker 

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



[issue38304] PEP 587 implementation is not ABI forward compatible

2019-09-27 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38303] Make audioop PEP-384 compatible

2019-09-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38301] If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling

2019-09-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16030
pull_request: https://github.com/python/cpython/pull/16450

___
Python tracker 

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



[issue38301] If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling

2019-09-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16029
pull_request: https://github.com/python/cpython/pull/16449

___
Python tracker 

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



[issue38301] If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling

2019-09-27 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:


New changeset 52d1b86bde2b772a76919c76991c326384954bf1 by Jesús Cea in branch 
'master':
bpo-38301: In Solaris family, we must be sure to use '-D_REENTRANT' (#16446)
https://github.com/python/cpython/commit/52d1b86bde2b772a76919c76991c326384954bf1


--

___
Python tracker 

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



[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-09-27 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +16027
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16448

___
Python tracker 

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



[issue36274] http.client cannot send non-ASCII request lines

2019-09-27 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +16028
pull_request: https://github.com/python/cpython/pull/16448

___
Python tracker 

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



[issue38279] multiprocessing example enhancement

2019-09-27 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-27 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +16026
pull_request: https://github.com/python/cpython/pull/16447

___
Python tracker 

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



[issue38301] If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling

2019-09-27 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


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

___
Python tracker 

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



[issue38304] PEP 587 implementation is not ABI forward compatible

2019-09-27 Thread STINNER Victor


New submission from STINNER Victor :

The current implementation of the PEP 587 is not ready for future evolutions of 
the PyPreConfig and PyConfig structure. Any change will break the ABI 
compatibility. Their _config_version field is useless.

The first versions of the PEP 587 used a macro to statically initialize the 
structure. It was decided to get ride of macros to use functions instead.

Example:

   PyConfig config;
   PyStatus status = PyConfig_InitPythonConfig();

PyConfig_InitPythonConfig() gets unitialized memory and doesn't know the size 
of the config variable.

I propose to require to store the size of the structure in the structure 
directly:

* Add PyPreConfig.struct_size and PyConfig.struct_size
* Require to initialize these fields to sizeof(PyPreConfig) and 
sizeof(PyConfig) respectively

Example:
 
   PyConfig config;
   config.struct_size = sizeof(PyConfig);
   PyStatus status = PyConfig_InitPythonConfig();

Thanks to the struct_size field, PyConfig_InitPythonConfig() can support old 
PyConfig structures without breaking the ABI.

If an old PyConfig is passed to PyConfig_Read(): newer fields will be ignored.

--
components: Interpreter Core
messages: 353430
nosy: lukasz.langa, vstinner
priority: release blocker
severity: normal
status: open
title: PEP 587 implementation is not ABI forward compatible
versions: Python 3.8

___
Python tracker 

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



[issue38298] Base class of generic type has wrong `cls` argument in classmethods

2019-09-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

For performance reasons the implementation of generics changed completely in 
3.7. I don't think we can restore the behavior you observed in 3.6.

--

___
Python tracker 

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



[issue38293] Deepcopying property objects results in unexpected TypeError

2019-09-27 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

I can confirm this behavior also on python 3.6 3.8 3.9

--
versions: +Python 3.6, 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



[issue38242] Revert the new asyncio Streams API

2019-09-27 Thread Kyle Stanley


Change by Kyle Stanley :


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

___
Python tracker 

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



[issue38293] Deepcopying property objects results in unexpected TypeError

2019-09-27 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



[issue38161] AsyncMock add `.awaited` like `.called`

2019-09-27 Thread Lisa Roach


Change by Lisa Roach :


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

___
Python tracker 

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



[issue38161] AsyncMock add `.awaited` like `.called`

2019-09-27 Thread Lisa Roach


Lisa Roach  added the comment:

Looking at this more, I think I want to just remove the current `awaited` 
object. The PR in asyntest makes it seem pretty cool: 
https://github.com/Martiusweb/asynctest/issues/64

But I have issue with the naming (await_event is probably better for us), and 
I'm not sure how to document it well and ensure it's well tested.

With the 3.8 release coming up fast I'd rather remove it for now and then add 
it back in after some more thought has been given to the feature, instead of 
getting stuck with a not fully thought out attribute we have to worry about 
deprecating.

--

___
Python tracker 

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



[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2019-09-27 Thread Ami Fischman


Change by Ami Fischman :


--
nosy: +Ami Fischman

___
Python tracker 

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



[issue38303] Make audioop PEP-384 compatible

2019-09-27 Thread Tyler Kieft


Change by Tyler Kieft :


--
components: Extension Modules
nosy: Tyler Kieft
priority: normal
severity: normal
status: open
title: Make audioop PEP-384 compatible
versions: Python 3.9

___
Python tracker 

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



[issue38009] Handle weakreference callbacks invoked indirectly in the middle of a gc collection

2019-09-27 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

I think the problem with your logic is that the weakref to F is part of the 
garbage set.  So, handle_finalizers() should detect that and clear the 
finalizer rather than call it.  Once we get to delete_garbage() and start 
calling tp_clear(), we can't be running weakref callbacks or finalizers.  The 
GC logic goes through great pains to ensure that.

--
nosy: +nascheme

___
Python tracker 

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



[issue38300] Documentation says destuction of TemporaryDirectory object will also delete it, but it does not.

2019-09-27 Thread Ian


Ian  added the comment:

I'm sorry, I should've thought to check my python version. I was on 3.6.3 which 
it would not be deleted, updated to 3.6.8 and it works as intended.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
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



[issue38136] Remove AsyncMock.assert_awaited_*

2019-09-27 Thread Lisa Roach


Lisa Roach  added the comment:


New changeset 52bdd414ed9da7c62c312c542803753986a0040a by Lisa Roach in branch 
'3.8':
[3.8] bpo-38136: Updates await_count and call_count to be different things 
(GH-16192) (GH-16431)
https://github.com/python/cpython/commit/52bdd414ed9da7c62c312c542803753986a0040a


--

___
Python tracker 

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



[issue38174] Security vulnerability in bundled expat CVE-2019-15903 (fix available in expat 2.2.8)

2019-09-27 Thread Ned Deily


Ned Deily  added the comment:

Perhaps this should be a release blocker for 3.5.8.  Larry?

--
nosy: +larry, ned.deily

___
Python tracker 

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



[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-27 Thread Adi


Adi  added the comment:

Meant to say "... 2 and 3 arguments forms of pow, ..."

--

___
Python tracker 

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



[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-27 Thread Adi


Change by Adi :


--
type:  -> behavior

___
Python tracker 

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



[issue38298] Base class of generic type has wrong `cls` argument in classmethods

2019-09-27 Thread Ned Deily


Change by Ned Deily :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue38292] tkinter variable classes don't link to widget if matplotlib's set_cmap() function is called before the tkinter GUI is instantiated

2019-09-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

You neglected to state the observation that led to the conclusion of 'not 
linked'.  Using 3.8 on Win10, I replaced "plt.set_cmap('x')" with "tk.Tk()".  
Then, clicking the button prints 'False' even when the checkbutton is checked.  
After either removing 'tk.Tk()' *or* changing 'BooleanVar()' to 
'BooleanVar(root)', button clicks print 'True' when the checkbutton is checked.

Explanation of what I see: tkinter has attribute tkinter._default_root 
initialized to None.  By default, this is rebound to the *first* root created 
by an internal or user tkinter.Tk() call.  Barring exceptional circumstances, 
one should either always use the default root and never create and pass a named 
root *or* never use the default one and create a named root and always pass it. 
 Your program is buggy in using the default root for the var and the named root 
for the buttons.  When the two are different, the expected linkage does not 
work.

I assume that you see the same failure with the code you posted and the same 
fix after (re)moving the .set_cmap call.  So I am further assuming that 
set_cmap somehow results in a default root being created and that fixing the 
buggy BooleanVar call will also fix things.

To test the set_cmap assumption, add "print(tk._default_root)" *before*  "root 
= tk.Tk()".  Do you see 'None' or '.'?  Does adding 'root' to the var call fix 
the link?  If you seen 'None' and the link still does not work, then 'set_cmap' 
must be affecting tkinter some other way, which would likely be a 3rd party bug 
in that function or pyplot.

--
nosy: +terry.reedy
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue38242] Revert the new asyncio Streams API

2019-09-27 Thread Kyle Stanley


Kyle Stanley  added the comment:

Currently focusing on the Lib/asyncio/* and Lib/test/* changes. Working on doc 
changes next, but that should be significantly easier. 

In addition to 
https://github.com/python/cpython/commit/23b4b697e5b6cc897696f9c0288c187d2d24bff2
 (main commit from Andrew that added asyncio.Stream and new functions), I've 
also had to remove https://github.com/python/cpython/commit/4cdbc452ce3 (minor 
asyncio test change from Pablo) due to it causing issues with the other tests 
from deleting asyncio.StreamReader and asyncio.StreamWriter.

--

___
Python tracker 

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



[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-27 Thread Adi


New submission from Adi :

Due to shared code between the 2 and 3 forms of pow, the following code causes 
a TypeError:

class A:
def __init__(self, val):
self.val = val

def __ipow__(self, other):
return NotImplemented

class B:
def __init__(self, val):
self.val = val

def __rpow__(self, other):
return A(other.val ** self.val)

a = A(2)
b = B(2)
a **= b


(https://stackoverflow.com/questions/58141475/ipow-raising-typeerror-when-left-hand-side-object-returns-notimplemented)

--
components: Interpreter Core
messages: 353419
nosy: DeepSpace
priority: normal
severity: normal
status: open
title: __rpow__ not reached when __ipow__ returns NotImplemented
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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-27 Thread Dong-hee Na


Dong-hee Na  added the comment:

Sure!

--

___
Python tracker 

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



[issue38242] Revert the new asyncio Streams API

2019-09-27 Thread Kyle Stanley


Kyle Stanley  added the comment:

> You'll need to be careful to only revert the new functions & the 
> asyncio.Stream class.

So far the trickiest part has proven to be the tests (specifically 
test_streams.py) and keeping the deprecation warning for passing explicit loop 
arguments. I've had to be careful to be certain that no tests were 
unintentionally removed.

> Due to proximity to the deadline, please be prepared that we might need to 
> abandon your pull request if it's not ready by Sunday morning

No problem, I'll make sure to allow anyone with write access (yourself and 
Andrew) to edit the PR I open directly to make any needed changes. That way, at 
least any progress I make on it can help reduce the amount of work for you two.

--

___
Python tracker 

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



[issue38301] If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling

2019-09-27 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


--
title: If "_REENTARNT" is defined in the header file, we should use 
"-D_REENTRANT" when compiling -> If "_REENTRANT" is defined in the header file, 
we should use "-D_REENTRANT" when compiling

___
Python tracker 

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



[issue38301] If "_REENTARNT" is defined in the header file, we should use "-D_REENTRANT" when compiling

2019-09-27 Thread Jesús Cea Avión

New submission from Jesús Cea Avión :

When compiling on Solaris family, we define "_REENTRANT" in "Pyconfig.h".  That 
file is included when compiling C extensions, but if the extension is made of 
several C files, it could be included only in the file that interfaces with 
python runtime.

Unfortunately, "_REENTRANT" modifies the way C code is compiled, so compiling a 
C extension with some source files with "_REENTRANT" and some other without 
that "define" can produce bizarre errors and crashes.

One example: https://github.com/joyent/pkgsrc/issues/207

In particular, "include" order can make a big difference: 
https://github.com/jnwatson/py-lmdb/issues/213

I suggest that when "_REENTRANT" is defined in "Pyconfig.h", Python C 
extensions compilation machinery adds "-D_REENTRANT" to the compilation flags.

The patch is trivial.

--
assignee: jcea
components: Build
messages: 353416
nosy: jcea
priority: high
severity: normal
status: open
title: If "_REENTARNT" is defined in the header file, we should use 
"-D_REENTRANT" when compiling
versions: Python 2.7, Python 3.5, 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



[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2019-09-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

As a note on the general pattern, a user at work diagnosed a ^C problem in 
their code when running on 2.7 to be due to Queue.get's

acquire()
try:
  ...
finally:
  release()

Pattern, with the KeyboardInterrupt triggering after acquire() but before the 
try is entered.  so release() is never called.

A try finally pattern that probably alleviates this by entering the try block 
first might look like:

try:
  acquire()
  ...
finally:
  try:
release()
  except ThreadError:
pass  # interrupted before acquire() succeeded.


It'd be a shame if any with statements lock acquisition context managers need 
to be turned into that, but I _believe_ it'd be a viable workaround for the 
time being if this race is found to be biting anyone.

--

___
Python tracker 

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



[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-27 Thread Kit Yan Choi


Change by Kit Yan Choi :


--
nosy:  -Kit Choi

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-27 Thread STINNER Victor


STINNER Victor  added the comment:

> If I understand Victor's test case correctly, the problem is caused if you 
> have an extension type that implements tp_traverse but not tp_clear and that 
> there is also a weakref involved in the trash cycle.

I'm not sure that "implements tp_traverse but not tp_clear" is enough to 
trigger the issue. It's unclear to me neither if it's a good practice or not to 
implement tp_clear... Since it seems like implementing tp_clear for functions 
(func_clear) caused this regression... Or maybe it's very specific to the magic 
combo: weak references with callback.

--

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-27 Thread STINNER Victor


STINNER Victor  added the comment:

> Is the behavior of tp_clear the key to this bug?

Once func_clear(my_func) is called, calling my_func() will crash: my_func() is 
unsuable.

Because of a complex dance involving borrowed references, the function is 
called *after* it's cleared.

Pablo's PR 15645 works around the problem by detecting this very specific case: 
call a function "after it's cleared" (while it's being garbage collected in 
practice).

Honestly, I'm still not sure how *exactly* the bug is triggered. I tried but 
failed to reproduce the initial cffi crash. reproducer.tar.gz is still a giant 
piece of code. I failed to simplify it to a few objects.

According to Pablo, gc_crash.py is a *different* (but similar) bug.

I would only be confident in approving a fix once I would be confident that I 
understood *exactly* how the initial bug (reproducer.tar.gz) occurred.

--

___
Python tracker 

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



[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-27 Thread Kit Yan Choi


Kit Yan Choi  added the comment:

For your test:

class T(unittest.TestCase):
def test_f(self): raise TypeError()

If you run this test with unittest test runner, you should get this result:

E
==
ERROR: test_f (test_main.T)
--
Traceback (most recent call last):
  File "test_main.py", line 5, in test_f
def test_f(self): raise TypeError()
TypeError

--
Ran 1 test in 0.000s

FAILED (errors=1)


I expect to get this behaviour even if the test is decorated with 
unittest.expectedFailure. However, currently we get a success.


Scenario:


You create a class named Duck with a method "quack".  Then you added a test, 
and test needs to call Duck.quack.

Later on for whatever reason, you need to decorate the test with 
expectedFailure.  The test passes with the expected failure.

Then you rename the "quack" method to "walk", but you forget to update the 
test.  Now the test is actually failing with an AttributeError, but you won't 
notice it because expectedFailure silences it.

In this scenario, it is important to differentiate a "test error" and a "test 
failure". A test has four status: success, failure, error, skipped.  I expect 
unittest.expectedFailure to make "failure" a "success" and a "success" a 
"failure", and it should leave "error" and "skipped" unchanged.

Please consider reopening this issue.

--
nosy: +Kit Yan Choi

___
Python tracker 

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



[issue38294] re.escape no longer escapes "/" or ":"

2019-09-27 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

A function can fail to return an expected object by either returning a wrong 
object or raising an (unexpected) exception.  The assertXyz methods, which 
ultimately raise AssertionError or something similar, are mostly about catching 
the first kind of failure, but tests should also catch and report the second 
kind.  The traceback shows the kind of failure.  The assertXyx failures add 
additional details after the traceback.


import unittest

class T(unittest.TestCase):
def test_f(self): raise TypeError()

unittest.main()

# Properly results in

Traceback (most recent call last):
  File "F:\Python\a\tem4.py", line 4, in test_f
def test_f(self): raise TypeError()
TypeError

--
Ran 1 test in 0.050s

FAILED (errors=1)

--
nosy: +terry.reedy
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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-27 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

A few comments from the "peanut gallery".  Thanks to Victor and Pablo for doing 
the hard work of investigating this bug.

First, it has been a long time since Tim and I first developed gcmodule.c.  So, 
some of my understanding may be inaccurate due to code changes or old age 
memory loss. ;-P

If I understand Victor's test case correctly, the problem is caused if you have 
an extension type that implements tp_traverse but not tp_clear and that there 
is also a weakref involved in the trash cycle.  In my original design of the 
GC, not implementing tp_clear should have been okay.  It would mean that the GC 
might find garbage reference cycles that it couldn't cleanup.  Those would leak 
memory but would not crash Python.

I'm not sure what has changed since to require that tp_clear actually 
successfully clears the cycle.  Tim was the origin of the code that handles 
weakrefs. The GC is (relatively) simple if not for handling weakrefs and 
finalizers.  Tim did almost all of the difficult and brain exploding work on 
that stuff.  There was a big re-org some years ago to handle "legacy 
finalizers" and PEP 442 finalizers.  That made things more complicated yet.  
Maybe the requirement for a working tp_clear came into existence then?  I added 
Tim to the nosy list since he might have insight.

To me, it seems problematic that we would require a type to have a tp_clear 
method that actually breaks cycles.  For mutable objects like dicts and lists, 
we can have tp_clear do its thing while leaving the object in a valid state.  
The tp_clear added for functions was not like that because other code expected 
structure fields to be non-NULL.  At least that's my understanding.

Is the behavior of tp_clear the key to this bug?  In the original design GC, 
calling tp_clear was not guaranteed to cause objects in the cylce to be freed.  
So, after tp_clear, the object still needs to be in some kind of valid state.  
That is one of the reasons why the tuple type doesn't have a tp_clear (also 
that they can't normally be directly be used to create cycles).

One last observation: the reference cycle GC is now being relied upon in ways 
that were never originally envisioned.  Originally the cyclic GC was an 
optional feature and you could build Python without it.  Reference cycles were 
supposed to exist in rare cases and only be created by user code.  In that 
world, having tp_clear on the function type is be unneeded.  Now, CPython is 
creating reference cycles itself and the GC is being relied on much more to 
free memory.  I'm afraid we are evolving into a complicated and low performance 
GC (refcount + cycle collection).  I don't have any good suggestions on a 
better approach.  Maintaining the C-API ties us to reference counting.  I 
mention it because it might be helpful to have a high-level view of the 
evolution of this part of CPython.

--
nosy: +nascheme, tim.peters

___
Python tracker 

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



[issue38277] Allowing conditions with assignment expressions in comprehensions without parantheses

2019-09-27 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> wont fix
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



[issue38014] Python 3.7 does not compile

2019-09-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#38295 gives error reports for test_py_compile with 3.8, which implies that 
Python was compiled well enough to run and fail a test.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue38295] macOS Catalina test failures

2019-09-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This is not a duplicate because Python *did* compile enough to fail a test.

--
components: +macOS
nosy: +ronaldoussoren, terry.reedy
resolution: duplicate -> 
stage: resolved -> needs patch
status: closed -> open
superseder: Python 3.7 does not compile -> 
type: compile error -> behavior

___
Python tracker 

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



[issue38295] macOS Catalina test failures

2019-09-27 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Python 3.7 does not compile
type:  -> compile error

___
Python tracker 

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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-27 Thread STINNER Victor


STINNER Victor  added the comment:

@Dong-hee Na: Would you mind to try to backport the change to Python 2.7 which 
also has the bug?

--

___
Python tracker 

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



[issue38280] Add support to compile to native binary like as with golang

2019-09-27 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: Feature request: Add support to compile to native binary like as golang 
-> Add support to compile to native binary like as with golang

___
Python tracker 

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



[issue38280] Feature request: Add support to compile to native binary like as golang

2019-09-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The PSF and the core developer group do not have the resources to do this.  Pie 
in the sky proposals like this should be floated on python-list or perhaps 
python-ideas, where you can get more answers as to 'Why not ...?" or perhaps 
'How to ...?".  (Several millions dollars?)

--
nosy: +terry.reedy
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
versions:  -Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-27 Thread miss-islington


miss-islington  added the comment:


New changeset 6447b9f9bd27e1f6b04cef674dd3a7ab27bf4f28 by Miss Islington (bot) 
in branch '3.8':
bpo-38243, xmlrpc.server: Escape the server_title (GH-16373)
https://github.com/python/cpython/commit/6447b9f9bd27e1f6b04cef674dd3a7ab27bf4f28


--

___
Python tracker 

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



[issue38242] Revert the new asyncio Streams API

2019-09-27 Thread Yury Selivanov


Yury Selivanov  added the comment:

> Since this has been elevated to a release blocker, I wouldn't mind helping to 
> revert this ASAP. I can open a PR to fix it today.

Sure, by all means, any help would be hugely appreciated.  Thank you, Kyle.

You'll need to be careful to only revert the new functions & the asyncio.Stream 
class.  Also the new docs.  Due to proximity to the deadline, please be 
prepared that we might need to abandon your pull request if it's not ready by 
Sunday morning.  In which case Andrew or I will do this ourselves.

--

___
Python tracker 

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



[issue37883] threading.Lock.locked is not documented

2019-09-27 Thread Tal Einat


Change by Tal Einat :


--
versions: +Python 2.7

___
Python tracker 

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



[issue37883] threading.Lock.locked is not documented

2019-09-27 Thread Tal Einat


Change by Tal Einat :


--
Removed message: https://bugs.python.org/msg353402

___
Python tracker 

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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-27 Thread miss-islington


miss-islington  added the comment:


New changeset 39a0c730e31c6941a78da19b6a5b61170687 by Miss Islington (bot) 
in branch '3.7':
bpo-38243, xmlrpc.server: Escape the server_title (GH-16373)
https://github.com/python/cpython/commit/39a0c730e31c6941a78da19b6a5b61170687


--
nosy: +miss-islington

___
Python tracker 

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



[issue38277] Allowing conditions with assignment expressions in comprehensions without parantheses

2019-09-27 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
type:  -> enhancement
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue37883] threading.Lock.locked is not documented

2019-09-27 Thread Tal Einat


Tal Einat  added the comment:

Looking at Lib/threading.py and Modules/_threadmodule.c, it actually appears 
that RLock.locked() is only implemented by the C implementation, but not the 
Python implementation which is used as a backup.

If we're going to make the locked() method more visible by documenting it, we 
should expose such a method on the Python implementation, so that 
threading.RLock will indeed always have a locked() method.

>From a quick look, it seems that the Python RLock's _is_owned() method might 
>be just what we need, but that should be validated.

--

___
Python tracker 

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



[issue38242] Revert the new asyncio Streams API

2019-09-27 Thread Kyle Stanley


Kyle Stanley  added the comment:

> Andrew, do you want me to submit a PR or you can do it?

Since this has been elevated to a release blocker, I wouldn't mind helping to 
revert this ASAP. I can open a PR to fix it today.

--

___
Python tracker 

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



[issue38291] Unclear status of the typing.io and typing.re pseudo-modules in docs and runtime

2019-09-27 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Guido, what is your final opinion on this?

--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-27 Thread STINNER Victor


STINNER Victor  added the comment:

I remove the "release blocker" priority since the regression has been fixed in 
Python 3.8. The main "regression" was the addition of the func_clear() 
function: I removed it.

--
priority: release blocker -> 

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-27 Thread STINNER Victor


STINNER Victor  added the comment:

> I haven't been able to verify that the last patches are sufficient to prevent 
> Python from segfaulting. We need to wait until rc1 is out. I need a proper 
> release or RPM build to run the tests on our internal test infrastructure.

I pushed two fixes in the 3.8 branch for FreeIPA:

* I removed func_clear() which triggered the bug
* I fixed a reference cycle... in the weakref module :-)

As Pablo wrote, this issue is still open since the real deepest root issue is 
not fixed yet.

I was busy with random other stuff last weeks, so I didn't find time to dig 
into this issue again.

IMHO fixing the root issue can wait for Python 3.9 (and Python 3.8.1).

FreeIPA should now work fine on the current Python 3.8 branch.

--

___
Python tracker 

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



[issue38234] The value of Py_SetPath is not used to populate the configuration

2019-09-27 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, the main issue has been fixed and I added a lot of tests. So I remove the 
"release blocker" priority.

I would like to keep the issue open since I plan to do one more change: use 
PyWideStringList in _PyPathConfig for module_search_paths to support paths 
which contains DELIM (":" on Unix).

--
priority: release blocker -> 

___
Python tracker 

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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-27 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16020
pull_request: https://github.com/python/cpython/pull/16441

___
Python tracker 

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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16019
pull_request: https://github.com/python/cpython/pull/16440

___
Python tracker 

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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16018
pull_request: https://github.com/python/cpython/pull/16439

___
Python tracker 

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



[issue37883] threading.Lock.locked is not documented

2019-09-27 Thread Tal Einat


Tal Einat  added the comment:

For future reference, there's a nicer, more concise way to reference PRs: just 
type GH-16420 (using the relevant PR number).

--
nosy: +taleinat

___
Python tracker 

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



[issue38294] re.escape no longer escapes "/" or ":"

2019-09-27 Thread Ricardo Bánffy

Change by Ricardo Bánffy :


--
assignee:  -> docs@python
components: +Documentation -Regular Expressions
nosy: +docs@python
type: behavior -> enhancement

___
Python tracker 

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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e8650a4f8c7fb76f570d4ca9c1fbe44e91c8dfaa by Victor Stinner 
(Dong-hee Na) in branch 'master':
bpo-38243, xmlrpc.server: Escape the server_title (GH-16373)
https://github.com/python/cpython/commit/e8650a4f8c7fb76f570d4ca9c1fbe44e91c8dfaa


--

___
Python tracker 

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



[issue37883] threading.Lock.locked is not documented

2019-09-27 Thread Ido Michael


Change by Ido Michael :


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

___
Python tracker 

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



[issue38300] Documentation says destuction of TemporaryDirectory object will also delete it, but it does not.

2019-09-27 Thread Ammar Askar


Ammar Askar  added the comment:

Hmm, I can't recreate this locally:

>>> import tempfile
>>> import os
>>> t = tempfile.TemporaryDirectory()
>>> temp_dir = t.name
>>> os.path.exists(temp_dir)
True
>>> del t
>>> os.path.exists(temp_dir)
False

What version of Python are you using?

--
nosy: +ammar2

___
Python tracker 

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



[issue38300] Documentation says destuction of TemporaryDirectory object will also delete it, but it does not.

2019-09-27 Thread Ian


New submission from Ian :

The documentation found here 
https://docs.python.org/3.7/library/tempfile.html#tempfile.TemporaryDirectory 
states the following

"On completion of the context or destruction of the temporary directory object 
the newly created temporary directory and all its contents are removed from the 
filesystem."

However calling del on the object does not call the cleanup method.

t = tempfile.TemporaryDirectory()
del t

I'm not sure if that is incorrect documentation or my own misunderstanding of 
what you call destruction. I tested adding my own def __del__(): self.cleanup() 
which worked as I expected.

--
messages: 353393
nosy: iarp
priority: normal
severity: normal
status: open
title: Documentation says destuction of TemporaryDirectory object will also 
delete it, but it does not.
type: behavior
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



[issue38294] re.escape no longer escapes "/" or ":"

2019-09-27 Thread Ricardo Bánffy

Ricardo Bánffy  added the comment:

Indeed. It was easy to miss because of the joining and sorting. Being explicit 
on the 3.7 changes, that '!', '"', '%', "'", ',', '/', ':', ';', '<', '=', '>', 
'@', '`' were up to 3.6 but are no longer escaped since 3.7, would be nice.

--

___
Python tracker 

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



[issue38299] build errors - latest "git pull"

2019-09-27 Thread Geoge R. Goffe


New submission from Geoge R. Goffe :

SUMMARY: AddressSanitizer: 240 byte(s) leaked in 3 allocation(s).

--
components: Build
files: build-python-3.log
messages: 353391
nosy: grgo...@yahoo.com
priority: normal
severity: normal
status: open
title: build errors - latest "git pull"
type: compile error
versions: Python 3.9
Added file: https://bugs.python.org/file48629/build-python-3.log

___
Python tracker 

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



[issue38294] re.escape no longer escapes "/" or ":"

2019-09-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is already documented. There are even examples which contain "/" and ":".

--

___
Python tracker 

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



[issue38293] Deepcopying property objects results in unexpected TypeError

2019-09-27 Thread Guðni Nathan

Change by Guðni Nathan :


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

___
Python tracker 

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



[issue38294] re.escape no longer escapes "/" or ":"

2019-09-27 Thread Ricardo Bánffy

Ricardo Bánffy  added the comment:

Thanks for the clarification, Serhiy. Should we update the 3.7 docs to warn 
others about it?

--

___
Python tracker 

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



[issue38293] Deepcopying property objects results in unexpected TypeError

2019-09-27 Thread Guðni Nathan

Guðni Nathan  added the comment:

This bug appears to also affect shallow copies and can be reproduced with the 
following code:

>>> import copy
>>> obj = property()
>>> copy.copy(obj)
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Program 
Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1264.0_x64__qbz5n2kfra8p0\lib\copy.py",
 line 96, in copy
rv = reductor(4)
TypeError: can't pickle property objects

--

___
Python tracker 

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



[issue38297] Imports at top of module is often not used

2019-09-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think PEP 8 should say "Module-level imports are always put at the top of the 
file, ...".

--
nosy: +eric.smith

___
Python tracker 

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



[issue38298] Base class of generic type has wrong `cls` argument in classmethods

2019-09-27 Thread Kefei Lu


New submission from Kefei Lu :

This is a new regression in Python3.7.


Create the following file as `test.py`

```
# test.py

import typing as t


T = t.TypeVar("T")


class BaseOfGeneric:

@classmethod
def f(cls):
# when called from an instantiated generic type, e.g.,
# `MyList[int]`, expect `cls` to be the GenericAlias with its type
# argument already insteantiated
print(f"current class is {cls}")
print(f"current class's type: {type(cls)}")


class MyList(t.List[T], BaseOfGeneric):
pass


MyIntList = MyList[int]

MyIntList.f()
```

Run with Python3.6:

>>> python3.6 ./test.py 
current class is __main__.MyList[int]
 ^^^ as expected

current class's type: 

EXPECTED BEHAVIOR: The outcome is expected: `cls` of `BaseOfGeneric.f` should 
be `MyList` **with** type argument `int`


However this is wrong in Python3.7:

>>> python3.7 ./test.py 
current class is 
 ^^^ type argument is LOST !!!

current class's type: 

Note that `cls` of `BaseOfGeneric.f` has lost the type argument `int`! It is 
not expected.

--
messages: 353386
nosy: kflu
priority: normal
severity: normal
status: open
title: Base class of generic type has wrong `cls` argument in classmethods
type: behavior
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



[issue38297] Imports at top of module is often not used

2019-09-27 Thread Dominic Littlewood


New submission from Dominic Littlewood <11dlittlew...@gmail.com>:

In PEP 8, it is stated that:
"Imports are always put at the top of the file, just after any module comments 
and docstrings, and before module globals and constants."

Note the word "always". This advice makes sense because it cuts down on 
performance costs.

I recently got into an argument about this, and so I created a script to find 
all the times in the standard library that an import statement was used inside 
a function or method. I was expecting to get one or two, but it's safe to say 
that the answer 1576 was a little surprising. (I was on 3.7.4, if anyone wants 
to check.)

It turns out that more than one in five modules (defined as any .py file) 
contain at least one violation of this rule. In the standard library, there are 
more violations of the rule than there are while loops. Do we need to either a) 
fix large parts of the standard library or b) rewrite PEP 8 to say that this 
might not actually be all that bad?

--
components: Library (Lib)
messages: 353385
nosy: plokmijnuhby
priority: normal
severity: normal
status: open
title: Imports at top of module is often not used
type: performance

___
Python tracker 

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



[issue38294] re.escape no longer escapes "/" or ":"

2019-09-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, it is deliberate. "/" and ":" do not have special meaning in regular 
expressions and do not need escaping. re.escape() now produces more 
human-readable result and works faster.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38293] Deepcopying property objects results in unexpected TypeError

2019-09-27 Thread Guðni Nathan

Guðni Nathan  added the comment:

Function objects are considered "atomic" here and I believe you can also write 
to their __doc__ (among other attributes).

--

___
Python tracker 

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



[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-27 Thread Kit Choi


New submission from Kit Choi :

I expect the following test to fail, because an "error" is not a "failure".
Unexpectedly, the test passes:

```
class TestFailure(unittest.TestCase):

@unittest.expectedFailure
def test_expected_failure(self):
raise TypeError()   # for example, a typo.
```

```
$ python -m unittest test_main
x
--
Ran 1 test in 0.000s

OK (expected failures=1)
```

This behaviour exists since Python 2.7, and is still true for the Python 3.8.0b1

--
components: Tests
messages: 353382
nosy: Kit Choi
priority: normal
severity: normal
status: open
title: unittest expectedFailure does not differentiate errors from failures
type: behavior
versions: Python 3.5, 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



[issue38295] macOS Catalina test failures

2019-09-27 Thread Barry A. Warsaw


New submission from Barry A. Warsaw :

test_py_compile fails on macOS Catalina beta (19A573a)

==
ERROR: test_relative_path (test.test_py_compile.PyCompileTestsWithSourceEpoch)
--
Traceback (most recent call last):
  File "/Users/bwarsaw/projects/python/3.8/Lib/test/test_py_compile.py", line 
30, in wrapper
return fxn(*args, **kwargs)
  File "/Users/bwarsaw/projects/python/3.8/Lib/test/test_py_compile.py", line 
111, in test_relative_path
py_compile.compile(os.path.relpath(self.source_path),
  File "/Users/bwarsaw/projects/python/3.8/Lib/py_compile.py", line 157, in 
compile
os.makedirs(dirname)
  File "/Users/bwarsaw/projects/python/3.8/Lib/os.py", line 221, in makedirs
mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: 
'../../../../../../../var/folders/w6/w_2zrjgj7bgdgkhdjm4_r9s4000slb/T/tmpq3p6aoly'

==
ERROR: test_relative_path 
(test.test_py_compile.PyCompileTestsWithoutSourceEpoch)
--
Traceback (most recent call last):
  File "/Users/bwarsaw/projects/python/3.8/Lib/test/test_py_compile.py", line 
20, in wrapper
return fxn(*args, **kwargs)
  File "/Users/bwarsaw/projects/python/3.8/Lib/test/test_py_compile.py", line 
111, in test_relative_path
py_compile.compile(os.path.relpath(self.source_path),
  File "/Users/bwarsaw/projects/python/3.8/Lib/py_compile.py", line 157, in 
compile
os.makedirs(dirname)
  File "/Users/bwarsaw/projects/python/3.8/Lib/os.py", line 221, in makedirs
mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: 
'../../../../../../../var/folders/w6/w_2zrjgj7bgdgkhdjm4_r9s4000slb/T/tmpquor0q8r'

--

--
components: Tests
messages: 353381
nosy: barry, ned.deily
priority: normal
severity: normal
status: open
title: macOS Catalina test failures
versions: 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



[issue38294] re.escape no longer escapes "/" or ":"

2019-09-27 Thread Ricardo Bánffy

Change by Ricardo Bánffy :


--
title: re.escape seems to miss some importante regex characters -> re.escape no 
longer escapes "/" or ":"

___
Python tracker 

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



[issue38294] re.escape seems to miss some importante regex characters

2019-09-27 Thread Ricardo Bánffy

New submission from Ricardo Bánffy :

Under Python 3.6, re.escape escapes "/"

In [1]: import re

In [2]: re.escape('http://workday.com')
Out[2]: 'http\\:\\/\\/workday\\.com'

Under 3.7 and 3.8, "/" is not escaped.

In [1]: import re

In [2]: re.escape('http://workday.com')
Out[2]: 'http://workday\\.com'

Is this change deliberate? For a minor release (3.6 to 3.7) this broke some 
code that generated `sed` commands to run on a remote server.

--
components: Regular Expressions
messages: 353380
nosy: Ricardo Bánffy, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: re.escape seems to miss some importante regex characters
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue32820] Add and document __format__ method for IPv[46]Address

2019-09-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 5d6f5b629394066a5249af25cc01f1a1f0edc138 by Serhiy Storchaka in 
branch 'master':
bpo-32820: Simplify __format__ implementation for ipaddress. (GH-16378)
https://github.com/python/cpython/commit/5d6f5b629394066a5249af25cc01f1a1f0edc138


--

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

There is this PR that avoids a hard crash in the interpreter:

https://github.com/python/cpython/pull/15645

--

___
Python tracker 

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



[issue38293] Deepcopying property objects results in unexpected TypeError

2019-09-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

But the property object is not atomic. It's attribute __doc__ is writeable.

--
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   >