[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 72fff60d7649df88026838d8b5f14f541393f268 by Miss Islington (bot) 
in branch '3.7':
bpo-39778: Add clarification about tp_traverse and ownership (GH-18754)
https://github.com/python/cpython/commit/72fff60d7649df88026838d8b5f14f541393f268


--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 1827fc30f463786ebff13752e35c3224652bc94e by Miss Islington (bot) 
in branch '3.8':
bpo-39778: Add clarification about tp_traverse and ownership (GH-18754)
https://github.com/python/cpython/commit/1827fc30f463786ebff13752e35c3224652bc94e


--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18117
pull_request: https://github.com/python/cpython/pull/18762

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18118
pull_request: https://github.com/python/cpython/pull/18763

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 6df421fe87a9418d6c59f89dbc5d5573b6826855 by Pablo Galindo in 
branch 'master':
bpo-39778: Add clarification about tp_traverse and ownership (GH-18754)
https://github.com/python/cpython/commit/6df421fe87a9418d6c59f89dbc5d5573b6826855


--

___
Python tracker 

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



[issue39833] Bug in html parsing module triggered by malformed input

2020-03-02 Thread Ezio Melotti


Ezio Melotti  added the comment:

Thanks for the report.
This is a duplicate of #34480.

--
nosy: +ezio.melotti
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
type: compile error -> behavior

___
Python tracker 

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



[issue39761] Python 3.9.0a4 fails to build when configured with --with-dtrace

2020-03-02 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue39802] Ensure {get, set}_escdelay and {get, set}_tabsize only implemented when the extensions are activated

2020-03-02 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:


New changeset 4991cf47c487500fdedc34f0a2eb4b7468a67c3c by Batuhan Taşkaya in 
branch 'master':
bpo-39802: Only expose set_escdelay and set_tabsize when curses extensions are 
activated (GH-18705)
https://github.com/python/cpython/commit/4991cf47c487500fdedc34f0a2eb4b7468a67c3c


--
nosy: +pablogsal

___
Python tracker 

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



[issue38091] Import deadlock detection causes deadlock

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 6daa37fd42c5d5300172728e8b4de74fe0b319fc by Armin Rigo in branch 
'master':
bpo-38091: Import deadlock detection causes deadlock (GH-17518)
https://github.com/python/cpython/commit/6daa37fd42c5d5300172728e8b4de74fe0b319fc


--
nosy: +miss-islington

___
Python tracker 

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



[issue39831] Reference leak in PyErr_WarnEx()

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Closing this as the backports are merged.

Thanks, Serhiy, for finding the leak and for the fix :)

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



[issue39831] Reference leak in PyErr_WarnEx()

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 394dc0db878c08d003772de163a57ac12046d865 by Pablo Galindo in 
branch '3.8':
[3.8] bpo-39831: Fix a reference leak in PyErr_WarnEx(). (GH-18750) (GH-18761)
https://github.com/python/cpython/commit/394dc0db878c08d003772de163a57ac12046d865


--

___
Python tracker 

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



[issue39831] Reference leak in PyErr_WarnEx()

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 499c926fbeafa7e4c15d925fea27fe8a65cc3b25 by Pablo Galindo in 
branch '3.7':
[3.7] bpo-39831: Fix a reference leak in PyErr_WarnEx(). (GH-18750). (GH-18760)
https://github.com/python/cpython/commit/499c926fbeafa7e4c15d925fea27fe8a65cc3b25


--

___
Python tracker 

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



[issue39831] Reference leak in PyErr_WarnEx()

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I made the backports to 3.7 and 3.8 manually to calm down the refleak buildbots 
as the automatic backports failed :)

--

___
Python tracker 

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



[issue39831] Reference leak in PyErr_WarnEx()

2020-03-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18116
pull_request: https://github.com/python/cpython/pull/18761

___
Python tracker 

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



[issue39831] Reference leak in PyErr_WarnEx()

2020-03-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
nosy_count: 1.0 -> 2.0
pull_requests: +18115
pull_request: https://github.com/python/cpython/pull/18760

___
Python tracker 

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



[issue39697] Failed to build with --with-cxx-main=g++-9.2.0

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This seems like a duplicate of https://bugs.python.org/issue35912

--
nosy: +pablogsal

___
Python tracker 

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



[issue38597] C Extension import limit

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 0d20364b132014eec609b900997c34779a4d548c by Miss Islington (bot) 
in branch '3.8':
bpo-38597: Never statically link extension initialization code on Windows 
(GH-18724)
https://github.com/python/cpython/commit/0d20364b132014eec609b900997c34779a4d548c


