[issue40639] Strange behavior in changing nested dictionaries

2020-05-15 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Hi Jacob, and welcome.

You said: "I was experimenting with nested dictionaries when I came across 
strange behavior that I can not figure out at all."

This is a bug tracker, for reporting bugs, not a help desk for asking how to 
figure out Python's behaviour. Python is 30 years old and what you are calling 
"strange" has exactly how Python has worked for all that time. Sorry to tell 
you, but it is your understanding that is lacking, not a bug in the language.

I can't really tell why you think it is "strange" -- I've been using Python for 
20 years or so, and I'm not sure what you think is weird about this, it all 
seems perfectly natural to me. I'm having difficulty in seeing why you expect 
something different, sorry.

This bug tracker is not the right place to get into a long discussion about 
Python's behaviour. There are plenty of other places, like the Python-List 
mailing list, or StackOverflow, or Reddit's r/learnpython. But I *guess* that 
maybe you expect that when you call your function

input_into_nested_dict(m, y, 'hello')

that the dict `m` is copied before being passed to the function? If that's what 
you think is happening, let me assure you that no it is not. Python never 
copies data structures unless you explicitly tell it to, and specifically 
assignment does not make copies either.

So when you say `cdip = dictionary`, that doesn't make a copy of the input 
dict, it is just a new name for the original global dict.

These may help you:

https://nedbatchelder.com/text/names1.html

https://www.youtube.com/watch?v=_AEJHKGk9ns


Good luck!

--
nosy: +steven.daprano
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



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

2020-05-15 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

The attached recursive_merge.py should be much less ugly and still somewhat 
performant.

It should be the same algorithm as that PR, just written recursively rather 
than iteratively.

I got some text files from http://www.gwicks.net/dictionaries.htm and tried 
merging them line-by-line:

py -3.9 -m pyperf timeit -s "from heapq import merge; from collections import 
deque" "deque(merge(open('english.txt'), open('dutch.txt'), open('french.txt'), 
open('german.txt'), open('italian.txt')), maxlen=0)"

Mean +- std dev: 391 ms +- 9 ms

py -3.9 -m pyperf timeit -s "from recursive_merge import merge; from 
collections import deque" "deque(merge(open('english.txt'), open('dutch.txt'), 
open('french.txt'), open('german.txt'), open('italian.txt')), maxlen=0)"

Mean +- std dev: 262 ms +- 9 ms

Perhaps that's a more real-world benchmark.

--
Added file: https://bugs.python.org/file49156/recursive_merge.py

___
Python tracker 

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



[issue40622] Tests fail with python3.6 built with VS2019

2020-05-15 Thread Ned Deily


Ned Deily  added the comment:

P.S. If you *do* want to build the current HEAD of the 3.6 branch including as 
yet unreleased fixes:

git checkout 3.6

If you want to build a specific release, use the v^ tags provided for each 
release:

git checkout v3.6.8

--

___
Python tracker 

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



[issue40622] Tests fail with python3.6 built with VS2019

2020-05-15 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report.  Unfortunately, you are not actually building Python 3.6 
here.  Revision f3a5b7a is on the master branch, not 3.6. The fact that you are 
seeing a failure of test_peg_generator confirms that you are building from 
master (i.e. a pre-release of 3.9), since that test and the feature behind it 
are new in 3.9.

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



[issue40477] Python Launcher app on macOS 10.15 Catalina fails to run scripts

2020-05-15 Thread Werner

Werner  added the comment:

I believe, I found a simple way to get what you are looking for:

Open Automator and create an app.
Select »execute Shell script«
put in the editor: python3 $1

Save this as MyPythonLauncher or what you want. Test it: Drop a Python script 
on the app. It should execute without opening the Terminal (at least if it is a 
GUI-script).

If this is not clear, write me on we.hin...@gmail.com

--
Werner Hintze • Auerstraße 1 • 10249 Berlin
Tel.: +49 30 42 73 486 • Mobil: +49 160 94 68 76 60
Am 16. Mai 2020, 06:58 +0200 schrieb Ned Deily :
>
> Ned Deily  added the comment:
>
> > After your final fix, if I understood you correctly, we will no longer have 
> > to open Terminal?
>
> That's correct. That's the way the Launcher works on previous version on 
> macOS.
>
> > will it ever be possible to not have the terminal run in the future?
>
> That's the way the Launcher works. It's a very simple-minded application. 
> Essentially all it does for you is to provide an easy way from the Finder to 
> run a Python script in a terminal window, i.e. by double-clicking or by 
> drag-and-drop. Like on other Unix-based systems, Python on macOS is typically 
> used as a command line program that runs under a Unix shell in a terminal 
> window of some sort. Python itself does not provide a macOS GUI application 
> interface; that is something that IDLE does (and other third-party IDEs that 
> support Python). The Launcher app dates back to the very earliest days of Mac 
> OS X when Python for Classic MacOS (System 9) was ported over. The Launcher 
> is not really used very much as far as I can tell and its age shows with some 
> usability and even security concerns. If you are comfortable using a terminal 
> window and a Unix shell, you may find it more convenient to just run scripts 
> directly there rather than indirectly using the Launcher, e.g.
>
> $ cd Documents # or whatever Folder
> $ python3.8 your_script.py
>
> Or, to open Python in interactive mode, where you can enter statements and 
> immediately see the results:
>
> $ python3.8
>
> If you prefer a full-featured dev environment, you can use IDLE.
>
> > Is there no way to edit a previous comment?
>
> On the current bugs.python.org, no, sorry!
>
> > the Launcher Preferences window also opens when I run a script. Did I miss 
> > a setting?
>
> As far as I know, opening Preferences is a "feature" of the Launcher and 
> can't be prevented.
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue40639] Strange behavior in changing nested dictionaries

2020-05-15 Thread Jacob Underwood


New submission from Jacob Underwood :

I was experimenting with nested dictionaries when I came across strange 
behavior that I can not figure out at all. The following function, at least for 
me, has some weird behavior. Originally, it was a bit longer, but somehow it 
achieved its intended purpose in a strange way, allowing me to cut off the rest 
of the correct code and to leave only the following with the code still 
continuing to work:

My original intention was to make a function that would use the provided keys 
(in the "keys" argument of the following function) in the form of a list to use 
all but the last key in the list to get to a nested dictionary within the 
provided dictionary arg. Then, using the last key in the list, set the key to 
the information provided. Finally, the function should have returned the full 
dictionary originally provided, but with the one change within one of the 
nested dictionaries of the provided dictionary.

def input_into_nested_dict(dictionary, keys, information):
its = information
cdip = dictionary
for key in keys[:-1]:
cdip = cdip[key]
cdip[keys[-1]] = its
return dictionary

