[issue38938] Possible performance improvement for heaqq.merge()

2020-05-22 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

key_and_reverse.py employs the same strategy as winners.py, but uses lists as 
the nodes of the tree rather than using Node instances. It also eliminates the 
recursion of treeify, and adds (with neither much of a performance hit nor much 
code duplication) support for ``key=some_func`` and/or ``reverse=True`` keyword 
arguments, so it now passes the test_heapq suite.

--
Added file: https://bugs.python.org/file49180/key_and_reverse.py

___
Python tracker 

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



[issue40670] supplying an empty string to timeit causes an IndentationError

2020-05-22 Thread Rahul Kumaresan


Change by Rahul Kumaresan :


--
nosy:  -rahul-kumi

___
Python tracker 

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



[issue40297] test_socket.CANTest is broken at HEAD on master

2020-05-22 Thread Karl Ding


Karl Ding  added the comment:

Related: I've started a thread on Discourse [0] looking into why the tests 
don't seem to be run on the Buildbot cluster (and what it would take to enable 
them). Hopefully it gains some traction.

[0] 
https://discuss.python.org/t/what-would-it-take-to-run-socketcan-tests-on-a-buildbot/4137

--

___
Python tracker 

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



[issue40724] Support buffer protocol with type specs

2020-05-22 Thread Stefan Behnel


New submission from Stefan Behnel :

As far as I can see it in typeslots.h [1], the buffer protocol is still not 
supported when using type specs:

/* Disabled, see #10181 */
#undef Py_bf_getbuffer
#undef Py_bf_releasebuffer

It seems that the discussion in issue 10181 did not lead anywhere at the time 
(2010-2012).

I'm not talking about the limited API or the stable ABI here, I'm talking about 
using type specs to define an extension type. The work-around is to manually 
set "PyTypeObject->tp_as_buffer" after creating the type, but since 
PyType_Ready() then does not see that struct pointer, you also still have to 
make sure that the type correctly inherits the slots from the base type if 
you're not defining all of them yourself.

Can we just add support for the above slots?

[1] 
https://github.com/python/cpython/blob/ca829102213c466ffecb1e464be5c8cb3967d961/Include/typeslots.h#L2-L4

--
components: C API
messages: 369561
nosy: ncoghlan, paul.moore, petr.viktorin, pitrou, scoder, skrah, vstinner
priority: normal
severity: normal
status: open
title: Support buffer protocol with type specs
type: enhancement
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue38946] IDLE on macOS 10.15 Catalina does not open double-clicked files if app already launched

2020-05-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

When I say that I am 99% sure that this is not an IDLE issue at all, I mean 
that I am 99% sure that a non-IDLE tkinter program registered as a working 
double-click handler in Mohave will not be properly invoked in Catalina.  A 
counter-example might suggest a possible fix for IDLE.

Likewise, doubt that this is a tkinter issue means that I suspect that a 
working .tcl Mohave double click handler would fail in Catalina.  A 
counterexample would suggest looking at tkinter/__init__.py and  _tkiter.py.  
For example, #40452 was opened as a Windows-specific IDLE failure, with a PR.  
However, Tal Einat discovered that a) the same problem existed on macOS, b) a 
4-line tkinter program also failed, c) a 4-line .tcl program worked, and d) on 
exit, tcl calls code that is no longer called in _tkinter, during python exit 
(after python was partly torn down).  We expect to fix the issue by calling a 
narrower acting tcl function before python exit.

IDLE opens existing files with idlelib.filelist.FileList.open.  It gets 
filenames from the os command line, the tk open file dialog, IDLE's Open Module 
dialog and Path Browser, and its Recent Files list.  I don't know how an OS 
file manager passes a filename to this function in a particular process, but I 
imaging that the GUI framework, the IDLE icon, and the double-click 
registration information may all be involved.  (On both Windows and macOS, 
double clicks to not open the file in an existing IDLE opened from a command 
line.) Anyway, here is an easy experiment with IDLE itself that someone should 
do on Catalina.

Open x.y Shell an IDLE icon (not the command line).
File => OpenModule idlelib.filelist
At the top of the open() body, after 'def open(self, filename,...)' add
tkMessageBox.showerror('', filename, master=self.root)
Save and close the editor and shell (*required*).
Open x.y Shell from the same IDLE icon.  It will import the revised filelist 
module.
Open a file from within IDLE.  A message box appears with the full path and an 
[OK] button.  Click the button and the new editor window appears.
Double-click a file in Finder.  For me, on Mohave, the same thing happens as 
above.  I expect that on Catalina, there is no message box, indicating that 
IDLE's file open function is not called.  If I am wrong, check the displayed 
path and move the debug line down to find where execution stops.

--
priority: critical -> normal

___
Python tracker 

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



[issue40725] Documentation: Benchmark table in "What's new in Python 3.9" has weird values

2020-05-22 Thread Jakub Beránek

New submission from Jakub Beránek :

