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

2020-05-15 Thread Mark Dickinson

Mark Dickinson  added the comment:

@Rémi Lapeyre (since you requested re-opening of the issue :-)

Are you interested in putting together a PEP for this?

--

___
Python tracker 

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



[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-05-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am not sure what is better: to fix it at high level, in main() for cProfile 
and cProfile, or at low level, in methods runctx() and run() of profile._Utils.

--

___
Python tracker 

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



[issue40608] PY3.8 GC segfault (Py_TRASHCAN_SAFE_BEGIN/END are not backwards compatible)

2020-05-15 Thread Irit Katriel


Change by Irit Katriel :


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

___
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 Jason R. Coombs


Jason R. Coombs  added the comment:

Today I ran into an issue due to this change. I have a test that sets 
`os.environ['HOME']` in order to ensure that `os.path.expanduser(~)` returns 
that value 
(https://github.com/pypa/setuptools/blob/f6f25adfc81df76e186bf6c3738a1baa0f92be05/setuptools/tests/test_packageindex.py#L288).

> I can't find any documentation of `HOME` being relevant on windows (only on 
> posix).

First, I'll nitpick that Windows is posix-compliant. What you probably mean 
here is "Unix".

But the important thing here is that one of the beautiful things about Python 
is how it _bridges_ the gap between Unix and Windows, in many ways providing a 
uniform interface across various platforms. By supporting `HOME`, Python 
provides a single mechanism that a caller can rely on to indicate a home 
directory.

With this change, a user is now required to provide separate guidance for 
invocation on Windows.

In addition to the Setuptools test above that failed, I know I've relied on 
this behavior before in uses where I've written documentation advising users to 
set "HOME" to override a location derived from ~ (perhaps for .pypirc, but 
probably for others as well). Now guidance like that changes from:

Set HOME to the target directory.

to:

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

It also means that code like the tests in Setuptools need to implement this 
branching logic as well.

Can we restore _some_ mechanism by which a caller can supply the home directory 
in a unified way?

--
nosy: +jaraco

___
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 Jason R. Coombs


Jason R. Coombs  added the comment:

I should also point out that this was a documented feature of Python that was 
removed without any deprecation period.

--

___
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 Jason R. Coombs


Jason R. Coombs  added the comment:

I addressed the [setuptools test suite 
issue](https://github.com/pypa/setuptools/issues/2112) with [this 
commit](https://github.com/pypa/setuptools/commit/f866311d60f54499c3637309e3429780d8c8f218).
 What was a one-line elegant solution is now multiple lines requiring extra 
imports.

--

___
Python tracker 

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



[issue40608] PY3.8 GC segfault (Py_TRASHCAN_SAFE_BEGIN/END are not backwards compatible)

2020-05-15 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +19412
pull_request: https://github.com/python/cpython/pull/20104

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

As Serhiy suggested, keeping the algorithm but moving the Python implementation 
to be a generator again (as I recently changed in PR 18427) gives another 
performance boost (although this unrolling is many lines of code).

Timing the C implementation:

.\python.bat -m pyperf timeit -s "from random import random; from 
collections import deque; from heapq import merge;  iters = [sorted(random() 
for j in range(10_000)) for i in range(20)]" "deque(merge(*iters), maxlen=0)"

On Master: Mean +- std dev: 66.9 ms +- 0.6 ms
With PR:   Mean +- std dev: 17.3 ms +- 0.9 ms

Timing the Python Implementation in CPython:

.\python.bat -m pyperf timeit -s "from random import random; from 
collections import deque; from test import support; merge = 
support.import_fresh_module('heapq', blocked=['_heapq']).merge; iters = 
[sorted(random() for j in range(10_000)) for i in range(20)]" 
"deque(merge(*iters), maxlen=0)"

On Master: Mean +- std dev: 385 ms +- 3 ms
With PR:   Mean +- std dev: 250 ms +- 2 ms

Timing PyPy:

pypy -m pyperf timeit -s "... from heapq import merge; ..." ...
versus
pypy -m pyperf timeit -s "... from heapq2 import merge; ..." ...

Testing on PyPy 7.1.1: Mean +- std dev: 142 ms +- 2 ms
This implementation:   Mean +- std dev: 38.0 ms +- 1.2 ms


=


Another positive for this proposal I just discovered is that object.__eq__ no 
longer needs to be called at each comparison:

from heapq import merge
from collections import deque

class Int(int):
lt = eq = 0
def __lt__(self, other):
__class__.lt += 1
return int.__lt__(self, other)

def __eq__(self, other):
__class__.eq += 1
return int.__eq__(self, other)

def comparisons(iterables):
Int.lt = Int.eq = 0
deque(merge(*iterables), maxlen=0)
return Int.lt, Int.eq

no_overlap = comparisons(
# (0..999), (1_000..1_999), (2_000..2_999), ...
map(Int, range(x, x+1_000))
for x in range(0, 16_000, 1_000)
)

interleaved = comparisons(
# (0,16,32,...), (1,17,33,...), (2,18,34,...), ...
map(Int, range(x, 16_000, 16))
for x in range(16)
)

print("No overlap: {:,} lt; {:,} eq".format(*no_overlap))
print("Interleaved: {:,} lt; {:,} eq".format(*interleaved))


Before:

No overlap: 65,004 lt; 65,004 eq
Interleaved: 64,004 lt; 64,004 eq

After:

No overlap: 32,000 lt; 0 eq
Interleaved: 63,968 lt; 0 eq

This comes from the way that tuples are compared by scanning item-wise for 
equality before comparing the first discrepancy. Using the positional 
information in the tree with the logic 

yield (right if right < left else left)

requires only one rich comparison, while breaking ties with the stored index 
and the logic 

yield (b if (b, b_index) < (a, a_index) else a)

requires two arbitrary rich comparisons (a != b, then a < b). This can be 
somewhat fixed with the logic

if a_index < b_index:
yield (b if b < a else a)
else:
yield (a if a < b else b)

...but this is another branch in the innermost loop.


==


I also played with a "Tree of Losers" method[1] here[2], and on the same 
benchmarks I got:

CPython (C): Mean +- std dev: 22.7 ms +- 0.2 ms
(slower than in PR 18427)
CPython (Pure Python): Mean +- std dev: 197 ms +- 9 ms
(faster -- likely because of fewer int operations)
PyPy: Mean +- std dev: 38.8 ms +- 0.8 ms
(about the same)

Maybe some more optimizations could be made to that code.

The two approaches should be "isomorphic" in some sense: both should do the 
same number of comparisons on the same data. But I'll emphasize the differences:

Tree of Losers:
- Data structure: Loser Tree (does not satisfy heap invariant)
- Nodes: (item, index) pairs
- Tree has n nodes
- To get the next item: do exchanges from leaf to root, swapping as you 
find better items
- Comparisons: branching logic based on index comparison

PR 18427 "Tree of winners":
- Data structure: binary heap (always satisfies heap invariant)
- Nodes: just the items
- Tree has 2n-1 nodes (more eagerly evaluated)
- To get the next item: replace parent with better child, root to leaf
- Comparisons: right < left (simple)

Personally, I find the Tree of Winners approach more intuitive, but the Tree of 
Losers approach seems to be the one that comes up more in the literature.

[1] https://en.wikipedia.org/wiki/K-way_merge_algorithm
[2] https://github.com/sweeneyde/cpython/tree/replacement-selection

--

___
Python tracker 

___
_

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

2020-05-15 Thread Christoph Reiter


Christoph Reiter  added the comment:

Config on Windows should go into APPDATA not USERPROFILE/HOME, on macOS it 
should go to "$HOME/Library/Application Support" and on Linux $XDG_CONFIG_HOME 
or $HOME/.config. So using using HOME on all platforms for config is not what 
those platforms recommend, though I understand why it's still done this way by 
many tools.

What about supporting a MYFANCYTOOL_CONFIG_DIR env var that the user can 
override? That's what I do for example.

--

___
Python tracker 

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



[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-05-15 Thread Lysandros Nikolaou

New submission from Lysandros Nikolaou :

The new PEG parser fails when a parenthesised expression with a single child (a 
group) contains a starred expression. Example:

╰─ ./python.exe
Python 3.9.0a6+ (heads/master-dirty:4a12d12186, May 15 2020, 14:53:45)
[Clang 11.0.0 (clang-1100.0.33.8)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> ast.parse('(*a)')
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/lysnikolaou/Repositories/cpython/Lib/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
  File "", line 1
(*a)
^
SyntaxError: invalid syntax

This was valid syntax up until now:

╰─ ./python.exe -X oldparser
Python 3.9.0a6+ (heads/master-dirty:4a12d12186, May 15 2020, 14:53:45)
[Clang 11.0.0 (clang-1100.0.33.8)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> ast.dump(ast.parse('(*a)'))
"Module(body=[Expr(value=Starred(value=Name(id='a', ctx=Load()), ctx=Load()))], 
type_ignores=[])"

--
assignee: lys.nikolaou
components: Interpreter Core
messages: 368936
nosy: gvanrossum, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: PEG Parser: Cannot used starred expression in parenthesised expr
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



[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2020-05-15 Thread Mark Shannon


Mark Shannon  added the comment:

Those numbers are for code without immortal objects.
They don't apply in this case, as the branch misprediction rate would rise.

--

___
Python tracker 

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



[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-05-15 Thread Lysandros Nikolaou

Lysandros Nikolaou  added the comment:

Whoops, false alarm.

It's just that we moved the check for invalid starred expressions to the 
parser, while it previously was in the compiler.

╰─ ./python.exe -X oldparser
Python 3.9.0a6+ (heads/master-dirty:003708bcf8, May 15 2020, 15:08:21)
[Clang 11.0.0 (clang-1100.0.33.8)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> (*a)
  File "", line 1
SyntaxError: can't use starred expression here

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



[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-05-15 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


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


Glenn Travis  added the comment:

Is there no way to edit a previous comment?
Anyway, I can get it to work as described, but the Launcher Preferences window 
also opens when I run a script.  Did I miss a setting?

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-15 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +19413
pull_request: https://github.com/python/cpython/pull/20106

___
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 Serhiy Storchaka


Serhiy Storchaka  added the comment:

First, the code for checking arguments was significantly changed in recent 
versions. So if we are going to make these changes the patch should be not just 
rebased, but rewritten from zero.

Second, the error messages for wrong number of positional arguments are more 
diverse.

>>> def func(a, b=1): pass
... 
>>> func()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: func() missing 1 required positional argument: 'a'
>>> func(1, 2, 3)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: func() takes from 1 to 2 positional arguments but 3 were given

It differs when you pass less positional arguments than expected, and when 
there are optional positional parameters.

Third, when you pass incorrect number of keyword arguments, you get error 
either about missed keyword arguments (they names, not count), or about an 
unexpected keyword argument (with its name).

Forth, if you change error messages for Python implemented functions, don't 
forget about functions implemented in C. Those which use 
PyArg_ParseTupleAndKeywords (and variants), those which use Argument Clinic, 
and special cases like print(), sorted(), max().

Personally I think that the current error message is correct and complete. But 
if you want to improve it, remember that additional information should be 
correct, useful and consistent across different types of functions. Also, too 
verbose error message can have negative effect on comprehension. It should 
provide information necessary to identify the source of the error and do not 
distract from it.

--

___
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 Дилян Палаузов

New submission from Дилян Палаузов :

I have the newest cpython 3.8 (07bd5cf3d9551ae), installed with `./configure 
--enable-loadable-sqlite-extensions --disable-ipv6 --with-system-expat 
--with-system-libmpdec --enable-shared && make && make install`.

Calling `pip-20.1 install -U meson` prints:

Collecting meson
  Using cached meson-0.54.2.tar.gz (1.7 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python3 /usr/local/lib/python3.8/site-packages/pip 
install --ignore-installed --no-user --prefix 
/tmp/pip-build-env-to_qzg_r/overlay --no-warn-script-location --no-binary 
:none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel
   cwd: None
  Complete output (44 lines):
  Traceback (most recent call last):
File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
  return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
  exec(code, run_globals)
File "/usr/local/lib/python3.8/site-packages/pip/__main__.py", line 26, in 

  sys.exit(_main())
File "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/main.py", 
line 73, in main
  command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File 
"/usr/local/lib/python3.8/site-packages/pip/_internal/commands/__init__.py", 
line 104, in create_command
  module = importlib.import_module(module_path)
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in 
import_module
  return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File 
"/usr/local/lib/python3.8/site-packages/pip/_internal/commands/install.py", 
line 24, in 
  from pip._internal.cli.req_command import RequirementCommand, with_cleanup
File 
"/usr/local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 
16, in 
  from pip._internal.index.package_finder import PackageFinder
File 
"/usr/local/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", 
line 21, in 
  from pip._internal.index.collector import parse_links
File 
"/usr/local/lib/python3.8/site-packages/pip/_internal/index/collector.py", line 
14, in 
  from pip._vendor import html5lib, requests
File 
"/usr/local/lib/python3.8/site-packages/pip/_vendor/requests/__init__.py", line 
114, in 
  from . import utils
File 
"/usr/local/lib/python3.8/site-packages/pip/_vendor/requests/utils.py", line 
25, in 
  from . import certs
File 
"/usr/local/lib/python3.8/site-packages/pip/_vendor/requests/certs.py", line 
15, in 
  from pip._vendor.certifi import where
File 
"/usr/local/lib/python3.8/site-packages/pip/_vendor/certifi/__init__.py", line 
1, in 
  from .core import contents, where
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/certifi/core.py", 
line 12, in 
  from importlib.resources import read_text
File "/usr/local/lib/python3.8/importlib/resources.py", line 11, in 
  from typing import Iterable, Iterator, Optional, Set, Union   # noqa: F401
File "/usr/local/lib/python3.8/site-packages/typing.py", line 1357, in 

  class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/usr/local/lib/python3.8/site-packages/typing.py", line 1005, in 
__new__
  self._abc_registry = extra._abc_registry
  AttributeError: type object 'Callable' has no attribute '_abc_registry'
  
ERROR: Command errored out with exit status 1: /usr/local/bin/python3 
/usr/local/lib/python3.8/site-packages/pip install --ignore-installed --no-user 
--prefix /tmp/pip-build-env-to_qzg_r/overlay --no-warn-script-location 
--no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 
setuptools wheel Check the logs for full command output.

--
components: Installation
messages: 368941
nosy: dilyan.palauzov
priority: normal
severity: normal
status: open
title: AttributeError: type object 'Callable' has no attribute '_abc_registry'
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



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

2020-05-15 Thread Haoyu SUN


New submission from Haoyu SUN :

Float numbers in Python can have 3 special number: nan, inf, -inf, which are 
encoded by json module as "NaN", "Infinity", "-Infinity". These representations 
are not compatible with JSON specifications RFC7159:
https://tools.ietf.org/html/rfc7159.html#page-6

These values are not correctly parsed by most JavaScript JSON encoders.

It is better to encode "NaN" to "null" which is a valid JSON keyword 
representing "Not a Number".

Here is an example how json.dumps() encodes NaN to NaN in JSON:
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> dct = {'a': None, 'b' : float('nan')}
>>> dct
{'a': None, 'b': nan}
>>> import json
>>> json.dumps(dct)
'{"a": null, "b": NaN}'

--
components: Library (Lib)
messages: 368942
nosy: Haoyu SUN
priority: normal
severity: normal
status: open
title: json.dumps() should encode float number NaN to null
type: behavior
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



[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



[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



[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



[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, &tc) != 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 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



[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



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



[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



[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



[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



[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



[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



[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



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


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



[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



[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


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



[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



[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



[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



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



[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



[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



[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



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



[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: +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


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



[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



[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



[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


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



[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



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

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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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

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:

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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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


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



[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



[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



  1   2   >