So, an example dictionary of
m = {'a':{'b':{'c':{'d':30

An example list of
y = ['a','b','c','test']

Test of
n = input_into_nested_dict(m, y, 'hello')

The strange thing is, n now correctly has
{'a': {'b': {'c': {'d': 30, 'test': 'hello'
which does not correspond to what this weird cut off function should do, as it 
should only provide
{'d': 30, 'test': 'hello'}

Furthermore, somehow this changes the global m, the dictionary provided to the 
function, making it
{'a': {'b': {'c': {'d': 30, 'test': 'hello'


(The strange variable names are left over from my original code, though 
removing them as they are now unnecessary changes the behavior again, even 
though I am pretty sure it should not (?))

Same function without the beginning variables:

def b(dictionary, keys, information):
for key in keys[:-1]:
dictionary = dictionary[key]
dictionary[keys[-1]] = information
return dictionary

Now, when ran with the same m (reset back to the original dictionary before it 
was somehow changed), y, and an n of
n = b(m, y, 'hello')
The result is now that n gets the correct dictionary it should get
{'d': 30, 'test': 'hello'}

Though, somehow m changing also continues, with it again getting
{'a': {'b': {'c': {'d': 30, 'test': 'hello'

If this makes no sense, I'm sorry I am new to Python and am not really good 
really giving this kind of information

In addition to that, this is probably not even a bug at all and I am probably 
just missing something big? If true, I'm sorry about this post...

I do not know if this happens to just me, this originally happened in 3.7.7 but 
I tried upgrading and it continued in the most recent version (3.8.3)

Thank you!

--
messages: 369008
nosy: jacob.underwood
priority: normal
severity: normal
status: open
title: Strange behavior in changing nested dictionaries
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



[issue40477] Python Launcher app on macOS 10.15 Catalina fails to run scripts

2020-05-15 Thread Ned Deily


Ned Deily  added the comment:

> After your final fix, if I understood you correctly, we will no longer have 
> to open Terminal?

That's correct. That's the way the Launcher works on previous version on macOS.

> will it ever be possible to not have the terminal run in the future?

That's the way the Launcher works. It's a very simple-minded application.  
Essentially all it does for you is to provide an easy way from the Finder to 
run a Python script in a terminal window, i.e. by double-clicking or by 
drag-and-drop. Like on other Unix-based systems, Python on macOS is typically 
used as a command line program that runs under a Unix shell in a terminal 
window of some sort.  Python itself does not provide a macOS GUI application 
interface; that is something that IDLE does (and other third-party IDEs that 
support Python). The Launcher app dates back to the very earliest days of Mac 
OS X when Python for Classic MacOS (System 9) was ported over. The Launcher is 
not really used very much as far as I can tell and its age shows with some 
usability and even security concerns. If you are comfortable using a terminal 
window and a Unix shell, you may find it more convenient to just run scripts 
directly there rather than indirectly using the Launcher, e.g.

$ cd Documents  # or whatever Folder
$ python3.8 your_script.py

Or, to open Python in interactive mode, where you can enter statements and 
immediately see the results:

$ python3.8

If you prefer a full-featured dev environment, you can use IDLE.

> Is there no way to edit a previous comment?

On the current bugs.python.org, no, sorry!

> the Launcher Preferences window also opens when I run a script.  Did I miss a 
> setting?

As far as I know, opening Preferences is a "feature" of the Launcher and can't 
be prevented.

--

___
Python tracker 

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



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

2020-05-15 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

One other issue just came to mind.  While we could convert NaN to null during 
encoding, there isn't a reasonable way to reverse the process (a null could 
either be a NaN or a legitimate None).  That would limit the utility of a new 
optional conversion.

--

___
Python tracker 

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



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

2020-05-15 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

[Eric]
> this is documented behavior

[Mark]
> I definitely wouldn't want to see nans translated to 
> "null" by default.

I concur with both of these statements.

I would support adding an option (off by default) to convert NaNs to None.  
While NaNs were originally intended to indicate an invalid value, they 
sometimes get used to denote missing values.  In those situations, it would be 
reasonable to convert NaN to null.

--
nosy: +rhettinger

___
Python tracker 

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



[issue13601] sys.stderr should be line-buffered when stderr is not a TTY

2020-05-15 Thread Shantanu


Shantanu  added the comment:

I'm wondering if this should be mentioned in Python 3.9's What's New, 
potentially at https://docs.python.org/3.9/whatsnew/3.9.html#sys ?

This change broke one of mypy's tests on 3.9 and it was a little tricky to find 
what had changed.

--
nosy: +hauntsaninja

___
Python tracker 

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



[issue40060] socket.TCP_NOTSENT_LOWAT is missing in official macOS builds

2020-05-15 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +macOS

___
Python tracker 

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



[issue40590] test_subprocess stuck on Windows, x64

2020-05-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

CI now passes.

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

___
Python tracker 

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



[issue40452] IDLE: preserve clipboard on closure on Windows

2020-05-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Please write out a manual test example (steps 1, 2, ..., N) that fails now and 
passes with the patch.

--
title: IDLE preserve clipboard on closure (Windows) -> IDLE: preserve clipboard 
on closure  on Windows
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



[issue40590] test_subprocess stuck on Windows, x64

2020-05-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

python -m test.testsubprocessing on my Win 10-64 with repository 3.9.0a6+, 
without your patch, produces

minkernel\crts\ucrt\src\appcrt\lowio\write.cpp(49) : Assertion failed: 
(_osfile(fh) & FOPEN)
minkernel\crts\ucrt\src\appcrt\lowio\close.cpp(49) : Assertion failed: 
(_osfile(fh) & FOPEN)
.minkernel\crts\ucrt\src\appcrt\lowio\close.cpp(49) : Assertion failed: 
(_osfile(fh) & FOPEN)

followed by

Ran 313 tests in 43.808s
OK (skipped=180)

Since, I presume, you are not working on Windows, I made a PR branch, 
recompiled, and reran test_subprocess.  Same result.  So I triggered a rerun in 
case the error was an oddball or in case cpython has changed.

Did not work.  Try close and re-open instead.  Appears to be working better.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue40586] Pydoc should support https for hyperlinks.

2020-05-15 Thread Shantanu


Shantanu  added the comment:

This looks like a duplicate of https://bugs.python.org/issue38786, which was 
fixed in https://github.com/python/cpython/pull/17143
That PR wasn't backported, but maybe it should be.

--
nosy: +hauntsaninja

___
Python tracker 

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



[issue40622] Tests fail with python3.6 built with VS2019

2020-05-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Runtest itself ran to completion but the 4 tests listed failed.  I suspect that 
this should be closed as "won't fix" because
A. 3.6 only gets security fixes since Dec 2018.
B. Locally built Windows binaries often fail a few tests, either occasionally 
or dependably even if the Windows buildbots are green.  Just now, test_import 
(still, or again), test__locale, and test_locale failed for me with 3.9.0a6+.  
This is unfortunate, but it is sometimes not clear whether the bug is in the 
modules or the tests.

--
components: +Windows
nosy: +ned.deily, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware
title: Using VS2019 to automatically build Python3 and Runtest and it failed to 
Runtest -> Tests fail with python3.6 built with VS2019

___
Python tracker 

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



[issue40583] Runtime type annotation mutation leads to inconsistent behavior

2020-05-15 Thread Saumitro Dasgupta


Change by Saumitro Dasgupta :


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



[issue40620] Range tutorial shorthand could be made clearer

2020-05-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This block is the same in 3.9 and 3.8.

My first though is this block is a holdover from 2.7, where range returned 
list.  But looking at what is written previously, I think your interpretation 
is correct -- and agree that something other that code and corresponding output 
in a code block is confusing.  So this might better be a list than a code 
block.  Cheryl, do you have an idea of what might be better?

--
assignee:  -> docs@python
components: +Documentation
nosy: +cheryl.sabella, docs@python, terry.reedy
stage:  -> needs patch
type:  -> behavior
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



[issue40457] Python fails to compile/load _ssl module if OpenSSL is compiled with no-tls1-method

2020-05-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19431
pull_request: https://github.com/python/cpython/pull/20126

___
Python tracker 

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



[issue40457] Python fails to compile/load _ssl module if OpenSSL is compiled with no-tls1-method

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset 6e8cda91d92da72800d891b2fc2073ecbc134d98 by Christian Heimes in 
branch 'master':
bpo-40457: Support OpenSSL without TLS 1.0/1.1 (GH-19862)
https://github.com/python/cpython/commit/6e8cda91d92da72800d891b2fc2073ecbc134d98


--
nosy: +miss-islington

___
Python tracker 

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



[issue40605] «python»: Aucun fichier ou dossier de ce type

2020-05-15 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
type: crash -> behavior

___
Python tracker 

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



[issue39075] types.SimpleNamespace should preserve attribute ordering (?)

2020-05-15 Thread Eric Snow


Change by Eric Snow :


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



[issue40605] «python»: Aucun fichier ou dossier de ce type

2020-05-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Titles should be in English (translated if quoting output).  I am closing 
because there is no indication that there is a bug in Python, as opposed to a 
misunderstanding of how to use it.

Extended help discussion is better conducted on python-list.  For one thing, 
discussion there is seen by many more people. 

Isa: traditionally, on *nix, 'python' ran Python2 and 'python3' has been used 
to run Python3.  Sometimes 'python2' has also been used.  Different Linux 
distributions distributions disagree about whether and when to make 'python' 
run Python3.  I believe that you can make this happen for your login, but it 
might disable other programs, especially things provided by Ubuntu.  So it is 
probably best if you write a shell script that makes the change temporarily.  
Since this is going to be a common problem, please ask a question on 
python-list.  Suggestion:
---

(Subject) Make 'python' run Python 3.8 on Ubuntu

I want to run a program on Ubuntu 20.04 that expects 'python' to run Python 3 
instead of Python 2.  How can I do this without disabling other programs that 
expect the opposite?

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



[issue39075] types.SimpleNamespace should preserve attribute ordering (?)

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset 6b6092f533f0e4787b8564c4fad6ec6d1018af0d by Zackery Spytz in 
branch 'master':
bpo-39075: types.SimpleNamespace no longer sorts attributes in its repr 
(GH-19430)
https://github.com/python/cpython/commit/6b6092f533f0e4787b8564c4fad6ec6d1018af0d


--
nosy: +miss-islington

___
Python tracker 

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



[issue40600] Add option to disallow > 1 instance of an extension module

2020-05-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Title clarified.  Leaving subinterpreters aside, only one instance, AFAIK, is 
true for stdlib and python modules unless imported with different names, as can 
happen with main module (which is a nuisance if not a bug).  So only once per 
interpreter seems like a bugfix.  Only once per process, if once per 
interpreter otherwise becomes normal, seems like an enhancement, even if a 
necessary option.

--
nosy: +terry.reedy
stage:  -> test needed
title: Add an option to disallow creating more than one instance of a module -> 
Add option to disallow > 1 instance of an extension module

___
Python tracker 

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



[issue31033] Add argument to .cancel() of Task and Future

2020-05-15 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

I just want to flag one issue after rebasing my traceback PR onto what was 
merged. If task.cancel() is called like this--

task.cancel("POSSIBLY LONG CANCEL MESSAGE")

There is the question of whether the passed message should be repeated each 
time the CancelledError is raised, or only show it in the innermost, 
originating exception. My preference is to do the latter because it is simpler, 
less verbose, and seems more correct from a Python perspective. But I wanted to 
flag this because the message won't be visible in the leading, outermost 
exception.

There is a third alternative which is to mutate the exception each time (delete 
the message from the earlier exception and add it to the new exception). But 
that seems more fraught and what I'd consider surprising behavior.

Lastly, to illustrate, here is the more verbose option (the one I think it 
**shouldn't** look like):

Traceback (most recent call last):
  File "/.../cpython/test-cancel.py", line 4, in nested
await asyncio.sleep(1)
  File "/.../cpython/Lib/asyncio/tasks.py", line 670, in sleep
return await future
asyncio.exceptions.CancelledError: POSSIBLY LONG CANCEL MESSAGE

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/.../cpython/test-cancel.py", line 11, in run
await task
asyncio.exceptions.CancelledError: POSSIBLY LONG CANCEL MESSAGE

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/.../cpython/test-cancel.py", line 15, in 
loop.run_until_complete(run())
  File "/.../cpython/Lib/asyncio/base_events.py", line 642, in 
run_until_complete
return future.result()
asyncio.exceptions.CancelledError: POSSIBLY LONG CANCEL MESSAGE

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



[issue40587] [regression] inspect.getdoc not returning docstring.

2020-05-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This change was part of #40257 and is being discussed there (where I suggested 
reverting it).

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



[issue40586] Pydoc should support https for hyperlinks.

2020-05-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Agreed. pydoc is a library module.  3.5 and 3.6 only get security patches.

--
components: +Library (Lib) -Demos and Tools
nosy: +serhiy.storchaka, terry.reedy

___
Python tracker 

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



[issue40586] Pydoc should support https for hyperlinks.

2020-05-15 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue40257] Improve the use of __doc__ in pydoc

2020-05-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Whether or not an object has a docstring is implementation defined, and I do 
not consider it to be part of its API.  I just backported some new docstrings 
(with Brett Cannon's concurrence), and I would consider it OK for Serhiy to do 
the same with his addition.

But the return value of getdoc is half of its API.  Its 3.8 doc says
"If the documentation string for an object is not provided and the object is a 
class, a method, a property or a descriptor, retrieve the documentation string 
from the inheritance hierarchy.

Changed in version 3.5: Documentation strings are now inherited if not 
overridden."

While inherited class docstrings are sometimes inapplicable, they may not be.  
In any case, not doing so is an API change.  If done, and this is obviously 
controversial, the change needs a deprecation period.  I would say at least 2 
releases.  And this should be a separate issue.  But I suggest leaving getdoc 
alone.  I think it appropriate that it be a bit liberal in returning text that 
just might be useful.

Changing what pydoc does with the information it gets, including from getdoc, 
is a different issue -- this issue.  Pydoc could not call getdoc for classes, 
or it could determine whether the returned string is inherited and change it 
slightly as has been suggested.

Other object information functions can make their own choices. For instance, 
IDLE calltips are primarily about signature and currently only use an object's 
own docstring.  But maybe pydoc should be used for instance methods to get the 
one or two summary lines IDLE displays.

A related note: Useful specific docstrings would be easier if an object could 
directly extend a base objects docstring with
  f"{base_object.__doc__}\nExtra implementation info\n"
following the header instead of having to later write
  derived_object.__doc__ = f"".

In instructional contexts, this would be useful, in addition for classes, for 
functions that implement a docstring specificaton.
  def _factor(number):
"Return prime factors of non-negative ints as list of (prime, count) pairs."
Students could then submit an implementation with 
  def factor(number):
f"{_factor.__doc__}\nImplementation details."


--
nosy: +terry.reedy

___
Python tracker 

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



[issue40635] Documentation for socket.getfqdn incorrect?

2020-05-15 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +christian.heimes

___
Python tracker 

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



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

2020-05-15 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

The nested generators approach looks promising. I hope you keep working on that 
:-)

I'm not too keen on PR 18427 because it is a massive explosion in code volume 
and complexity.

With some continued effort, I expect we'll get to something much simpler and 
more maintainable.  The existing code already performs well for typical 
applications, so there is no need to "go gonzo" and throw a massive wall of 
code at the problem.  The ensuing maintenance costs would be too high.

To save time and effort, please hold-off on a C implementation until we've 
agreed to a pure python version of the algorithm.

For timings, try using strings, tuples, or dataclass instances.  Timing integer 
inputs isn't representative of how merge() is used and it tends to exaggerate 
improvements.  For interesting merges, the dominant cost is the comparison step.

By switching to a binary tree arrangement, the payoff we're aiming for is to 
avoid the double comparison in the tuple inequality logic — "('a',1)<('b',2)" 
tests both 'a'=='b' and 'a'<='b'.  I suggest aiming for the simplest possible 
code that avoids the double test.

--

___
Python tracker 

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



[issue31033] Add argument to .cancel() of Task and Future

2020-05-15 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

The msg argument has now been added (second PR). I'm going to keep this issue 
open until the traceback issue has also been addressed (the other PR), as that 
was one part of the discussions here.

--

___
Python tracker 

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



[issue31033] Add argument to .cancel() of Task and Future

2020-05-15 Thread Chris Jerdonek


Chris Jerdonek  added the comment:


New changeset 1ce5841eca6d96b1b1e8c213d04f2e92b1619bb5 by Chris Jerdonek in 
branch 'master':
bpo-31033: Add a msg argument to Future.cancel() and Task.cancel() (GH-19979)
https://github.com/python/cpython/commit/1ce5841eca6d96b1b1e8c213d04f2e92b1619bb5


--

___
Python tracker 

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



[issue40583] Runtime type annotation mutation leads to inconsistent behavior

2020-05-15 Thread Saumitro Dasgupta


Saumitro Dasgupta  added the comment:

Fair enough. If that's the consensus, I'll close the issue.

--

___
Python tracker 

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



[issue40583] Runtime type annotation mutation leads to inconsistent behavior

2020-05-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

Perhaps it should be better documented. I don't see the behavior changing.

--

___
Python tracker 

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



[issue40583] Runtime type annotation mutation leads to inconsistent behavior

2020-05-15 Thread Saumitro Dasgupta


Saumitro Dasgupta  added the comment:

I'd argue that the situation is a bit different from class variables here, 
since __annotations__ is indirectly brought into existence by the presence of 
statically-established type annotations. You can be perfectly aware of how 
class variables work yet find this surprising, since you'd have to be aware of 
the additional bit of detail pointed out by Ivan above.

--

___
Python tracker 

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



[issue40583] Runtime type annotation mutation leads to inconsistent behavior

2020-05-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

But this is no different from every other mutable class variable in Python:

class Base:
data = {}

class Alpha(Base):
pass

class Beta(Base):
data = {}

Alpha.data['injected'] = bool
assert Alpha.data is Base.data

Beta.data['injected'] = bool

I'm not sure what could change here. The choices seem to be break a lot of 
existing code and have new behavior for all class variables, or do something 
special for __annotations__.

In general, to get what you want, you'd need to do something like this (going 
back to your original example):

def add_annotation(cls, v, t):
if not "__annotations__" in cls.__dict__:
# Doesn't exist, add it.
cls.__annotations__ = {}
cls.__annotations__[v] = t

add_annotation(Base, 'a', int)
add_annotation(Alpha,'a',  float)
add_annotation(Beta, 'a', str)

Which produces:
{'base': , 'a': }
{'a': }
{'foobar': , 'a': }

Again, this is just how class variables work in Python.

--

___
Python tracker 

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



[issue40638] input() with malformed input stream triggers assertion failure

2020-05-15 Thread Maxwell Bernstein


Change by Maxwell Bernstein :


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

___
Python tracker 

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



[issue40638] input() with malformed input stream triggers assertion failure

2020-05-15 Thread Maxwell Bernstein


New submission from Maxwell Bernstein :

builtin_input_impl does multiple attribute lookups in a row assuming they will 
succeed, but part of attribute lookup assumes that there is no pending 
exception.

I propose doing the lookups one by one and checking for an error after each. 
There is an upcoming patch.

--
components: Interpreter Core, Library (Lib)
messages: 368982
nosy: tekknolagi
priority: normal
severity: normal
status: open
title: input() with malformed input stream triggers assertion failure
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



[issue40637] Allow users to disable builtin hash modules on compile time

2020-05-15 Thread Christian Heimes


Change by Christian Heimes :


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



[issue40637] Allow users to disable builtin hash modules on compile time

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset 9b60e55db2897acc30d6b9ef1dbc49674eed40c7 by Christian Heimes in 
branch 'master':
bpo-40637: Add option to disable builtin hashes (GH-20121)
https://github.com/python/cpython/commit/9b60e55db2897acc30d6b9ef1dbc49674eed40c7


--
nosy: +miss-islington

___
Python tracker 

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



[issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset c3d025a86a60348f19551bd9921304c5db322531 by Miss Islington (bot) 
in branch '3.8':
bpo-40636: Clarify the zip built-in docstring. (GH-20118)
https://github.com/python/cpython/commit/c3d025a86a60348f19551bd9921304c5db322531


--

___
Python tracker 

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



[issue40583] Runtime type annotation mutation leads to inconsistent behavior

2020-05-15 Thread Saumitro Dasgupta


Saumitro Dasgupta  added the comment:

In my opinion, the main problem here is the element of surprise. Given a 
statement like this:

foo.__annotations__['injected'] = bool

the expressed intent is "extend this object's annotations". It's surprising 
that it can sometimes result in accidental mutation of the base's annotations. 
This surprise may manifest downstream in other parts of the standard library 
(like dataclasses in the example above), which can be a bit cryptic.

As a performance optimization, it makes sense. However, the element of surprise 
probably can be improved upon. For instance:

- Explicitly disallow accidental mutation by presenting the parent's dict via a 
MappingProxy
- Use a "copy-on-write" mechanism

--

___
Python tracker 

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



[issue40445] compileall.compile_dir docs aren't updated for bpo-38112

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset a2b3cdd661a4b6c6c74adbfcb6ac1865bfd2a011 by Shantanu in branch 
'master':
bpo-40445: Update compileall.compile_dir docs (GH-19806)
https://github.com/python/cpython/commit/a2b3cdd661a4b6c6c74adbfcb6ac1865bfd2a011


--
nosy: +miss-islington

___
Python tracker 

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



[issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs

2020-05-15 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs

2020-05-15 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 6a5d3ff67644af42b1a781be2eacb2e82913441c by Gregory P. Smith in 
branch 'master':
bpo-40636: Clarify the zip built-in docstring. (GH-20118)
https://github.com/python/cpython/commit/6a5d3ff67644af42b1a781be2eacb2e82913441c


--

___
Python tracker 

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



[issue40495] compileall: option to hardlink duplicate optimization levels bytecode cache files

2020-05-15 Thread Shantanu


Change by Shantanu :


--
nosy: +hauntsaninja
nosy_count: 6.0 -> 7.0
pull_requests: +19428
pull_request: https://github.com/python/cpython/pull/19806

___
Python tracker 

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



[issue40583] Runtime type annotation mutation leads to inconsistent behavior

2020-05-15 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

This is actually a specified behavior (motivated by memory savings for class 
objects, that are already pretty large). If you scroll down the link you posted 
it says:

> Note that if annotations are not found statically, then the 
> ``__annotations__`` dictionary is not created at all.


So what do you propose? Changing this behavior is not easy, because it would be 
a backwards incompatible change.

--
nosy: +levkivskyi

___
Python tracker 

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



[issue40163] multissl doesn't support tarballs in /source/old/

2020-05-15 Thread Christian Heimes


Change by Christian Heimes :


--
resolution:  -> fixed
stage: backport needed -> 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



[issue40606] Copy property return annotations to __annotations__

2020-05-15 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue40632] AttributeError: type object 'Callable' has no attribute '_abc_registry'

2020-05-15 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

I think a better question is why the `typing` in site packages is ever 
imported? I thought that an stdlib module always takes precedence over an 
installed one with the same name.

--
nosy: +levkivskyi

___
Python tracker 

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



[issue40163] multissl doesn't support tarballs in /source/old/

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset 7a89f9b4e2c05a6abdf59e8a96a1fc80a47a1144 by Miss Islington (bot) 
in branch '3.7':
bpo-40163: Fix multissltest download of old OpenSSL (GH-19329)
https://github.com/python/cpython/commit/7a89f9b4e2c05a6abdf59e8a96a1fc80a47a1144


--

___
Python tracker 

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



[issue40163] multissl doesn't support tarballs in /source/old/

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset fcea08059f46d2d9582bb7ce5b2e905b20b86e8e by Miss Islington (bot) 
in branch '3.8':
bpo-40163: Fix multissltest download of old OpenSSL (GH-19329)
https://github.com/python/cpython/commit/fcea08059f46d2d9582bb7ce5b2e905b20b86e8e


--

___
Python tracker 

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



[issue40595] AttributeError from type annotation

2020-05-15 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Yes, this is as expected. A recommended workaround is to define a type alias 
like `Match = re.Match` before the class body. You can also suppress the 
exception with `from __future__ import annotations` (so that the annotations 
are not evaluated), but static type checkers like mypy will still force you to 
use the alias.

--
nosy: +levkivskyi
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



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-15 Thread Christian Heimes


Christian Heimes  added the comment:

Users will now get an error message when they are trying to compile against an 
OpenSSL build without thread support.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-15 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset efc9065904c4df8962e04303c2c03642f45019b5 by Christian Heimes in 
branch '3.7':
[3.7] bpo-40515: Require OPENSSL_THREADS (GH-19953) (GH-20120)
https://github.com/python/cpython/commit/efc9065904c4df8962e04303c2c03642f45019b5


--

___
Python tracker 

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



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-15 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 387c7441f589cc45ea86f1fa257af616c39d9a4b by Christian Heimes in 
branch '3.8':
[3.8] bpo-40515: Require OPENSSL_THREADS (GH-19953) (GH-20119)
https://github.com/python/cpython/commit/387c7441f589cc45ea86f1fa257af616c39d9a4b


--

___
Python tracker 

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



[issue40163] multissl doesn't support tarballs in /source/old/

2020-05-15 Thread Christian Heimes


Change by Christian Heimes :


--
stage: patch review -> backport needed
versions:  -Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue40163] multissl doesn't support tarballs in /source/old/

2020-05-15 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40163] multissl doesn't support tarballs in /source/old/

2020-05-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19427
pull_request: https://github.com/python/cpython/pull/20123

___
Python tracker 

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



[issue40163] multissl doesn't support tarballs in /source/old/

2020-05-15 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 938717fd04c53c717895a756d5910e8c8813706c by Christian Heimes in 
branch 'master':
bpo-40163: Fix multissltest download of old OpenSSL (GH-19329)
https://github.com/python/cpython/commit/938717fd04c53c717895a756d5910e8c8813706c


--

___
Python tracker 

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



[issue40607] asyncio.wait_for should reraise future exception even if timeout expires

2020-05-15 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 382a5635bd10c237c3e23e346b21cde27e48d7fa by romasku in branch 
'master':
bpo-40607: Reraise exception during task cancelation in asyncio.wait_for() 
(GH-20054)
https://github.com/python/cpython/commit/382a5635bd10c237c3e23e346b21cde27e48d7fa


--

___
Python tracker 

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



[issue40637] Allow users to disable builtin hash modules on compile time

2020-05-15 Thread Christian Heimes


Change by Christian Heimes :


--
keywords: +patch
pull_requests: +19425
pull_request: https://github.com/python/cpython/pull/20121

___
Python tracker 

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



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-15 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +19424
pull_request: https://github.com/python/cpython/pull/20120

___
Python tracker 

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



[issue40637] Allow users to disable builtin hash modules on compile time

2020-05-15 Thread Christian Heimes


New submission from Christian Heimes :

Python has a couple of builtin hash module: md5, sha1, sha256/224, sha512/383, 
sha3/shake family, and blake2b/s. Most of them are used as fallbacks in case 
OpenSSL bindings are not available.

In some scenarios it is useful or required to disable the custom 
implementations and only offer libcrypto based implementations. Let's add a 
build option to disable modules.

--
assignee: christian.heimes
components: Build
messages: 368966
nosy: christian.heimes
priority: normal
severity: normal
stage: patch review
status: open
title: Allow users to disable builtin hash modules on compile time
type: enhancement
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



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-15 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +19423
pull_request: https://github.com/python/cpython/pull/20119

___
Python tracker 

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



[issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs

2020-05-15 Thread Gregory P. Smith


New submission from Gregory P. Smith :

PEP 618 https://www.python.org/dev/peps/pep-0618 discussions are still on 
going.  This issue is being filed to track an implementation, assuming the PEP 
is accepted and one is decided upon.

I'm filing it now, as I can at least use the issue for documentation 
enhancements of the existing zip() behavior.

--
messages: 368965
nosy: brandtbucher, gregory.p.smith, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: Provide a strict form of zip (PEP-618) requiring same length inputs
type: enhancement
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



[issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs

2020-05-15 Thread Gregory P. Smith


Change by Gregory P. Smith :


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

___
Python tracker 

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



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset c087a268a4d4ead8ef2ca21e325423818729da89 by Christian Heimes in 
branch 'master':
bpo-40515: Require OPENSSL_THREADS (GH-19953)
https://github.com/python/cpython/commit/c087a268a4d4ead8ef2ca21e325423818729da89


--
nosy: +miss-islington

___
Python tracker 

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



[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-05-15 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +19421
pull_request: https://github.com/python/cpython/pull/20117

___
Python tracker 

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



[issue36264] os.path.expanduser should not use HOME on windows

2020-05-15 Thread Eryk Sun


Eryk Sun  added the comment:

> set "HOME" to override a location derived from ~

Using HOME in Windows is not reliable because it is not a system environment 
variable. That makes it fair game for administrators, users, and applications 
to use however they like.

Platform differences can be papered over with functions. For example, add 
set_user_home(dir) and get_user_home(name=''). set_user_home sets a private 
global variable named _user_home, which defaults to None. get_user_home returns 
_user_home if it's not None and name is an empty string. Otherwise it gets the 
home directory per platform rules.

> If on Windows and Python 3.8 or later, set USERPROFILE to the 
> target directory. 

This is unfortunate. Modifying USERPROFILE is highly unusual. USERPROFILE is 
the location of the user's "NTUSER.DAT" registry hive and local application 
data ("AppData\Local"), including "UsrClass.dat" (the "Software\Classes" 
registry hive). It's also the default location for a user's known shell folders 
and home directory. Modifying USERPROFILE shouldn't cause problems with any of 
this, but I'm not completely at ease with it.

If a user profile defines a custom home directory (e.g. net user  
/homedir:), it will be reflected in "%HOMEDRIVE%%HOMEPATH%", and not in 
USERPROFILE. In a more perfect world, in which no one ever depended on the 
default location of shell folders, I'd recommend flipping the order around in 
ntpath.expanduser to prefer "%HOMEDRIVE%%HOMEPATH%". 

That said, a major snag with HOMEDRIVE and HOMEPATH is that they're sometimes 
wrong or missing. CreateEnvironmentBlock() will enumerate but won't populate 
the user's "Volatile Environment" registry key, which is where HOMEDRIVE and 
HOMEPATH are normally set. This key gets populated during startup of a desktop 
session, and, since it's volatile, it gets deleted when the profile is unloaded 
(i.e. the user logs off). Consequently the Secondary Logon service (i.e. 
CreateProcessWithLogonW), which runas.exe uses, will only set the correct 
HOMEDRIVE and HOMEPATH values if the user is already logged on as a desktop 
session user. Otherwise it uses a default value of "%SystemRoot%\System32" as 
the home directory, which is spectacularly wrong. Similarly, a scheduled task 
that uses an S4U batch logon won't even have HOMEDRIVE and HOMEPATH defined if 
the task user isn't already logged on as a desktop session user. USERPROFILE 
will still be correct in these cases.

> Windows is posix-compliant. What you probably mean here is "Unix".

The Windows subsystem has never been POSIX compliant. At most, Microsoft's C 
runtime library provides rudimentary POSIX API support (e.g. open, read). 

On the other hand, NT's original POSIX subsystem (psxss.exe) was POSIX.1 (1990) 
compliant. In 1999, Microsoft purchased the more capable OpenNT Unix system 
from Softway Systems and rebranded it as Interix. In Server 2003 R2, Interix 
was integrated in NT as the Subsystem for UNIX-based Applications (SUA). It was 
removed in Server 2012 R2. Microsoft abandoned the old conception of an NT 
subsystem in favor of virtualization concepts such as pico processes and pico 
providers (WSL 1) or hosting a kernel in a light-weight VM (WSL 2).

--

___
Python tracker 

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



[issue40479] Port _hashlib to OpenSSL 3.0.0

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset 5a06cf01ecb6a048fb47c086adc1336f54fe8789 by Miss Islington (bot) 
in branch '3.8':
bpo-40479: Test with latest OpenSSL versions (GH-20108)
https://github.com/python/cpython/commit/5a06cf01ecb6a048fb47c086adc1336f54fe8789


--

___
Python tracker 

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



[issue24416] Have date.isocalendar() return a structseq instance

2020-05-15 Thread Paul Ganssle


Change by Paul Ganssle :


--
pull_requests: +19420
pull_request: https://github.com/python/cpython/pull/20113

___
Python tracker 

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



[issue40479] Port _hashlib to OpenSSL 3.0.0

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset 5e6b491403d7211588dcd399167f5bc21781c69c by Miss Islington (bot) 
in branch '3.7':
bpo-40479: Test with latest OpenSSL versions (GH-20108)
https://github.com/python/cpython/commit/5e6b491403d7211588dcd399167f5bc21781c69c


--

___
Python tracker 

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



[issue40635] Documentation for socket.getfqdn incorrect?

2020-05-15 Thread Chris Herdt


New submission from Chris Herdt :

The documentation for socket.getfqdn() includes this info:

"In case no fully qualified domain name is available, the hostname as returned 
by gethostname() is returned."

However, that does not appear to be correct. To reproduce a case that exhibits 
contrary behavior:

>>> import socket
>>> socket.getfqdn("test")
'test'
>>> socket.gethostname()
'centos7minimal.osric.net'

--
assignee: docs@python
components: Documentation
messages: 368960
nosy: cherdt, docs@python
priority: normal
severity: normal
status: open
title: Documentation for socket.getfqdn incorrect?
versions: Python 3.6

___
Python tracker 

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



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

2020-05-15 Thread Mark Dickinson


Mark Dickinson  added the comment:

I don't think "null" in JSON is supposed to represent "Not a Number"; it's 
closer in meaning to Python's `None`. I definitely wouldn't want to see nans 
translated to "null" by default.

This also only seems to address a part of the issue: what's the proposed action 
for "Infinity" and "-Infinity"? We've written internal code to deal with float 
special values in JSON a few times (usually to work with databases that stick 
to the strict JSON definition), and that code has to find a way to deal with 
all three of the special values.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue40479] Port _hashlib to OpenSSL 3.0.0

2020-05-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19419
pull_request: https://github.com/python/cpython/pull/20112

___
Python tracker 

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



[issue40479] Port _hashlib to OpenSSL 3.0.0

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset 62d618c06bd395308b7163dbcb26c7e6d0922033 by Christian Heimes in 
branch 'master':
bpo-40479: Test with latest OpenSSL versions (GH-20108)
https://github.com/python/cpython/commit/62d618c06bd395308b7163dbcb26c7e6d0922033


--

___
Python tracker 

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



[issue40479] Port _hashlib to OpenSSL 3.0.0

2020-05-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19418
pull_request: https://github.com/python/cpython/pull/20111

___
Python tracker 

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



[issue40479] Port _hashlib to OpenSSL 3.0.0

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset 16d4e6f6f559b4fd21c9d29fea303489f658674f by Christian Heimes in 
branch 'master':
bpo-40479: Fix hashlib issue with OpenSSL 3.0.0 (GH-20107)
https://github.com/python/cpython/commit/16d4e6f6f559b4fd21c9d29fea303489f658674f


--
nosy: +miss-islington

___
Python tracker 

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



[issue40055] test___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset 4e6545b002dd4d068b2538ffca60830d0e7fd369 by Miss Islington (bot) 
in branch '3.8':
bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095)
https://github.com/python/cpython/commit/4e6545b002dd4d068b2538ffca60830d0e7fd369


--

___
Python tracker 

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



[issue40055] test___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset 7ef275160953f00b4303149df6d919c0afe763cb by Miss Islington (bot) 
in branch '3.7':
bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095)
https://github.com/python/cpython/commit/7ef275160953f00b4303149df6d919c0afe763cb


--

___
Python tracker 

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



[issue40055] test___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning

2020-05-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19417
pull_request: https://github.com/python/cpython/pull/20110

___
Python tracker 

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



[issue40055] test___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning

2020-05-15 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40055] test___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning

2020-05-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6e57237faf0da8904e0130a11350cae3c5062b82 by Victor Stinner in 
branch 'master':
bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095)
https://github.com/python/cpython/commit/6e57237faf0da8904e0130a11350cae3c5062b82


--

___
Python tracker 

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



[issue40479] Port _hashlib to OpenSSL 3.0.0

2020-05-15 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +19415
pull_request: https://github.com/python/cpython/pull/20108

___
Python tracker 

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



[issue40479] Port _hashlib to OpenSSL 3.0.0

2020-05-15 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +19414
pull_request: https://github.com/python/cpython/pull/20107

___
Python tracker 

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



[issue40634] Ignored "BlockingIOError: [Errno 11] Resource temporarily unavailable" are still haunting us

2020-05-15 Thread Yaroslav Halchenko


New submission from Yaroslav Halchenko :

This is a reincarnation of previous issues such as 

- older https://bugs.python.org/issue21595 which partially (with ack on that) 
addressed the issue awhile back
- more recent https://bugs.python.org/issue38104 which was closed as "wont fix" 
since "the provided example finishes without any warning" on 3.8 (verified -- 
true for me with 3.8.3rc1); and with the explanation that "You spawn too many 
subprocesses that finish virtually at the same time. It leads to wakeup_fd 
overrun."
- additional similar reports could be found online, e.g. 
https://stackoverflow.com/a/52391791/1265472 .

In our project we are slowly introducing use of asyncio and have a mix of 
execution with asyncio and regular subprocess.Popen.  We do run lots of short 
lived processes serially, and I think it should be Ok, i.e. it should not cause 
underlying libraries to spit out some output to ignore unless we indeed just 
using them incorrectly somehow.

If we recreate the SelectorEventLoop for every separate execution via asyncio 
-- no ignored exception messages are displayed.  But if we start to reuse the 
same loop -- they eventually emerge.  If I enable asyncio debug and log it 
along with our own debug messages, the strange thing that they come around the 
points where we run using regular subprocess.Popen, not asyncio. See 
https://github.com/datalad/datalad/pull/4527#issuecomment-629289819 for more 
information.

Unfortunately I do not have (yet) any short script to reproduce it, but I would 
appreciate possible hints on how to figure out what is actually causing them in 
our particular case.  May be additional logging within asyncio could assist?

--
components: asyncio
messages: 368953
nosy: Yaroslav.Halchenko, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Ignored "BlockingIOError: [Errno 11] Resource temporarily unavailable" 
are still haunting us
versions: 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



[issue39837] Make Azure Pipelines optional on GitHub PRs

2020-05-15 Thread STINNER Victor


STINNER Victor  added the comment:

> Oh, and Victor, you should probably email python-dev to let everyone know you 
> requested this change and it's been made. Otherwise people may be surprised 
> that it changed without any discussion or notification.

I wanted to wait until the situation was being clarified. I fixed the 
"documentation only" issue in GitHub Action workflow. I sent an email to 
python-committers rather than python-dev, core devs are the first concerned by 
workflow changes:

https://mail.python.org/archives/list/python-committ...@python.org/thread/B6WVI254L7GEOCKUOHZ6XBZD4GCLAIBV/

Slowly, it seems like the situation is being resolved.

--

___
Python tracker 

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



[issue22652] Add suggestion about keyword arguments to this error message: "builtins.TypeError: my_func() takes 1 positional argument but 2 were given"

2020-05-15 Thread A. Jesse Jiryu Davis


A. Jesse Jiryu Davis  added the comment:

If the patch requires a rewrite and its value is uncertain then I'll excuse 
myself from this issue.

--

___
Python tracker 

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



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

2020-05-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think that's reasonable, although I could see someone objecting ("just use 
simplejson instead").

I suggest discussing this on the python-ideas mailing list and see what people 
think over there. It might help to create a PR first, if it's not a lot of work.

--
type: behavior -> enhancement
versions: +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



[issue40632] AttributeError: type object 'Callable' has no attribute '_abc_registry'

2020-05-15 Thread Дилян Палаузов

Дилян Палаузов  added the comment:

I used python 3.6, I exported all dependencies with `pip list`, then upgraded 
to python 3.8 and imported the exported dependencies.

Uninstalling the “typing” module has helped.

Do you mean, that python 3.8 includes the “typing” modules, so that it may not 
be re-installed over pip?

Why pip does not prevent the user from installing the “typing” modules on 
python 3.8?

--

___
Python tracker 

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



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

2020-05-15 Thread Haoyu SUN


Haoyu SUN  added the comment:

Thank you for the timely reply, Eric.

How about we add an optional argument (like the argument "ignore_nan" defaults 
to False as the package simplejson does) to functions like json.dumps(). So 
that user can choose whether he needs NaN encoded as NaN or null, meanwhile the 
default behavior stays the same.

In chromium based browsers, the function JSON.parse cannot parse it correctly. 
Here is an example below:
> JSON.parse('{"a": null, "b": NaN}')
uncaught SyntaxError: Unexpected token N in JSON at position 17
at JSON.parse ()
at :1:6

--

___
Python tracker 

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



[issue40192] time.thread_time isn't outputting in nanoseconds in AIX

2020-05-15 Thread STINNER Victor


STINNER Victor  added the comment:

time.thread_time() is documented as:
"Return the value (in fractional seconds) of the sum of the system and user CPU 
time of the current thread. It does not include time elapsed during sleep."
https://docs.python.org/dev/library/time.html#time.thread_time

So we must use utime+stime, just not stime (current PR 19381 implementation).

test_time.test_thread_time() validates that time.thread_time() doesn't include 
time spend during a sleep.

--

___
Python tracker 

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



[issue25920] PyOS_AfterFork should reset socketmodule's lock

2020-05-15 Thread Hugh Redelmeier


Change by Hugh Redelmeier :


--
nosy: +hugh

___
Python tracker 

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



[issue40192] time.thread_time isn't outputting in nanoseconds in AIX

2020-05-15 Thread STINNER Victor


STINNER Victor  added the comment:

I found this documentation on AIX thread_cputime():
https://www.ibm.com/support/knowledgecenter/ssw_aix_71/t_bostechref/thread_cputime.html

"""
Syntax

#include 
int thread_cputime (tid, ctime)
tid_t tid;
thread_cputime_t * ctime ;
typedef struct {
uint64_t utime; /* User time in nanosenconds */
uint64_t stime; /* System time in nanoseconds */
} thread_cputime_t;

Description

The thread_cputime subroutine allows a thread to query the CPU usage of the 
specified thread (tid) in the same process or in another process. If a value of 
-1 is passed in the tid parameter field, then the CPU usage of the calling 
thread is retrieved.

CPU usage is not the same as the total life of the thread in real time, rather 
it is the actual amount of CPU time consumed by the thread since it was 
created. The CPU usage retrieved by this subroutine contains the CPU time 
consumed by the requested thread tid in user space (utime) and system space 
(stime).

The thread to be queried is identified using the kernel thread ID which has 
global scope. This can be obtained by the application using the thread_self 
system call. Only 1:1 thread mode is supported. The result for M:N thread mode 
is undefined.

The CPU usage of a thread that is not the calling thread will be current as of 
the last time the thread was dispatched. This value will be off by a small 
amount if the target thread is currently running.
"""

Ok good, it returns the user time *and* the system time, and it's the thread 
CPU time.

So it sounds reasonable to use it to implement time.thread_time().

By the way, the v8 project calls thread_cputime() on AIX when 
clock_gettime(CLOCK_THREAD_CPUTIME_ID) is requested, also to get better 
resolution:
https://github.com/v8/v8/blob/a5038c42283a09f65c44229907123e15a779feb7/src/base/platform/time.cc#L68

// On AIX clock_gettime for CLOCK_THREAD_CPUTIME_ID outputs time with
// resolution of 10ms. thread_cputime API provides the time in ns
#if defined(V8_OS_AIX)
  thread_cputime_t tc;
  if (clk_id == CLOCK_THREAD_CPUTIME_ID) {
#if defined(__PASE__)  // CLOCK_THREAD_CPUTIME_ID clock not supported on IBMi
return 0;
#endif
if (thread_cputime(-1, ) != 0) {
  UNREACHABLE();
}
  }
#endif

Another question is why AIX doesn't use thread_cputime() internally to 
implement clock_gettime(CLOCK_THREAD_CPUTIME_ID) :-)

--

___
Python tracker 

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



[issue40192] time.thread_time isn't outputting in nanoseconds in AIX

2020-05-15 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

current:
>>> import time
>>> import time
>>> time.get_clock_info('thread_time')
namespace(adjustable=False, 
implementation='clock_gettime(CLOCK_THREAD_CPUTIME_ID)', monotonic=True, 
resolution=0.01)
>>> time.thread_time()
0.07

PR 19381:
>>> import time
>>> time.get_clock_info('thread_time')
namespace(adjustable=False, implementation='thread_cputime()', monotonic=True, 
resolution=1e-09)
>>> time.thread_time()
0.002379953

--

___
Python tracker 

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



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

2020-05-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

Since this is documented behavior 
(https://docs.python.org/3.8/library/json.html#infinite-and-nan-number-values), 
we can't change it by default without breaking code.

What JavaScript JSON encoders and decoders specifically have a problem with 
this behavior? The documentation says "This behavior is not JSON specification 
compliant, but is consistent with most JavaScript based encoders and 
decoders.", so if there are encoders and decoders that it doesn't work with, 
that would be good to know.

--
nosy: +eric.smith

___
Python tracker 

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



[issue40632] AttributeError: type object 'Callable' has no attribute '_abc_registry'

2020-05-15 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

You seem to use typing backport that has this issue : 
https://github.com/python/typing/issues/573

--
nosy: +xtreak

___
Python tracker 

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



  1   2   >