The "What's new in Python 3.9" page displays a table with microbenchmark 
results between different Python version 
(https://docs.python.org/3.9/whatsnew/3.9.html#optimizations).

The values provided for Python 3.4 are suspicious, as they are several times 
smaller than all following Python versions. Therefore it looks like Python got 
much slower in the recent releases, although the opposite is probably true.

--
assignee: docs@python
components: Documentation
messages: 369563
nosy: Jakub Beránek, docs@python
priority: normal
severity: normal
status: open
title: Documentation: Benchmark table in "What's new in Python 3.9" has weird 
values
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



[issue40723] IDLE: make autocomplete test run without __main__.__file__

2020-05-22 Thread Florian Dahlitz


Florian Dahlitz  added the comment:

I was able to reproduce the reported issue and the suggested fix worked fine. 
Is there anything else missing like documentation note?

I would like to submit a PR for this @terry.reedy

--
nosy: +DahlitzFlorian

___
Python tracker 

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



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-05-22 Thread Florian Dahlitz


Florian Dahlitz  added the comment:

Should we add a note that there is no preferred way of naming enum members and 
provide a few examples or define some naming conventions?

--
nosy: +DahlitzFlorian

___
Python tracker 

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



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-05-22 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +barry, eli.bendersky, ethan.furman

___
Python tracker 

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



[issue40725] Documentation: Benchmark table in "What's new in Python 3.9" has weird values

2020-05-22 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue40711] Clearing the screen of IDLE interactive mode in Windows

2020-05-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

3.5 and 3.6 only get security fixes.

#6143 proposes to add special mechanism to clear Shell.  It is a low priority 
for me as I very seldom want to, or if a editor is open, one can close the 
shell and start over when running the editor file.

Clear an editor with select-all (^A for me), backspace or del or control-X (to 
save to clipboard).

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



[issue40723] IDLE: make autocomplete test run without __main__.__file__

2020-05-22 Thread Florian Dahlitz


Change by Florian Dahlitz :


--
keywords: +patch
pull_requests: +19580
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20311

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread gaborbernat


New submission from gaborbernat :

Reporting an issue from https://github.com/xonsh/xonsh/issues/3581; boils down 
to, ast.Call used to not define end_lineno in 3.8:

py -3.8 -c 'import ast; type(ast.Call().end_lineno)'

 Traceback (most recent 
call last):
  File "", line 1, in 
AttributeError: 'Call' object has no attribute 'end_lineno'

However in 3.9 is defined with None:

py -3.9 -c 'import ast; type(ast.Call().end_lineno)'

This messes with some other operations in ast, namely 
https://github.com/python/cpython/blob/master/Lib/ast.py#L233

--
messages: 369567
nosy: gaborbernat
priority: normal
severity: normal
status: open
title: ast.Call end_lineno is defined and returns None
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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +pablogsal

___
Python tracker 

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



[issue40709] Malfunctioning of '\r'

2020-05-22 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue40709] Malfunctioning of '\r'

2020-05-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Discussed on #23220.  Note that 'sciencecomputer' is a different possible 
result if \r does not switch the simulated terminal from the normal insert mode 
to overwrite mode.  I am considering terminal simulation as an option, but 
there is not exactly a standard to emulate.

--
resolution: not a bug -> duplicate
superseder:  -> IDLE: Document how Shell displays user code output

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread David Strobach


Change by David Strobach :


--
nosy: +laloch

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread David Strobach


David Strobach  added the comment:

The issue is not limited to ast.Call. Other AST nodes are also affected (e.g. 
ast.BinOp). It's also not limited to end_lineno attribute. The same applies to 
end_col_offset.

--

___
Python tracker 

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



[issue40640] Tutorial for Continue missing ... line

2020-05-22 Thread Rahul Kumaresan


Rahul Kumaresan  added the comment:

I think the ommission of secondary prompt(...) at the end of the loop in the 
code snippet doesn't affect what the example wanted to demonstrate. Even so, if 
this has to be fixed, this correction is to be done in versions 3.5 through 3.10

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



[issue40690] unittest: if FunctionTestCase is imported, the loader loads "tests" from it

2020-05-22 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

> then you will have 1 extra test in that module (the imported one), moreover, 
> that test will be broken.

If this is true, then how is anyone able to be using FunctionTestCase in their 
tests today? Is the feature broken?

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue40725] Documentation: Benchmark table in "What's new in Python 3.9" has weird values

2020-05-22 Thread Rahul Kumaresan


Change by Rahul Kumaresan :


--
nosy: +rahul-kumi

___
Python tracker 

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



[issue40579] Second argument to iterator.next not described

2020-05-22 Thread Rahul Kumaresan


Change by Rahul Kumaresan :


--
nosy: +rahul-kumi

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

This is because the 'end_lineno' and 'end_col_offset' are declared as optional 
attributes in the ASDL spec. The commit 
'b7e9525f9c7ef02a1d2ad8253afdeb733b0951d4' made all optional fields and 
attributes auto initalized with None.

--

___
Python tracker 

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



[issue40727] SSLContext.load_verify_locations leaks memory on Linux in async code

2020-05-22 Thread Recursing


New submission from Recursing :