--

___
Python tracker 

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



[issue38597] C Extension import limit

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 8a5f7ad5e423b74ea612e25472e5bff3adf1ea87 by Steve Dower in branch 
'3.7':
[3.7] bpo-38597: Never statically link extension initialization code on Windows 
(GH-18724) (GH-18759)
https://github.com/python/cpython/commit/8a5f7ad5e423b74ea612e25472e5bff3adf1ea87


--

___
Python tracker 

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



[issue39832] Modules with decomposable characters in module name not found on macOS

2020-03-02 Thread Norbert

New submission from Norbert :

Modules whose names contain characters that are in precomposed form but can be 
decomposed in Normalization Form D can’t be found on macOS.


To reproduce:

1. Download and unzip the attached file Modules.zip. This produces a directory 
Modules with four Python source files.

2. In Terminal, go to the directory that contains Modules.

3. Run "python3 -m Modules.Import".


Expected behavior:

The following lines should be generated:
Maerchen
Märchen


Actual behavior:

The first line, “Maerchen” is generated, but then an error occurs:
Traceback (most recent call last):
 File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", 
line 193, in _run_module_as_main
   return _run_code(code, main_globals, None,
 File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", 
line 86, in _run_code
   exec(code, run_globals)
 File "/Users/business/tmp/pyimports/Modules/Import.py", line 5, in 
   from Modules.Märchen import hello2
ModuleNotFoundError: No module named 'Modules.Märchen'


Evaluation:

In the source file Modules/Import.py, the name of the module “Märchen” is 
written with the precomposed character U+00E4. The file name Märchen.py uses 
the decomposed character sequence U+0061 U+0308 instead. Macintosh file names 
commonly use a variant of Normalization Form D in file names – the old file 
system HFS enforces this, and while APFS doesn’t, the Finder still generates 
file names in this form. U+00E4 and U+0061 U+0308 are canonically equivalent, 
so they should be treated as equal in module loading.


Tested configuration:

CPython 3.8.2
macOS 10.14.6

--
components: Interpreter Core
files: Modules.zip
messages: 363224
nosy: Norbert
priority: normal
severity: normal
status: open
title: Modules with decomposable characters in module name not found on macOS
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48944/Modules.zip

___
Python tracker 

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



[issue26460] datetime.strptime without a year fails on Feb 29

2020-03-02 Thread Alexander Belopolsky


Alexander Belopolsky  added the comment:

> On Mar 2, 2020, at 6:33 PM, Gregory P. Smith  wrote:
> 
> Change that default to any old year with a leap year (1904?)

In the 21st century, the year 2000 default makes much more sense than 1900. 
Luckily 2000 is also a leap year.

--

___
Python tracker 

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



[issue38597] C Extension import limit

2020-03-02 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +18114
pull_request: https://github.com/python/cpython/pull/18759

___
Python tracker 

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



[issue38597] C Extension import limit

2020-03-02 Thread Steve Dower


Steve Dower  added the comment:


New changeset ce3a4984089b8e0ce5422ca32d75ad057b008074 by Steve Dower in branch 
'master':
bpo-38597: Never statically link extension initialization code on Windows 
(GH-18724)
https://github.com/python/cpython/commit/ce3a4984089b8e0ce5422ca32d75ad057b008074


--

___
Python tracker 

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



[issue38597] C Extension import limit

2020-03-02 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 11.0 -> 12.0
pull_requests: +18113
pull_request: https://github.com/python/cpython/pull/18758

___
Python tracker 

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



[issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32

2020-03-02 Thread Pete Wicken


Pete Wicken  added the comment:

I've had a go at implementing this. I did not implement for IPv6 as this was 
not mentioned here, but it seems like it would make sense for it as well. I can 
add that in too if you like.

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 9ddcb914f9c2debe7c1359b2450cd1573e86b91c by Pablo Galindo in 
branch '3.8':
[3.8] bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse 
and tp_clear (GH-18749) (GH-18756)
https://github.com/python/cpython/commit/9ddcb914f9c2debe7c1359b2450cd1573e86b91c


--

___
Python tracker 

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



[issue39682] pathlib.Path objects can be used as context managers

2020-03-02 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

As with the Accessor abstraction, the original idea was to support Path objects 
backed by a directory file descriptor (for use with openat() and friends).  
That idea was abandoned but it looks like the context manager stayed.  It's 
certainly not useful currently.

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 69ded3944c202da972754644c0bbf7f77cc5e8ea by Miss Islington (bot) 
in branch '3.7':
bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and 
tp_clear (GH-18749)
https://github.com/python/cpython/commit/69ded3944c202da972754644c0bbf7f77cc5e8ea


--

___
Python tracker 

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



[issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32

2020-03-02 Thread Pete Wicken


Change by Pete Wicken :


--
keywords: +patch
nosy: +Wicken
nosy_count: 5.0 -> 6.0
pull_requests: +18112
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18757

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18111
pull_request: https://github.com/python/cpython/pull/18756

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +18110
pull_request: https://github.com/python/cpython/pull/18755

___
Python tracker 

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



[issue26460] datetime.strptime without a year fails on Feb 29

2020-03-02 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I _doubt_ there is code expecting the default year when unspecified to actually 
be 1900.

Change that default to any old year with a leap year (1904?) and it'll still 
(a) stand out as a special year that can be looked up should it wind up being 
_used_ as the year in code somewhere and (b) not fail every four years for 
people just parsing to extract Month + Day values.

--

___
Python tracker 

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



[issue39809] argparse: add max_text_width parameter to ArgumentParser

2020-03-02 Thread Luca


Luca  added the comment:

For the benefit of other developers willing to control text width with 
`argparse`, using the lambda function let `mypy` fail with the following error:

541: error: Argument "formatter_class" to "ArgumentParser" has incompatible 
type "Callable[[Any], RawDescriptionHelpFormatter]"; expected 
"Type[HelpFormatter]"

So I am reverting back to the following custom formatting class:

class 
RawDescriptionHelpFormatterMaxTextWidth80(argparse.RawDescriptionHelpFormatter):
"""Set maximum text width = 80."""

def __init__(self, prog):
width = min(80, shutil.get_terminal_size().columns - 2)
argparse.RawDescriptionHelpFormatter.__init__(self, prog, 
width=width)

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18109
pull_request: https://github.com/python/cpython/pull/18754

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-02 Thread Stefan Krah


Change by Stefan Krah :


--
pull_requests: +18108
pull_request: https://github.com/python/cpython/pull/18753

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-02 Thread Stefan Krah


Change by Stefan Krah :


--
pull_requests: +18107
pull_request: https://github.com/python/cpython/pull/18752

___
Python tracker 

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



[issue26460] datetime.strptime without a year fails on Feb 29

2020-03-02 Thread Nick Moore


Nick Moore  added the comment:

Not disagreeing with you that "%b %d" timestamps with no "%Y" are excerable, 
but they're fairly common in the *nix world unfortunately.

People need to parse them, and the simple and obvious way to do this breaks 
every four years.

I like the idea of having a warning for not including %Y *and* not setting a 
default_year kwarg though.

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 0c2b509f9d1d3a9065bc62c2407e1dc2ed70e9c2 by Pablo Galindo in 
branch 'master':
bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and 
tp_clear (GH-18749)
https://github.com/python/cpython/commit/0c2b509f9d1d3a9065bc62c2407e1dc2ed70e9c2


--

___
Python tracker 

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



[issue39809] argparse: add max_text_width parameter to ArgumentParser

2020-03-02 Thread Luca


Luca  added the comment:

OK, I will do this for my package, but I do not believe many others will do the 
same without a `max_text_width` parameter (too much care is needed for this to 
work correctly), and as a result most packages using `argparse` will continue 
to not properly handle text width.

--

___
Python tracker 

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



[issue39809] argparse: add max_text_width parameter to ArgumentParser

2020-03-02 Thread paul j3


paul j3  added the comment:

But you can replace the simple 'lambda' with a function that takes the max with 
'columns'.  In other words, include: 

 width = _shutil.get_terminal_size().columns
 width -= 2
 width = min(max_text_width, width)

The only thing that the 'formatter_class' parameter requires is a callable that 
takes 'prog' as argument.  That can be a class, a subclass, a lambda or a 
function.

--

___
Python tracker 

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



[issue37330] open(): remove 'U' mode, deprecated since Python 3.3

2020-03-02 Thread Andrew Bartlett


Andrew Bartlett  added the comment:

Thanks for the reply.

To clarify, it is best to understand where Samba thinks of itself in terms of 
Python.  We use python, but we don't really think of ourselves as a python 
project, and while we have some developers with a depth of experience in the 
language, most of us just use it as a tool to get things done, in particular to 
build Samba.

Samba has a build system built in Python, called Waf.  Samba uses waf to build 
the project (particularly the C parts), and our build of the C binaries is 
portable back to Python 2.6.  

Often in Samba we find bugs.  This might come as a shock! ;-).  Many of those 
bugs are regressions, and so it is useful to build old versions, sometimes 7 
year old versions, to confirm if/when the behaviour regressed.  We are able to 
do this, with only one patch to address a perl behaviour change, even on a 
modern Ubuntu 18.04 system, all the way back to 2013.  

I terms of 'but this has been deprecated for years', Samba has only had 
releases been able to even use Python3 in the build system for a year (first 
committed to master in July 2018).

Nobody in Samba was aware of any DeprecationWarning and for better or worse we 
only knew about the issue once our builds failed in Fedora.  We are incredibly 
grateful that Fedora tried a rebuild with the alpha version of Python 3.9 as 
otherwise we would find out only after this was well baked into a release.

Thankfully we don't need universal newlines, but no matter if we need them, old 
versions of Samba will fail to build without a fix-up patch.

More importantly, I think it is unlikely that Samba is the only software to 
have used this feature, intentionally or otherwise, or to be in this position.  

While not as critical here, for context as to why we support Python 2.6 to 
build, it should be noted that retaining this compatibility was a critical part 
of being able to get consensus to otherwise move to Python 3.4.

--

___
Python tracker 

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



[issue39809] argparse: add max_text_width parameter to ArgumentParser

2020-03-02 Thread Luca


Luca  added the comment:

That lambda function would not give the same result, as it would constrain the 
text width to a fixed value, while my proposal would just set a maximum limit 
(if the terminal is narrower, the actual text width would be reduced).

With the current implementation all possible solutions are in my opinion 
overkilling for such a basic task. Maybe it is not a direct consequence of 
this, but as a matter of fact most Python scripts using `argparse` that I know 
(including `pip`) do not control the text width, which IMHO is not a good 
practice.

--

___
Python tracker 

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



[issue37953] Fix ForwardRef equality checks

2020-03-02 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 4.0 -> 5.0
pull_requests: +18106
pull_request: https://github.com/python/cpython/pull/18751

___
Python tracker 

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



[issue39682] pathlib.Path objects can be used as context managers

2020-03-02 Thread Antony Lee


Antony Lee  added the comment:

Immutability and hashability are listed first among "general properties" of 
paths (https://docs.python.org/3/library/pathlib.html#general-properties), and 
in the PEP proposing pathlib 
(https://www.python.org/dev/peps/pep-0428/#immutability).  Looking at it again 
I *guess* the docs version could be read as only guaranteeing this for 
PurePaths (because that's in the PurePath section) rather than Path, but the 
PEP version clearly implies that this is true for both PurePaths and concrete 
Paths.

It may be tricky to check usage in third-party packages, given that one would 
need to look for `with : ...` rather than, say, a method name 
which can be grepped.  Do you have any suggestions here?

--

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-02 Thread Stefan Krah


Stefan Krah  added the comment:


New changeset b3b9ade4a3d3fe00d933bcd8fc5c5c755d1024f9 by Stefan Krah in branch 
'master':
 bpo-39776: Lock ++interp->tstate_next_unique_id. (GH-18746) (#18746)
https://github.com/python/cpython/commit/b3b9ade4a3d3fe00d933bcd8fc5c5c755d1024f9


--

___
Python tracker 

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



[issue39831] Reference leak in PyErr_WarnEx()

2020-03-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2d2f85517f8216146a2f888d1ad4d765b3be2339 by Serhiy Storchaka in 
branch 'master':
bpo-39831: Fix a reference leak in PyErr_WarnEx(). (GH-18750)
https://github.com/python/cpython/commit/2d2f85517f8216146a2f888d1ad4d765b3be2339


--

___
Python tracker 

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



[issue39682] pathlib.Path objects can be used as context managers

2020-03-02 Thread Brett Cannon


Brett Cannon  added the comment:

I guess a question is whether we want immutability guarantees (I for one didn't 
even know you could hash Path objects until now).

I'm personally fine with that idea as it mentally makes sense to not need paths 
to be mutable. But as I said, someone needs to take at least some stab at 
seeing if any preexisting code out there will break if the _closed flag is 
removed before we can continue this discussion.

--

___
Python tracker 

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



[issue39645] Expand concurrent.futures.Future's public API

2020-03-02 Thread Brian Quinlan


Brian Quinlan  added the comment:

I'll try to take a look at this before the end of the week, but I'm currently 
swamped with other life stuff :-(

--

___
Python tracker 

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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Opened issue39831.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue39831] Reference leak in PyErr_WarnEx()

2020-03-02 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39831] Reference leak in PyErr_WarnEx()

2020-03-02 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The test added for issue38913 exposed a reference leak in PyErr_WarnEx().

--
components: Interpreter Core
messages: 363203
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Reference leak in PyErr_WarnEx()
type: resource usage
versions: 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



[issue26460] datetime.strptime without a year fails on Feb 29

2020-03-02 Thread Paul Ganssle


Paul Ganssle  added the comment:

I don't think adding a default_year parameter is the right solution here.

The actual problem is that `time.strptime`, and by extension 
`datetime.strptime` has a strange and confusing interface. What should happen 
is either that `year` is set to None or some other marker of a missing value or 
datetime.strptime should raise an exception when it's being asked to construct 
something that does not contain a year.

Since there is no concept of a partial datetime, I think our best option would 
be to throw an exception, except that this has been baked into the library for 
ages and would start to throw exceptions even when the person has correctly 
handled the Feb 29th case.

I think one possible "solution" to this would be to raise a warning any time 
someone tries to use `datetime.strptime` without requesting a year to warn them 
that the thing they're doing only exists for backwards compatibility reasons. 
We could possibly eventually make that an exception, but I'm not sure it's 
totally worth a break in backwards compatibility when a warning should put 
people on notice.

--
nosy: +p-ganssle

___
Python tracker 

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



[issue39820] Bracketed paste mode for REPL

2020-03-02 Thread Marco Sulla


Marco Sulla  added the comment:

> Is this even possible in a plain text console?

Yes. See Jupyter Console (aka IPython).

--

___
Python tracker 

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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Actually there is a leak in PyErr_WarnEx().

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue39830] zipfile.Path is not included in __all__

2020-03-02 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

Since zipfile.Path is a public API and documented it could be included in 
__all__ . This might be a problem for code that uses below pattern : 

from zipfile import *
from pathlib import Path

If this is accepted this can be a good beginner issue.

--
components: Library (Lib)
messages: 363199
nosy: barry, jaraco, xtreak
priority: normal
severity: normal
status: open
title: zipfile.Path is not included in __all__
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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> I agree the tp_traverse docs should point out that weakref lists are special 
> this way, but I think the problem is unique to them - can't think of another 
> case where a container points to an object it doesn't own a reference to.

Agreed, I was thinking a small warning or something because this is not the 
first time I see similar errors or users confused about what they should and 
should not track (with this I mention that we should say that "only objects 
that are *owned* should be tracked, and then the weakref warning or something 
similar). I will prepare a PR soon.

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Tim Peters


Tim Peters  added the comment:

After some thought, I'm sure the diagnosis is correct:  the weakref list must 
be made invisible to gc.  That is, simply don't traverse it at all.  The crash 
is exactly what's expected from traversing objects a container doesn't own 
references to.

I agree the tp_traverse docs should point out that weakref lists are special 
this way, but I think the problem is unique to them - can't think of another 
case where a container points to an object it doesn't own a reference to.

--

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-03-02 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:


New changeset 89aa4694fc8c6d190325ef8ed6ce6a6b8efb3e50 by Batuhan Taşkaya in 
branch 'master':
bpo-38870: Add docstring support to ast.unparse (GH-17760)
https://github.com/python/cpython/commit/89aa4694fc8c6d190325ef8ed6ce6a6b8efb3e50


--

___
Python tracker 

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



[issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

Andrew Bartlett of the Samba project asked to revert the removal of the "U" 
mode:
https://bugs.python.org/issue37330#msg362362

We should consider to revert the removal, and only remove the "U" mode in 
Python 3.10.

--

___
Python tracker 

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



[issue37330] open(): remove 'U' mode, deprecated since Python 3.3

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

> While we are of course able to patch new versions of Samba, this will make it 
> harder to bisect back though Samba history.

I don't understand the bisect part. Would you mind to elaborate? What do you 
want to bisect?

>  It would be really great if this kind of change could be reverted or at 
> least deferred so Samba can rely on a stable language platform for it's build 
> system.

The "U" mode was deprecated since September 2012 (Python 3.3): you had 8 years 
to handle the DeprecationWarning. 8 years before actually removing a deprecated 
feature sounds like a stable language platform to me.

I'm not sure of the benefit of deferring the change. Does it mean that Sambda 
would not be updated?

Well, your comment fits exactly into bpo-39674 scope, except that revert the 
"U" mode is not scheduled yet.

--

___
Python tracker 

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



[issue39694] Incorrect dictionary unpacking when calling str.format

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue39737] Speed up list.__eq__ by about 6%

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

I suggest to use LTO + PGO optimizations when benchmarking Python:
https://pyperformance.readthedocs.io/usage.html#how-to-get-stable-benchmarks

Benchmarking is hard :-/

--

___
Python tracker 

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



[issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18103
pull_request: https://github.com/python/cpython/pull/18748

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-02 Thread Stefan Krah


Stefan Krah  added the comment:

I think the PR fixes the issue but I have to run longer tests still.

Threads created by PyGILState_Ensure() could have a duplicate tstate->id,
which confused the ContextVar caching machinery.

--

___
Python tracker 

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



[issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18102
pull_request: https://github.com/python/cpython/pull/18747

___
Python tracker 

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



[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-02 Thread Stefan Krah


Change by Stefan Krah :


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

___
Python tracker 

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



[issue39704] Disable code coverage

2020-03-02 Thread Ammar Askar


Ammar Askar  added the comment:

Just a quick update, I think this is a codecov bug as per here: 
https://community.codecov.io/t/prs-are-commented-even-with-comment-off/941

The yaml configuration doesn't show up here: 
https://codecov.io/gh/python/cpython/settings/yaml

While we wait for a response from codecov, we can fix this in the interim by 
overriding the settings at an organization level. An owner of the Python 
organization can enable this here: the organization level stuff would be here: 
https://codecov.io/account/gh/python/yaml

placing

```
comment: off
coverage:
  status:
changes: off
project: off
patch: off
```

as the config should hopefully fix this for now.

--

___
Python tracker 

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



[issue39704] Disable code coverage

2020-03-02 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue39704] Disable code coverage

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue39828] json.tool should catch BrokenPipeError

2020-03-02 Thread Hakan


Hakan  added the comment:

I'd like to work on this issue but what should it do when it captures that 
error.

--
nosy: +hakancelik

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
assignee:  -> pablogsal

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I concur with Antoine and Tim. The GC already has the machinery to deal with 
weak references in the correct way (even more after recent bugfixes regarding 
callbacks). Traversing the weak reference list in incorrect because the object 
does not "own" the weak references to it, as the weak references can die even 
if the object is alive. Also, as Tim mentions, the traverse will be called on 
the head of the list, in the same way if you do object.__weakref__ you will 
only get the HEAD of the list:

>>> import weakref
>>> class A: ...
>>> a = A()
>>> w1 = weakref.ref(a)
>>> w2 = weakref.ref(a, lambda *args: None) # Use a callback to avoid re-using 
>>> the original weakref
>>> id(w1)
4328697104
>>> id(w2)
4328758864
>>> id(a.__weakref__)
4328697104

I think that this is not very well documented, as there is no pointers on what 
should and should not be traversed in 
https://docs.python.org/3.8/c-api/typeobj.html#c.PyTypeObject.tp_traverse.

I will prepare a PR to the documentation if everybody agrees and another one 
removing the traverse unless someone sees that something else is at play.

--
nosy: +pablogsal

___
Python tracker 

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



[issue39828] json.tool should catch BrokenPipeError

2020-03-02 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue39829] __len__ called twice in the list() constructor

2020-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Why should that be backwards incompatible? The number of times we can `__len__` 
on the constructor is an implementation detail. The reason is called now twice 
is because there is an extra check for the preallocation logic, which is 
detached from the logic of the subsequent list_extend(self, iterable). 

On the other hand, there may be a chance for optimization here, but on a very 
rough first plan, that may require coupling some logic (passing down the 
calculated length to list_extend() or some helper, which I am not very fond of.

--

___
Python tracker 

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



[issue33234] Improve list() pre-sizing for inputs with known lengths

2020-03-02 Thread Eric Snow


Eric Snow  added the comment:

Possible backward incompatibility caused by this issue: issue39829

--
nosy: +eric.snow

___
Python tracker 

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



[issue39829] __len__ called twice in the list() constructor

2020-03-02 Thread Kim-Adeline Miguel


New submission from Kim-Adeline Miguel :

(See #33234)

Recently we added Python 3.8 to our CI test matrix, and we noticed a possible 
backward incompatibility with the list() constructor.

We found that __len__ is getting called twice, while before 3.8 it was only 
called once.

Here's an example:

class Foo:
 def __iter__(self):
  print("iter")
  return iter([3, 5, 42, 69])

 def __len__(self):
  print("len")
  return 4

Calling list(Foo()) using Python 3.7 prints:

iter
len

But calling list(Foo()) using Python 3.8 prints:

len
iter
len

It looks like this behaviour was introduced for #33234 with PR GH-9846. 

We realize that this was merged a while back, but at least we wanted to make 
the team aware of this change in behaviour.

--
components: Interpreter Core
messages: 363186
nosy: brett.cannon, eric.snow, kimiguel, pablogsal, rhettinger
priority: normal
severity: normal
status: open
title: __len__ called twice in the list() constructor
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



[issue39828] json.tool should catch BrokenPipeError

2020-03-02 Thread STINNER Victor


New submission from STINNER Victor :

The json.tool module doesn't catch BrokenPipeError:
---
$ echo "{}" | python3 -m json.tool | true
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/usr/lib64/python3.7/json/tool.py", line 45, in 
main()
  File "/usr/lib64/python3.7/json/tool.py", line 41, in main
outfile.write('\n')
BrokenPipeError: [Errno 32] Broken pipe
---

json.tool should catch BrokenPipeError.

--
components: Library (Lib)
messages: 363185
nosy: vstinner
priority: normal
severity: normal
status: open
title: json.tool should catch BrokenPipeError
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



[issue37636] Deprecate slicing and ordering operations on sys.version

2020-03-02 Thread Ruairidh MacLeod


Change by Ruairidh MacLeod :


--
nosy: +rkm

___
Python tracker 

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



[issue39826] logging HTTPHandler does not support proxy

2020-03-02 Thread lorb


Change by lorb :


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

___
Python tracker 

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



[issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar

2020-03-02 Thread Till Korten


New submission from Till Korten :

This issue occurs when a locale is set that uses comma as decimal separator 
(e.g. locale.setlocale(locale.LC_NUMERIC, 'de_DE.utf8')).
I have a tkinter.Spinbox with increment=0.1 connected to a tkinter.DoubleVar.
When I change the value of the Spinbox using the arrow buttons and subsequently 
try to read out the variable with tkinter.DoubleVar.get(), my code throws the 
follwoing error:
_tkinter.TclError: expected floating-point number but got "0,1".

Here is a minimal code example:

-
import tkinter
import locale

locale.setlocale(locale.LC_NUMERIC, 'de_DE.utf8')


class TestDoubleVar():
def __init__(self):
root = tkinter.Tk()
self.var = tkinter.DoubleVar()
self.var.set(0.8)
number = tkinter.Spinbox(
root,
from_=0, to=1, increment=0.1,
textvariable=self.var,
command=self.update,
width=4
)
number.pack(side=tkinter.LEFT)
root.mainloop()

def update(self, *args):
print(float(self.var.get()))


if __name__ == '__main__':
TestDoubleVar()

---

Actual result: the code throws an error

Expected result: the code should print the values of the DoubleVar even with a 
locale set that uses comma as the decimal separator.

n.b. the problem also occurs with tkinter.Scale

--
components: Tkinter
files: test_doublevar.py
messages: 363184
nosy: thawn
priority: normal
severity: normal
status: open
title: setting a locale that uses comma as decimal separator breaks 
tkinter.DoubleVar
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48943/test_doublevar.py

___
Python tracker 

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



[issue39796] warning extension module inited twice in python3.9

2020-03-02 Thread hai shi


hai shi  added the comment:

copy that, thanks for your explanation, victor.

--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Cool. Should I remove Python-3.* from the Versions label, so it doesn't show up 
in searches for 3.* issues?

--

___
Python tracker 

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



[issue39826] logging HTTPHandler does not support proxy

2020-03-02 Thread lorb


New submission from lorb :

The HTTPHandler does not support using a proxy. It would be necessary to 
subclass it and reimplement `emit` to enable passing in proxy settings.
Adding a hook to make it easy to customize the connection used would solve this.

--
components: Library (Lib)
messages: 363181
nosy: lorb
priority: normal
severity: normal
status: open
title: logging HTTPHandler does not support proxy
type: enhancement

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread Steve Dower


Steve Dower  added the comment:

Leaving open until someone (*cough* Benjamin) confirms whether this has to go 
into 2.7 or not.

--
nosy: +benjamin.peterson
stage: patch review -> backport needed

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 7ca251bd85f1182b9734579975c17fbd0488e2a4 by Miss Islington (bot) 
in branch '3.7':
bpo-38380: Update macOS & Windows builds to SQLite v3.31.1 (GH-18678)
https://github.com/python/cpython/commit/7ca251bd85f1182b9734579975c17fbd0488e2a4


--

___
Python tracker 

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



[issue38380] Update SQLite to 3.31.1 in Windows and macOS installer builds

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 7ad99821d8ae75222c50e69194a39f535bb058f5 by Miss Islington (bot) 
in branch '3.8':
bpo-38380: Update macOS & Windows builds to SQLite v3.31.1 (GH-18678)
https://github.com/python/cpython/commit/7ad99821d8ae75222c50e69194a39f535bb058f5


--

___
Python tracker 

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



[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2020-03-02 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Yes, I don't think other weakref-supporting objects traverse the weakreflist in 
their tp_traverse.

--
nosy: +pitrou

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-02 Thread Elad Lahav


Elad Lahav  added the comment:

"Attached fork_mt.py example uses exec_fn() function... which is not defined. 
Is it on purpose?"

That was my mistake - a copy/paste of existing code from distutils. Since the 
example hangs before the script gets to exec_fn() I didn't notice the problem. 
Just change it to os.execl

--

___
Python tracker 

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



[issue39796] warning extension module inited twice in python3.9

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

> if we don't load _warnings module as soon as possible, what possible risks 
> will be raise?

There are different risks:

* Worst case: using the _warnings module state before it's initialized may lead 
to crash.
* Best case: some warnings are not emitted.

Anyway, the initial issue should now be fixed by my commit.

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



[issue39796] warning extension module inited twice in python3.9

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 66b7973c1b2e6aa6a2462c6b13971a08cd665af2 by Victor Stinner in 
branch 'master':
bpo-39796: Fix _warnings module initialization (GH-18739)
https://github.com/python/cpython/commit/66b7973c1b2e6aa6a2462c6b13971a08cd665af2


--

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

Attached fork_mt.py example uses exec_fn() function... which is not defined. Is 
it on purpose?

--

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 18743 to reimplement distutils.spawn.spawn() function with the 
subprocess module.

It also changes setup.py to use a basic implementation of the subprocess module 
if the subprocess module is not available: before required C extension modules 
are built.

--

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39825] EXT_SUFFIX inconsistent between sysconfig and distutils.sysconfig (Windows)

2020-03-02 Thread Antoine Pitrou


New submission from Antoine Pitrou :

On Windows, Python 3.7.6 and 3.8.1:
```
>>> import sysconfig
>>> sysconfig.get_config_var('EXT_SUFFIX')
'.pyd'
>>> from distutils import sysconfig
>>> sysconfig.get_config_var('EXT_SUFFIX')
'.cp38-win_amd64.pyd'
```

The sysconfig answer is probably wrong (the ABI-qualified extension 
'.cp38-win_amd64.pyd' should be preferred).

--
components: Distutils, Library (Lib)
messages: 363171
nosy: dstufft, eric.araujo, paul.moore, pitrou, steve.dower, tarek, tim.golden, 
zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: EXT_SUFFIX inconsistent between sysconfig and distutils.sysconfig 
(Windows)
type: behavior
versions: 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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
resolution: fixed -> 

___
Python tracker 

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



[issue39764] PyAsyncGenObject causes task.get_stack() raising AttributeError

2020-03-02 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue39764] PyAsyncGenObject causes task.get_stack() raising AttributeError

2020-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 43932dc1eaf36d75b2ee0420d8be747001315c26 by Miss Islington (bot) 
in branch '3.8':
bpo-39764: Make Task.get_stack accept ag_frame (GH-18669)
https://github.com/python/cpython/commit/43932dc1eaf36d75b2ee0420d8be747001315c26


--

___
Python tracker 

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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-02 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
status: closed -> open

___
Python tracker 

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



[issue39796] warning extension module inited twice in python3.9

2020-03-02 Thread hai shi


hai shi  added the comment:

Wow, Thanks, victor, much useful infos.

>In Python 3, _PyWarnings_Init() calls PyModule_Create() which creates a module 
>but doesn't add it to sys.modules.

this operation will be executed in _bootstrap_external.

> We want the _warnings module to be ready as early as possible.

if we don't load _warnings module as soon as possible, what possible risks will 
be raise? 

> There are C functions which access the module state 
> (tstate->interp->warnings) without going through the module object, like 
> PyErr_WarnFormat().

This is important info.

--

___
Python tracker 

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



  1   2   >