Minimal code to reproduce:
```
import ssl
import certifi
import gc
import asyncio


ca_path = certifi.where()
async def make_async_context() -> None:
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
context.load_verify_locations(ca_path)
await asyncio.sleep(1)


async def main(n: int) -> None:
await asyncio.wait([make_async_context() for _ in range(n)])


gc.collect()
asyncio.run(main(2000))
input("Finished run, still using lots of memory :(")
gc.collect()
input("gc.collect() does not help :(")
```

Running this code on several linux machines (with python from 3.6.9 to 3.9.0a5, 
and openSSL from 1.1.1  11 Sep 2018 to 1.1.1g  21 Apr 2020) causes a 
significant memory leak, while on windows memory usage peaks around 1 GB but 
gets freed

--
assignee: christian.heimes
components: Library (Lib), SSL, asyncio
messages: 369573
nosy: Recursing, asvetlov, christian.heimes, yselivanov
priority: normal
severity: normal
status: open
title: SSLContext.load_verify_locations leaks memory on Linux in async code
type: resource usage
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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

See here for the complete spec: 
https://docs.python.org/3.9/library/ast.html#abstract-grammar

--

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40690] unittest: if FunctionTestCase is imported, the loader loads "tests" from it

2020-05-22 Thread Vitalii


Vitalii  added the comment:

I don't think anyone is using FunctionTestCase

--

___
Python tracker 

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



[issue40723] IDLE: make autocomplete test run without __main__.__file__

2020-05-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Go ahead. Since the failure was user visible, there should be a note.  For IDLE 
issues, idlelib/NEWS.txt also needs an addition, but not until ready to merge.  
So add a trial blurb or not as you wish.  In any case, I need to fix the 3.8 
version and perhaps the 3.7 version before another IDLE commit.

--

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This was done in b7e9525f9c7ef02a1d2ad8253afdeb733b0951d4 for issue 36287, all 
attribute should now be defined, even when they are not set. It looks like some 
parts of the ast module where not updated.

If nobody works on this I will send a PR to update the rest of AST later today.

--
components: +Library (Lib)
nosy: +remi.lapeyre -BTaskaya, serhiy.storchaka
type:  -> behavior
versions: +Python 3.10

___
Python tracker 

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



[issue40727] SSLContext.load_verify_locations leaks memory on Linux in async code

2020-05-22 Thread Christian Heimes


Christian Heimes  added the comment:

Does it also leak without asyncio?

--

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread Florian Dahlitz


Change by Florian Dahlitz :


--
nosy: +DahlitzFlorian

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-05-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

It seems we don't have a champion (someone willing to write a PEP) for this 
issue. I'm going to close.

And if or when we do have such a champion, it probably makes more sense to 
re-open #37132, which is specifically about adding `imath`, or make a new 
issue, rather than re-opening this one.

--
resolution:  -> rejected
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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
keywords: +patch
nosy: +BTaskaya
nosy_count: 5.0 -> 6.0
pull_requests: +19581
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20312

___
Python tracker 

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



[issue40640] Tutorial for Continue missing ... line

2020-05-22 Thread Florian Dahlitz


Florian Dahlitz  added the comment:

@docor...@sonic.net are you going to submit a PR for it or am I free to do it?

--
nosy: +DahlitzFlorian

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> If nobody works on this I will send a PR to update the rest of AST later 
> today.

:/ I'm terribly sorry for that, I just sent a PR without refreshing the tab.

--

___
Python tracker 

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



[issue40727] SSLContext.load_verify_locations leaks memory on Linux in async code

2020-05-22 Thread Recursing


Recursing  added the comment:

Removing the `await asyncio.sleep(1)` removes the leak, while changing it to 
`await asyncio.sleep(0)` seems to keep it

--

___
Python tracker 

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



[issue40568] Modify -c command-line option to accept multiple inputs

2020-05-22 Thread Florian Dahlitz


Change by Florian Dahlitz :


--
nosy: +DahlitzFlorian

___
Python tracker 

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



[issue40727] SSLContext.load_verify_locations leaks memory on Linux in async code

2020-05-22 Thread Christian Heimes


Christian Heimes  added the comment:

Without asyncio memory consumption stays low and stable for me:

$ ./python -m venv venv
$ ./venv/bin/pip install psutil
$ ./venv/bin/python
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.1.1g FIPS  21 Apr 2020'
>>> import psutil, ssl, os
>>> p = psutil.Process(os.getpid())
>>> cafile = ssl.get_default_verify_paths().cafile
>>> p.memory_info()
pmem(rss=14811136, vms=237223936, shared=8138752, text=2125824, lib=0, 
data=6701056, dirty=0)
>>> for i in range(1000):
... ssl.SSLContext(ssl.PROTOCOL_TLS).load_verify_locations(cafile)
... 
>>> p.memory_info()
pmem(rss=17489920, vms=238170112, shared=9863168, text=2125824, lib=0, 
data=7647232, dirty=0)
>>> for i in range(1000):
... ssl.SSLContext(ssl.PROTOCOL_TLS).load_verify_locations(cafile)
... 
>>> p.memory_info()
pmem(rss=17489920, vms=238170112, shared=9863168, text=2125824, lib=0, 
data=7647232, dirty=0)

--

___
Python tracker 

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



[issue40727] SSLContext.load_verify_locations leaks memory on Linux in async code

2020-05-22 Thread Christian Heimes


Christian Heimes  added the comment:

When I run your example, RSS jumps from 20 MB to about 1,600 MB. There is 
almost no increase when I run the look several more times.

>>> p.memory_info()
pmem(rss=19902464, vms=240513024, shared=10014720, text=2125824, lib=0, 
data=9887744, dirty=0)
>>> asyncio.run(main(2000))
:2: DeprecationWarning: The explicit passing of coroutine objects to 
asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in 
Python 3.11.
>>> p.memory_info()
pmem(rss=1608568832, vms=1829105664, shared=10014720, text=2125824, lib=0, 
data=1598480384, dirty=0)
>>> asyncio.run(main(2000))
>>> p.memory_info()
pmem(rss=1608835072, vms=1829367808, shared=10014720, text=2125824, lib=0, 
data=1598742528, dirty=0)
>>> asyncio.run(main(2000))
>>> p.memory_info()
pmem(rss=1608601600, vms=1829367808, shared=10014720, text=2125824, lib=0, 
data=1598742528, dirty=0)


Why are you creating so many SSLContext objects any way? It's very inefficient 
and really not necessary. I recommend that you create one context in your 
application and reuse for all connection. You only ever need additional 
contexts for different configuration (protocol, verification, trust anchors, 
...).

--
assignee: christian.heimes -> 

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-05-22 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Mark Dickinson, I was waiting for everyone to have a chance to comment on 
this issue and read their reply before answering.

It seems to me that there some core developers are mildly in favor of a new 
imath module and it's has been proposed on the bug tracker and python-ideas 
while other would prefer it as an external package.

I agree with the idea that that using gfactor is not the best, it may not be 
installed and has different names on different OS. The state of the art 
algorithms used by others languages and libraries for numbers up to 2**64 are 
not very complicated, as Steven D'Aprano said deterministic MR works incredibly 
well for numbers < 2**64 and that's what I implemented with a probabilistic 
test for larger number. It only misses a Lucas test to be a complete 
Baillie–PSW test.

As you said the PEP would have to explain why not just use sympy and honestly I 
don't have a very good argument there for now.

In the end, if some core devs think that putting together the various 
discussions for an imath module in a coherent PEP so it can be discussed and 
either:

 - accepted and merged,
 - refused with some functions merged in math,
 - definitely put to bed

would be useful and prevent additional discussions around this idea, I'm 
willing to do the leg work (thought I may take me some time).

If nobody thinks it would be really helpful, I may focus my time on other 
issues.

--

___
Python tracker 

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



[issue40727] SSLContext.load_verify_locations leaks memory on Linux in async code

2020-05-22 Thread Recursing


Recursing  added the comment:

> Without asyncio memory consumption stays low and stable for me

Same for me

> RSS jumps from 20 MB to about 1,600 MB.

That is the memory consumption I observe as well, the issue is that it doesn't 
get freed on Linux

> There is almost no increase when I run the look several more times.

Same for me, but of course only if I exit the "async" context between runs

> Why are you creating so many SSLContext objects any way? It's very 
> inefficient and really not necessary.

The original issue was observed in a very long running process (months), that 
occasionally needed a context and it was convenient to just create one every 
time (actually it creates an AsyncClient context 
https://github.com/encode/httpx/issues/978) even if it is relatively 
inefficient, it didn't really matter, but memory usage unexpectedly slowly grew 
to 1 GB which was very unexpected

--

___
Python tracker 

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



[issue40723] IDLE: make autocomplete test run without __main__.__file__

2020-05-22 Thread Florian Dahlitz


Florian Dahlitz  added the comment:

I added a news entry to idlelib/NEWS.txt but don't know, where to add an 
additional note. The documentation of IDLE doesn't seem to be the right place. 
Should a note be added to Misc/NEWS.d/next or would it be redundant, because it 
is already added to idlelib/NEWS.txt?

Sorry, if I misunderstood you, but it is my first contribution to IDLE. Thanks 
for the guidance, I really appreciate it!

--

___
Python tracker 

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



[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Oleksandr Suvorov


New submission from Oleksandr Suvorov :

def foo(exc):
   try:
   1/0
   except Exception as exc:
   ...
   finally:
   return exc

foo(1)

Executing the following code results in UnboundLocalError, while exc has been 
defined and passed to a function explicitly.

I think this is something similar to python2 issue when list comprehensions 
where overwriting local variable values, expected behaviour in here is that 
foo(1) returns 1

--
components: Interpreter Core
messages: 369588
nosy: oleksandr.suvorov
priority: normal
severity: normal
status: open
title: UnboundLocalError as a result of except statement variable re-assignment
type: behavior
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



[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is expected behaviour and happens because we need to clean the exception 
variable outside the `except` block to avoid reference cycles. If you need the 
variable later, you need to do an assignment:

   try:
   1/0
   except Exception as exc:
   e = exc
   finally:
   return e

--
nosy: +pablogsal

___
Python tracker 

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



[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is the equivalent construct that we compile it to:

https://github.com/python/cpython/blob/master/Python/compile.c#L3102-L3110

--

___
Python tracker 

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



[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +Mark.Shannon
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



[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Oleksandr Suvorov


Oleksandr Suvorov  added the comment:

But then why I still can access this variable? Shouldn't it then be
resulting in NameError as it's undefined variable at this point of time?
I think UnboundError creates more confusing here, as it's either the
variable should exist and have a value or it should be unknown and result
in NameError at this point.

On Fri, May 22, 2020 at 1:08 PM Pablo Galindo Salgado <
rep...@bugs.python.org> wrote:

>
> Change by Pablo Galindo Salgado :
>
>
> --
> nosy: +Mark.Shannon
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>But then why I still can access this variable? Shouldn't it then be
resulting in NameError as it's undefined variable at this point of time?

I don't think so, this is the same as if you do:

def f(exc):
   del exc
   return exc

>>> f(3)
Traceback (most recent call last):
  File "", line 1, in 
  File "lel.py", line 3, in f
return exc
UnboundLocalError: local variable 'exc' referenced before assignment

--

___
Python tracker 

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



[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Christian Heimes


Christian Heimes  added the comment:

UnboundLocalError is a subclass of NameError. You are getting a more specific 
error here.

>>> UnboundLocalError.__mro__
(, , , , )

--
nosy: +christian.heimes

___
Python tracker 

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



[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Oleksandr Suvorov


Oleksandr Suvorov  added the comment:

but if exc variable is only available in except block why then it shadows
the function variable name?

On Fri, May 22, 2020 at 1:15 PM Christian Heimes 
wrote:

>
> Christian Heimes  added the comment:
>
> UnboundLocalError is a subclass of NameError. You are getting a more
> specific error here.
>
> >>> UnboundLocalError.__mro__
> (, , ,
> , )
>
> --
> nosy: +christian.heimes
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> as it's either the
variable should exist and have a value or it should be unknown and result
in NameError at this point.

One thing is the symbol and another thing is its value. The function is always 
aware of the existence of the symbol. For instance:

def f(x):
   del x
   print(x)

>>> print(f.__code__.co_varnames)
('x',)

But when the function tries to use it, it has no value associated to it because 
del x removed it, so it emits an UnboundLocalError because there is no value.

raceback (most recent call last):
  File "lel.py", line 7, in 
f(3)
  File "lel.py", line 3, in f
print(x)
UnboundLocalError: local variable 'x' referenced before assignment

A NameError will occur if the symbol is unknown to the function.

--
nosy:  -christian.heimes

___
Python tracker 

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



[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Oleksandr Suvorov


Oleksandr Suvorov  added the comment:

What I mean is why would it need to shadow function variable name if after
except block it's always unbound, what is the reason and why this is
expected?

On Fri, May 22, 2020 at 1:19 PM Oleksandr Suvorov 
wrote:

>
> Oleksandr Suvorov  added the comment:
>
> but if exc variable is only available in except block why then it shadows
> the function variable name?
>
> On Fri, May 22, 2020 at 1:15 PM Christian Heimes 
> wrote:
>
> >
> > Christian Heimes  added the comment:
> >
> > UnboundLocalError is a subclass of NameError. You are getting a more
> > specific error here.
> >
> > >>> UnboundLocalError.__mro__
> > (, , ,
> > , )
> >
> > --
> > nosy: +christian.heimes
> >
> > ___
> > Python tracker 
> > 
> > ___
> >
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> but if exc variable is only available in except block why then it shadows
the function variable name?

Because the except block does not create a new scope and therefore when you do 
'except as x' it does an assignment to x in the same scope as the function.

--

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2020-05-22 Thread Beuc


Beuc  added the comment:

I've been maintaining a Python Emscripten build for the Ren'Py (game engine) 
web port:
https://github.com/python-emscripten/python
https://renpy.beuc.net/

I recently tackled Python3 with a minimal/embeddable approach and checking the 
other ports already pointed in the discussion:
https://github.com/python-emscripten/python/tree/trunk/3.8/
(2 patches, and a short pyconfig.h fix-up)

There is also a Cython module to use the Emscripten C API.

Here's a demo at:
https://www.beuc.net/python-emscripten/demo/3/
(hello-world size: 3MB, with a few common modules: 4MB)

I can provide a pull request with a first few core changes.
Should this be done on github?

-

cross-compilation handling appears to follow an incorrect logic, in particular 
by querying 'dpkg' or parsing compiler output to detect include paths -- it is 
the (cross-)compiler's responsibility to provide the system paths, and 
detecting them manually causes conflicts. I had to patch setup.py. Let me know 
if I missed something.

Usually cross-compiling is triggered by non-matching build-type/host-type. Here 
cross-compilation logic is apparently triggered when exporting 
_PYTHON_HOST_PLATFORM=xxx manually (it's in the Makefile but not exported, and 
breaks normal build when exported). Is this the way it's meant to be used?

--
nosy: +Beuc

___
Python tracker 

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



[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-05-22 Thread Petr Viktorin


Petr Viktorin  added the comment:

Indeed, it seems my initial analysis was incorrect. I can't reproduce this 
outside of PySide. 
I'll close this bug and invesatigate more.

Sorry for the noise.

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-05-22 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

On Fri, May 22, 2020 at 10:23:06AM +, Rémi Lapeyre wrote:
> As you said the PEP would have to explain why not just use sympy and 
> honestly I don't have a very good argument there for now.

Because sympy is a beast. It's an excellent beast, but its an absolute 
monster. I stopped counting at 400 modules, not including tests. Having 
to install a mega-library like sympy to get two or three functions is 
overkill, like using a nuclear-powered bulldozer to crack a peanut.

The sympy docs say:

"SymPy does require mpmath Python library to be installed first. The 
recommended method of installation is through Anaconda, which includes 
mpmath, as well as several other useful libraries. Alternatively, some 
Linux distributions have SymPy packages available."

which is great if you are using Anaconda, a little less great if you're 
using Linux, and not very good if you're not using either.

And it's especially not very good if you are a student using a school 
laptop where Python is installed but you are not permitted to install 
other software. (Likewise for corporate users with locked down desktops, 
although they are less likely to care about prime numbers.)

sympy also comes with it's own odd ways of doing things, such as having 
to care about the difference between Python numbers and sympy numbers. 
(Not for prime testing, admittedly. I'm just making a general 
observation.)

--

___
Python tracker 

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



[issue40452] Tkinter/IDLE: preserve clipboard on closure

2020-05-22 Thread E. Paine

E. Paine  added the comment:

Unfortunately, after lots of testing/experimenting, I cannot find a way to make 
the correct call/s at the correct time. The methods that call the exit handlers 
directly or through InvokeExitHandlers are Tcl_Exit, Tcl_Finalize & 
FinalizeThread (Tcl_FinalizeThread) – Tcl_ExitThread calls Tcl_FinalizeThread.

We want to call the exit handlers (to access TkClipCleanup) with as little else 
as possible and both Tcl_Exit & Tcl_Finalize call FinalizeThread, so I 
concluded the method we should call is Tcl_FinalizeThread. Tcl_Finalize also 
stops the Python interpreter (not quite sure why), so this should only be 
called when the interpreter is stopping/stopped.

The problem with Tcl_FinalizeThread, is that it also finalises some of the 
mutexs (most notably asyncMutex - part of the async system). Once the mutexs 
are finalised, I can't find a way of creating them again (I think they are a 
global variables created on load), meaning that a new tcl interpreter cannot be 
created in the same thread (and even if it can, any calls to it cause the 
Python interpreter to crash).

This means we cannot call the Tcl_FinalizeThread method either when the root is 
destroyed or when the Tkapp object is deleted, as the user could still request 
a new tcl interpreter. This leaves us with only one option: call it when the 
Python interpreter is closing. For this, which call is made doesn’t really 
matter, and so to test, I commented out the "#if 0", to see if this call fixed 
the clipboard issue (if it had worked, we could have deleted all bindings 
before calling Tcl_Finalize). Unfortunately, this did not fix the clipboard 
issue and so I did not deem it worth developing an "unbinder" (possibly because 
the GC had already destroyed the interpreter?).

I did not even get onto the issue of multiple, simultaneous interpreters but 
unless someone has an idea that could solve any of the issues above (or we ask 
the Tcl team to make TkClipCleanup a public method!), I can’t see how we can 
patch this issue.

--

___
Python tracker 

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



[issue40579] Second argument to iterator.next not described

2020-05-22 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue40725] Documentation: Benchmark table in "What's new in Python 3.9" has weird values

2020-05-22 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger

___
Python tracker 

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



[issue40725] Documentation: Benchmark table in "What's new in Python 3.9" has weird values

2020-05-22 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue40729] Update the list of auto-generated files in .gitattributes

2020-05-22 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: BTaskaya
priority: normal
severity: normal
status: open
title: Update the list of auto-generated files in .gitattributes

___
Python tracker 

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



[issue40729] Update the list of auto-generated files in .gitattributes

2020-05-22 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue40725] Documentation: Benchmark table in "What's new in Python 3.9" has weird values

2020-05-22 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40725] Documentation: Benchmark table in "What's new in Python 3.9" has weird values

2020-05-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 5c01ed6f9366bc6fd880c18e5a2929de72bc1be6 by Miss Islington (bot) 
in branch '3.9':
bpo-40725: Restore missing column of digits (GH-20313) (GH-20315)
https://github.com/python/cpython/commit/5c01ed6f9366bc6fd880c18e5a2929de72bc1be6


--

___
Python tracker 

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



[issue36395] Add deferred single-threaded/fake executor to concurrent.futures

2020-05-22 Thread Leonardo Santagada


Leonardo Santagada  added the comment:

I have a single example:

Profiling. As most python profilers don't support threads or processes, it 
would be very convenient to have a in process executor in those cases.

--
nosy: +santagada

___
Python tracker 

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



[issue40630] tracemalloc: allow resetting peak memory metric without touching other traces

2020-05-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8b62644831443e400215eeb822c921f4f06c8977 by Huon Wilson in branch 
'master':
bpo-40630: Add tracemalloc.reset_peak (GH-20102)
https://github.com/python/cpython/commit/8b62644831443e400215eeb822c921f4f06c8977


--

___
Python tracker 

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



[issue40630] tracemalloc: allow resetting peak memory metric without touching other traces

2020-05-22 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Huon Wilson!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10 -Python 3.9

___
Python tracker 

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



[issue40725] Documentation: Benchmark table in "What's new in Python 3.9" has weird values

2020-05-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the report.

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



[issue40730] Odd sentence in 3.9 What's New

2020-05-22 Thread Eric V. Smith


New submission from Eric V. Smith :

https://docs.python.org/3.9/whatsnew/3.9.html#optimizations has this sentence: 
"Unlike to the := operator this idiom does not leak a variable to the outer 
scope.". I'm not exactly sure what it should be. Probably the first "to" should 
be deleted?

--
assignee: docs@python
components: Documentation
messages: 369607
nosy: docs@python, eric.smith
priority: normal
severity: normal
status: open
title: Odd sentence in 3.9 What's New
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



[issue40730] Odd sentence in 3.9 What's New

2020-05-22 Thread Florian Dahlitz


Florian Dahlitz  added the comment:

Hi @eric.smith. I'm sure the first "to" can be removed. It sounds better this 
way. Am I free to open a PR?

--
nosy: +DahlitzFlorian

___
Python tracker 

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



[issue40730] Odd sentence in 3.9 What's New

2020-05-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

Yes, please go ahead.

--

___
Python tracker 

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



[issue40730] Odd sentence in 3.9 What's New

2020-05-22 Thread Florian Dahlitz


Change by Florian Dahlitz :


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

___
Python tracker 

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



[issue40731] CWI url's protocol on LICENSE file from http to https

2020-05-22 Thread Vinicius Henrique Silva Bastos


New submission from Vinicius Henrique Silva Bastos :

CWI url's protocol on LICENSE file from http to https

from: http://www.cwi.nl
to: https://www.cwi.nl

Obs.: Learning about pull requests and how it works.

--
assignee: docs@python
components: Documentation
files: LICENSE
hgrepos: 388
messages: 369610
nosy: bastosvinicius, docs@python
priority: normal
severity: normal
status: open
title: CWI url's protocol on LICENSE file from http to https
type: enhancement
versions: Python 3.10
Added file: https://bugs.python.org/file49181/LICENSE

___
Python tracker 

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



[issue40731] CWI url's protocol on LICENSE file from http to https

2020-05-22 Thread Vinicius Henrique Silva Bastos


Change by Vinicius Henrique Silva Bastos :


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

___
Python tracker 

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



[issue40730] Odd sentence in 3.9 What's New

2020-05-22 Thread miss-islington


miss-islington  added the comment:


New changeset 30d5a7364db9e65ccabbdce2c20b84fe2fb233fb by Florian Dahlitz in 
branch 'master':
bpo-40730: Remove redundant 'to' (GH-20316)
https://github.com/python/cpython/commit/30d5a7364db9e65ccabbdce2c20b84fe2fb233fb


--
nosy: +miss-islington

___
Python tracker 

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



[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Mark Shannon


Mark Shannon  added the comment:

Oleksandr,
Are you saying that the current behaviour is incorrect, in the sense that it 
disagrees with the documentation?
Or are you saying that the current behaviour is undesirable?

--

___
Python tracker 

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



[issue40730] Odd sentence in 3.9 What's New

2020-05-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19587
pull_request: https://github.com/python/cpython/pull/20318

___
Python tracker 

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



[issue40730] Odd sentence in 3.9 What's New

2020-05-22 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 983b17ca1319adf9f06d5f2779a44450241eba54 by Miss Islington (bot) 
in branch '3.9':
bpo-40730: Remove redundant 'to' (GH-20316) (GH-20318)
https://github.com/python/cpython/commit/983b17ca1319adf9f06d5f2779a44450241eba54


--

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread Anthony Sottile


Anthony Sottile  added the comment:

There's current expectation in a lot of linters / code formatters that the 
*lineno and *col_offset attributes will be missing if they are not attached to 
the node

setting them to None is going to break a lot of those, if possible I'd suggest 
going back to when they were missing

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue40705] use-after-free in _zoneinfo.c's module_free function

2020-05-22 Thread Paul Ganssle


Paul Ganssle  added the comment:


New changeset 06a1b8915d6674e40f0dccc422ca2c06212392d8 by Ammar Askar in branch 
'master':
bpo-40705: Fix use-after-free in _zoneinfo's module_free (GH-20280)
https://github.com/python/cpython/commit/06a1b8915d6674e40f0dccc422ca2c06212392d8


--

___
Python tracker 

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



[issue40705] use-after-free in _zoneinfo.c's module_free function

2020-05-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +19588
pull_request: https://github.com/python/cpython/pull/20319

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40654] shutil.copyfile mutates symlink for absolute path

2020-05-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

> Changing readlink to always return the correct path was deliberate.

Understood. However, this statement assumes the "correct path" is the most 
precise path to resolve the target. If you instead define "correct path" as the 
one that would be most friendly to the user who created the path, readlink no 
longer honors that expectation. With this change, the following invariant holds 
on every platform except Python 3.8 on Windows (at least in the general case):

>>> os.symlink(x, y)
>>> assert os.readlink(y) == x

More importantly, AFAIK, Python provides no function to transform `x` into what 
one can expect as the result of `os.readlink(y)`. In other words, what value of 
`f` would make this invariant pass?

>>> os.symlink(x, y)
>>> assert os.readlink(y) == f(x)

Or put another way, is "C:\Users\jaraco\temp" an "incorrect path"?

--

___
Python tracker 

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



[issue40654] shutil.copyfile mutates symlink for absolute path

2020-05-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

> Unless you're specifically testing single steps through symlink chains, you 
> probably want to just use realpath anyway.

I do see now the references to `realpath` in the docs... and I think that 
satisfies the need I described above. It doesn't supply the `f`, but it 
provides a mechanism to resolve the ultimate file. As you say, there's still no 
regular solution for resolving intermediate links in a chain of symlinks with 
user-friendly names, but it seems like a much less severe limitation (platform 
variation).

I'll see if `realpath` satisfies the test suite needs for path pie.

--

___
Python tracker 

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



[issue40731] CWI url's protocol on LICENSE file from http to https

2020-05-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The text of the license cannot be changed without consulting with lawyers.

--
nosy: +gvanrossum, serhiy.storchaka

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> setting them to None is going to break a lot of those, if possible I'd 
> suggest going back to when they were missing

'lineno' and 'col_offset' will never be none, since both are declared as normal 
integers. But on the other hand, 'end_lineno' and 'end_col_offset' are declared 
as optional integers which would make sense to auto initalize them with *None*, 
and I dont think it would ever break some code that complies with the ASDL 
declaration.

--

___
Python tracker 

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



[issue40568] Modify -c command-line option to accept multiple inputs

2020-05-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It would be breaking change.

In addition to multiline strings you can use \n with $' on Posix:

python -c $'with open("somefile.txt") as f:\n  s = f.read()\n  print(len(s))'

Maybe there is similar feature on Windows, but in any case the command line 
interface on Windows is far from user friendly.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread David Strobach


David Strobach  added the comment:

Actually, Xonsh (http://github.com/xonsh/xonsh) tests show that keyword AST 
nodes are missing 'lineno' attribute, but that could be our fault.

--

___
Python tracker 

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



[issue39010] ProactorEventLoop raises unhandled ConnectionResetError

2020-05-22 Thread Burak Yiğit Kaya

Change by Burak Yiğit Kaya :


--
nosy: +Burak Yiğit Kaya

___
Python tracker 

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



[issue9216] FIPS support for hashlib

2020-05-22 Thread miss-islington


miss-islington  added the comment:


New changeset 909b5714e1303357868bc5e281c1cf508d5d5a17 by Christian Heimes in 
branch 'master':
bpo-9216: hashlib usedforsecurity fixes (GH-20258)
https://github.com/python/cpython/commit/909b5714e1303357868bc5e281c1cf508d5d5a17


--

___
Python tracker 

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



[issue9216] FIPS support for hashlib

2020-05-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19589
pull_request: https://github.com/python/cpython/pull/20320

___
Python tracker 

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



[issue40726] ast.Call end_lineno is defined and returns None

2020-05-22 Thread David Strobach


David Strobach  added the comment:

> Actually, Xonsh tests show that keyword AST nodes are missing 'lineno' 
> attribute, but that could be our fault.

Yes, our fault. Sorry for the noise.

--

___
Python tracker 

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



[issue40654] shutil.copyfile mutates symlink for absolute path

2020-05-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Perhaps related, I've encountered another apparent regression on Python 3.8 on 
Windows when the current working directory is in a symlink to another volume 
and one runs `setup.py develop` on a project using setuptools_scm 
(https://github.com/pypa/setuptools_scm/issues/436).

--

___
Python tracker 

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



[issue23389] pkgutil.find_loader raises an ImportError on PEP 420 implicit namespace packages

2020-05-22 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue9216] FIPS support for hashlib

2020-05-22 Thread miss-islington


miss-islington  added the comment:


New changeset a08b7c3bb0ef9da32400d23b13f78245cd7a9541 by Miss Islington (bot) 
in branch '3.9':
bpo-9216: hashlib usedforsecurity fixes (GH-20258)
https://github.com/python/cpython/commit/a08b7c3bb0ef9da32400d23b13f78245cd7a9541


--

___
Python tracker 

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



[issue23721] Set up a daily test coverage run

2020-05-22 Thread Brett Cannon


Brett Cannon  added the comment:

We have coverage after every push now at https://codecov.io/gh/python/cpython.

--

___
Python tracker 

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



[issue23738] Clarify documentation of positional-only default values

2020-05-22 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue23794] http package should support HTTP/2

2020-05-22 Thread Brett Cannon


Brett Cannon  added the comment:

And now there's https://pypi.org/project/httpcore/ which wraps h2 and h11 into 
a single, low-level API.

--

___
Python tracker 

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



  1   2   >