[issue14364] Argparse incorrectly handles '--' as argument to option

2019-09-05 Thread hai shi


Change by hai shi :


--
nosy: +rhettinger
type:  -> behavior

___
Python tracker 

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



[issue14364] Argparse incorrectly handles '--' as argument to option

2019-09-05 Thread hai shi


Change by hai shi :


--
pull_requests: +15369
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/15714

___
Python tracker 

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



[issue14364] Argparse incorrectly handles '--' as argument to option

2019-09-05 Thread hai shi


hai shi  added the comment:

some test cases which paul provided looks doesn't keep compatible.

In TestDoubleDashRemoval:
# output in my env is Namespace(cmd='cmd', foo=None, rest=['--', '--foo'])
('-- cmd -- -- --foo', NS(cmd='cmd', foo=None, rest=['--', '--', '--foo']))

# output in my env is Namespace(cmd='--', foo='1', rest=['1', '2'])
('-f1 -- -- 1 -- 2', NS(cmd='--', foo='1', rest=['1', '--', '2']))

# output in my env is Namespace(cmd='--foo', foo=None, rest=['--bar', '2'])
('-- --foo -- --bar 2', NS(cmd='--foo', foo=None, rest=['--', '--bar', '2']))

# output in my env is Namespace(cmd='cmd', foo=None, rest=['--foo', '-f2'])
('cmd -- --foo -- -f2', NS(cmd='cmd', foo=None, rest=['--foo', '--', '-f2']))


In TestDoubleDashRemoval1:
# output in my env is Namespace(cmd='cmd', foo='1', rest=['-f2', '3'])
('-f1 -- cmd -- -f2 3', NS(cmd='cmd', foo='1', rest=['--', '-f2', '3']))

my python's version is: 2.7.5, 3.6.8

--
nosy: +shihai1991

___
Python tracker 

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



[issue38043] small cleanups in Unicode normalization code

2019-09-05 Thread Greg Price


Change by Greg Price :


--
pull_requests: +15368
pull_request: https://github.com/python/cpython/pull/15558

___
Python tracker 

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



[issue38043] small cleanups in Unicode normalization code

2019-09-05 Thread Greg Price


Change by Greg Price :


--
pull_requests: +15367
pull_request: https://github.com/python/cpython/pull/15712

___
Python tracker 

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



[issue38043] small cleanups in Unicode normalization code

2019-09-05 Thread Greg Price


Change by Greg Price :


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

___
Python tracker 

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



[issue38043] small cleanups in Unicode normalization code

2019-09-05 Thread Greg Price


New submission from Greg Price :

Benjamin noticed in reviewing GH-15558 (for #37966) several points where the 
existing code around Unicode normalization can be improved:

* on the `QuickcheckResult` enum:
  > Maybe `makeunicodedata.py` should output this enum (with better name 
namespacing)

* > merging `test_normalization` into this file [i.e. `test_unicodedata.py`] 
for clarity

* > These "boolean int" parameters could be actual `bool`s. [sc. the `nfc` and 
`k` parameters to `is_normalized_quickcheck`]

None of these are super hard, so good to knock them out while we're thinking of 
them.

--
components: Unicode
messages: 351229
nosy: Greg Price, benjamin.peterson, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: small cleanups in Unicode normalization code
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



[issue38032] lib2to3 doesn't parse Python 3 identifiers containing non-spacing marks

2019-09-05 Thread Ned Deily


Change by Ned Deily :


--
nosy:  -ned.deily
stage: resolved -> needs patch
versions: +Python 3.9 -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



[issue38015] inline function generates slightly inefficient machine code

2019-09-05 Thread Ma Lin


Ma Lin  added the comment:

Revert commit 5e63ab0 or use PR 15710, both are fine.

--

___
Python tracker 

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



[issue38032] lib2to3 doesn't parse Python 3 identifiers containing non-spacing marks

2019-09-05 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
resolution: not a bug -> 
status: closed -> open

___
Python tracker 

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



[issue38032] lib2to3 doesn't parse Python 3 identifiers containing non-spacing marks

2019-09-05 Thread Ned Deily


Ned Deily  added the comment:

> 2to3 should be able to parse valid Python 3 code.

OK, then should the original behavior here be treated as a bug and fixed?  If 
so, this issue should be re-opened.

--

___
Python tracker 

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



[issue38015] inline function generates slightly inefficient machine code

2019-09-05 Thread Ma Lin


Change by Ma Lin :


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

___
Python tracker 

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



[issue38032] lib2to3 doesn't parse Python 3 identifiers containing non-spacing marks

2019-09-05 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

2to3 should be able to parse valid Python 3 code.

--

___
Python tracker 

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



[issue38041] IDLE Shell: Refine restart line

2019-09-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage: patch review -> commit review
title: Refine IDLE Shell restart line -> IDLE Shell: Refine restart line

___
Python tracker 

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



[issue38035] shared_semaphores cannot be shared across unrelated processes

2019-09-05 Thread Vinay Sharma


Vinay Sharma  added the comment:

Let's say I have two processes which are accessing a shared resource (let's say 
shared memory). Now, these two processes will need some kind of synchronisation 
mechanism, to be able to access the resource properly, and avoid race condition.

Currently, shared semaphores can be shared with child processes, but there is 
no way of accessing a named shared semaphore by two separate processes.

Although, the semaphore created by default is a named semaphore, and has the 
potential to be accessed by multiple processes, but because of the flags, it 
can't be opened by any other process.

This is a feature request, and not a bug, therefore I have selected type as 
enhancement.

--

___
Python tracker 

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



[issue38041] Refine IDLE Shell restart line

2019-09-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: IDLE Shell: Redesign minimum restart line -> Refine IDLE Shell restart 
line

___
Python tracker 

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



[issue38041] IDLE Shell: Redesign minimum restart line

2019-09-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +15364
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/15709

___
Python tracker 

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



[issue38034] Typo on logging.handlers.QueueListener documentation

2019-09-05 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue38032] lib2to3 doesn't parse Python 3 identifiers containing non-spacing marks

2019-09-05 Thread Ned Deily


Ned Deily  added the comment:

Benjamin, can you answer Justin's question above?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue38039] Segfault when pickling dictionary with large pandas dataframes

2019-09-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

Can you provide the code that caused the segfault?

--
nosy: +eric.smith

___
Python tracker 

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



[issue38042] Crash on double list(lxml.etree.iterparse(f))

2019-09-05 Thread Alexander Kurakin


Change by Alexander Kurakin :


--
title: Crash on double list(lxml.etree.iterparse(f)) Edit -> Crash on double 
list(lxml.etree.iterparse(f))

___
Python tracker 

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



[issue38042] Crash on double list(lxml.etree.iterparse(f)) Edit

2019-09-05 Thread Alexander Kurakin


New submission from Alexander Kurakin :

I have a crash in Python 3.x environments and don't have in 2.7.

===

Crashes in:

Python 3.7.4, Anaconda, Linux 64bit, lxml 4.3.3
OR
Python 3.7.4, Anaconda, Linux 64bit, lxml 4.4.1
OR
Python 3.6.5, Gentoo Linux 64bit, lxml 4.3.3

test.py:

import lxml
import lxml.etree

with open('test.xml', 'rb') as f:
list(
lxml.etree.iterparse(f)
)

# Traceback (most recent call last):
# File "test.py", line 18, in 
# lxml.etree.iterparse(f)
# File "src/lxml/iterparse.pxi", line 209, in lxml.etree.iterparse.__next__
# File "src/lxml/iterparse.pxi", line 194, in lxml.etree.iterparse.__next__
# File "src/lxml/iterparse.pxi", line 225, in 
lxml.etree.iterparse._read_more_events
# File "src/lxml/parser.pxi", line 1380, in lxml.etree._FeedParser.close
# Segmentation fault
list(
lxml.etree.iterparse(f)
)

test.xml:




(or any else)

GDB's backtrace see in attachment.

===

Doesn't crash in:

Python 2.7.15, Gentoo Linux 64bit, lxml 4.3.3

# Traceback (most recent call last):
#   File "test.py", line 19, in 
# lxml.etree.iterparse(f)
#   File "src/lxml/iterparse.pxi", line 209, in lxml.etree.iterparse.__next__
#File "/home/sasha/_lxml-bug/test.xml", line 0
lxml.etree.XMLSyntaxError: no element found

===

See also: https://bugs.launchpad.net/lxml/+bug/1833050

--
files: bt.txt
messages: 351222
nosy: kuraga
priority: normal
severity: normal
status: open
title: Crash on double list(lxml.etree.iterparse(f)) Edit
type: crash
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file48595/bt.txt

___
Python tracker 

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



[issue37980] regression when passing numpy bools to sorted(..., reverse=r)

2019-09-05 Thread Ryan May


Change by Ryan May :


--
nosy: +Ryan May

___
Python tracker 

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



[issue38040] Typo: "Writeable" Should be "Writable" in IO Library Documentation

2019-09-05 Thread Sean Happenny


Sean Happenny  added the comment:

It is a minor issue and I understand that there are many, much more
important fixes and features the whole Python dev team is working on.

But reading the documentation for these classes indicates that these
classes may have a "writeable" member. If, as an example, the user then
needs to examine the implementation of these classes and searches for
"writeable" in the CPython, they'll find instances in comments, but not in
the code. This may cause them to miss the real spelling of the method
"writable()".

Also, another justification is that the documentation should be correct and
currently it is not. This fix should be a very simple find-and-replace, but
does touch multiple files (probably more than those I referenced) and I
understand how that is.

On Thu, Sep 5, 2019, 11:44 SilentGhost  wrote:

>
> SilentGhost  added the comment:
>
> There are more cases of using this spelling in the code base, but I
> personally don't see how any confusion can arise and why this "fix" is
> needed.
>
> --
> nosy: +SilentGhost
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue38032] lib2to3 doesn't parse Python 3 identifiers containing non-spacing marks

2019-09-05 Thread Justin Arthur


Justin Arthur  added the comment:

Ned, can you confirm that 2to3 is not intended for cumulative/incremental runs 
over the same codebase?

If it's not intended to be run on previously ported code, this will just need 
to be fixed on the lib2to3 downstream projects like awpa and Black that are 
encountering this issue.

--

___
Python tracker 

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



[issue14689] make PYTHONWARNINGS variable work in libpython

2019-09-05 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

@petere do you want to open a PR with your patch here: 
https://github.com/python/cpython/pulls

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue38041] IDLE Shell: Redesign minimum restart line

2019-09-05 Thread Terry J. Reedy


New submission from Terry J. Reedy :

Currently, Shell prints restart lines as 
=...= RESTART filename =...=
where filename is 'Shell' or the full pathname.  The code is 

tag = 'RESTART: ' + (filename if filename else 'Shell')
halfbar = ((int(console.width) -len(tag) - 4) // 2) * '='
console.write("\n{0} {1} {0}".format(halfbar, tag))

The initial '\n' is needed because typically the cursor is sitting at a prompt. 
 The -4 is from #21192 when I added 'Shell' or filename.  It is -2 for the 
spaces plus a couple of extra spaces that were there before.  I believe -2 is 
sufficient but will have to test to be sure.

The number of '='s is the currently the same on both ends.  (Because this is 
easiest.)  It does not have to be, and would sometimes not be if we exactly 
filled the console width.  I think we should because it would show the actual 
non-printable margin and would allow 

The minimum number of '='s is 0.  The problem revealed in
https://stackoverflow.com/questions/57795679/why-is-this-code-printing-an-empty-line-when-run-under-idle
is that if console.width is exactly 10 + len(filename), the remaining trailing 
space wraps to the next line, making it look like a spurious print(' ') had 
occurred.

Possible solutions:

0. Do nothing.  I rejected this by opening this issue.  The SO beginner was 
apparently genuinely confused and might not be the only such person.  With no 
spec for the restart line, this is not an implementation bug but is a design 
glitch.  As I hinted above, some current details are the result of adding 
filenames with minimal change.

1. Delete the ' 's surrounding the tag when there are no '='s.  This looks 
strange because the '='s visually mark a restart line as much as 'RESTART'.

2. Print a minimum of 1 '=' on each end (by adding them to the format). This 
could result in a wrap of exactly ' =' or '=', either of which are bad.  If 
there is any wrap, it should be the filename, so the user can recognize it as 
such.

3. A hybrid solution with a minimum of 1 '=' on the front and 0 on the end, 
with no space if no '='.  I intend to try this after extracting the restart 
line into a testable function and writing tests that now fail.

4. Add a horizontal scrollbar to Shell.  This not happening now, might be made 
optional, and would still require specification decisions.

--
assignee: terry.reedy
components: IDLE
messages: 351218
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE Shell: Redesign minimum restart line
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



[issue38040] Typo: "Writeable" Should be "Writable" in IO Library Documentation

2019-09-05 Thread SilentGhost


SilentGhost  added the comment:

There are more cases of using this spelling in the code base, but I personally 
don't see how any confusion can arise and why this "fix" is needed.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue38040] Typo: "Writeable" Should be "Writable" in IO Library Documentation

2019-09-05 Thread Sean Happenny


New submission from Sean Happenny :

Problem: There are 4 instances of the typo "writeable" in the documentation for 
the IO library affecting, at least, versions 3.7, 3.8, 3.9, and the latest 
master of the documentation 
(https://docs.python.org/[3.7,3.8,3.9]/library/io.html and 
https://github.com/python/cpython/blob/master/Doc/library/io.rst).  This can 
cause confusion to the reader.  The instances are under the "BufferedWriter" 
section (https://docs.python.org/3/library/io.html#io.BufferedWriter) and 
"BufferedRWPair" section 
(https://docs.python.org/3.7/library/io.html#io.BufferedRWPair).

Fix: Change all instances of "writeable" to "writable" in the IO library 
documentation.

--
assignee: docs@python
components: Documentation, IO
messages: 351216
nosy: Sean Happenny, docs@python
priority: normal
severity: normal
status: open
title: Typo: "Writeable" Should be "Writable" in IO Library Documentation
type: enhancement
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



[issue38032] lib2to3 doesn't parse Python 3 identifiers containing non-spacing marks

2019-09-05 Thread Ned Deily


Ned Deily  added the comment:

"2to3 is a Python program that reads Python 2.x source code and applies a 
series of fixers to transform it into valid Python 3.x code."

The example you supply, badvar,py, is not a valid Python 2.x program.  Python 2 
identifiers cannot contain such characters.

https://docs.python.org/3/library/2to3.html
https://docs.python.org/2/reference/lexical_analysis.html#identifiers
https://docs.python.org/3/reference/lexical_analysis.html#identifiers

--
nosy: +ned.deily
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



[issue38035] shared_semaphores cannot be shared across unrelated processes

2019-09-05 Thread Ned Deily


Ned Deily  added the comment:

Please give an example of how this is a problem in using Python. You don't give 
any context here.

--
nosy: +ned.deily

___
Python tracker 

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



[issue38038] Remove urllib.parse._splittype from xmlrpc.client

2019-09-05 Thread Dong-hee Na


Change by Dong-hee Na :


--
title: Remove urllib.parse._ from xmlrpc.client -> Remove 
urllib.parse._splittype from xmlrpc.client

___
Python tracker 

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



[issue38039] Segfault when pickling dictionary with large pandas dataframes

2019-09-05 Thread Ilya Valmianski


New submission from Ilya Valmianski :

Tried pickling a dictionary with multiple pandas tables and python primitive 
types. Pandas tables are large so full object size is ~200GB but system should 
not be OOM (crashed with ~300 GB system memory available). Reproduced on two 
machines running RHEL 7.5. Tried using Python 3.6 and 3.7. Tried pickle and 
dill. All python versions were installed as environments via Anaconda. All 
segfault in pickle. Here is a dump:

Fatal Python error: Segmentation fault

Current thread 0x7f724af23740 (most recent call first):
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 496 in save
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 805 in _batch_appends
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 781 in save_list
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 476 in save
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 751 in save_tuple
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 476 in save
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 634 in save_reduce
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 521 in save
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 847 in _batch_setitems
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 821 in save_dict
  File "/apps/anaconda3/lib/python3.6/site-packages/dill/_dill.py", line 893 in 
save_module_dict
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 476 in save
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 634 in save_reduce
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 521 in save
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 847 in _batch_setitems
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 821 in save_dict
  File "/apps/anaconda3/lib/python3.6/site-packages/dill/_dill.py", line 893 in 
save_module_dict
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 476 in save
  File "/apps/anaconda3/lib/python3.6/pickle.py", line 409 in dump
  File "/apps/anaconda3/lib/python3.6/site-packages/dill/_dill.py", line 286 in 
dump
  File "precompute_control_patients.py", line 220 in main
  File "/apps/anaconda3/lib/python3.6/site-packages/absl/app.py", line 251 in 
_run_main
  File "/apps/anaconda3/lib/python3.6/site-packages/absl/app.py", line 300 in 
run
  File "precompute_control_patients.py", line 227 in 

--
messages: 351213
nosy: Ilya Valmianski
priority: normal
severity: normal
status: open
title: Segfault when pickling dictionary with large pandas dataframes
type: crash
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue37064] Feature request: option to keep/add flags to pathfix.

2019-09-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3f43ceff186da09978d0aff257bb18b8ac7611f7 by Victor Stinner in 
branch 'master':
bpo-37064: Skip test_tools.test_pathfix if installed (GH-15705)
https://github.com/python/cpython/commit/3f43ceff186da09978d0aff257bb18b8ac7611f7


--

___
Python tracker 

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



[issue37878] Sub-Interpreters : Document PyThreadState_DeleteCurrent()

2019-09-05 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Joannah.

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



[issue37878] Sub-Interpreters : Document PyThreadState_DeleteCurrent()

2019-09-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2bc43cdc015eda4f1a651bb2b308a17a83c38e14 by Victor Stinner 
(Joannah Nanjekye) in branch 'master':
bpo-37878: Remove PyThreadState_DeleteCurrent() function (GH-15315)
https://github.com/python/cpython/commit/2bc43cdc015eda4f1a651bb2b308a17a83c38e14


--

___
Python tracker 

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



[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-09-05 Thread Steve Dower


Steve Dower  added the comment:

I triggered automatic backports to see how they go. Doesn't necessarily mean 
we'll merge them without looking more closely, but may as well check out what 
our automated tools suggest.

--

___
Python tracker 

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



[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-09-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15361
pull_request: https://github.com/python/cpython/pull/15707

___
Python tracker 

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



[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-09-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15360
pull_request: https://github.com/python/cpython/pull/15706

___
Python tracker 

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



[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-09-05 Thread Steve Dower


Change by Steve Dower :


--
stage: patch review -> backport needed
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



[issue15088] PyGen_NeedsFinalizing is public, but undocumented

2019-09-05 Thread STINNER Victor


STINNER Victor  added the comment:

The function is not documented nor tested.

I searched for usage of PyGen_NeedsFinalizing() in C code in GitHub:
https://github.com/search?l=C=1=PyGen_NeedsFinalizing=Code

I only found copies of the CPython code source: PyGen_NeedsFinalizing() 
definition in genobject.h.

IHMO we can safely remove the function right now. If someone complains, we can 
reintroduce it later. We just have to document clearly its removal at:
https://docs.python.org/dev/whatsnew/3.9.html#build-and-c-api-changes

--

___
Python tracker 

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



[issue15088] PyGen_NeedsFinalizing is public, but undocumented

2019-09-05 Thread STINNER Victor


STINNER Victor  added the comment:

PyGen_NeedsFinalizing() was added by:

commit 49fd7fa4431da299196d74087df4a04f99f9c46f
Author: Thomas Wouters 
Date:   Fri Apr 21 10:40:58 2006 +

Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
number of tests, all because of the codecs/_multibytecodecs issue described
here (it's not a Py3K issue, just something Py3K discovers):
http://mail.python.org/pipermail/python-dev/2006-April/064051.html

Hye-Shik Chang promised to look for a fix, so no need to fix it here. The
tests that are expected to break are:

test_codecencodings_cn
test_codecencodings_hk
test_codecencodings_jp
test_codecencodings_kr
test_codecencodings_tw
test_codecs
test_multibytecodec

This merge fixes an actual test failure (test_weakref) in this branch,
though, so I believe merging is the right thing to do anyway.

It was used in this gcmodule.c function:

/* Return true if object has a finalization method.
 * CAUTION:  An instance of an old-style class has to be checked for a
 *__del__ method, and earlier versions of this used to call PyObject_HasAttr,
 * which in turn could call the class's __getattr__ hook (if any).  That
 * could invoke arbitrary Python code, mutating the object graph in arbitrary
 * ways, and that was the source of some excruciatingly subtle bugs.
 */
static int
has_finalizer(PyObject *op)
{
if (PyInstance_Check(op)) {
assert(delstr != NULL);
return _PyInstance_Lookup(op, delstr) != NULL;
}
else if (PyType_HasFeature(op->ob_type, Py_TPFLAGS_HEAPTYPE))
return op->ob_type->tp_del != NULL;
else if (PyGen_CheckExact(op))
return PyGen_NeedsFinalizing((PyGenObject *)op);
else
return 0;
}


(2) The PEP 442 implementation made PyGen_NeedsFinalizing() useless:

commit 796564c27b8f2e32b9fbc034bbdda75f9507ca43
Author: Antoine Pitrou 
Date:   Tue Jul 30 19:59:21 2013 +0200

Issue #18112: PEP 442 implementation (safe object finalization).

Replaced:

/* Return true if object has a finalization method. */
static int
has_finalizer(PyObject *op)
{
if (PyGen_CheckExact(op))
return PyGen_NeedsFinalizing((PyGenObject *)op);
else
return op->ob_type->tp_del != NULL;
}

with:

/* Return true if object has a pre-PEP 442 finalization method. */
static int
has_legacy_finalizer(PyObject *op)
{
return op->ob_type->tp_del != NULL;
}

--

The last reference to PyGen_NeedsFinalizing() can be found in ceval.c:

case TARGET(SETUP_FINALLY): {
/* NOTE: If you add any new block-setup opcodes that
   are not try/except/finally handlers, you may need
   to update the PyGen_NeedsFinalizing() function.
   */

PyFrame_BlockSetup(f, SETUP_FINALLY, INSTR_OFFSET() + oparg,
   STACK_LEVEL());
DISPATCH();
}

--
nosy: +vstinner

___
Python tracker 

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



[issue37064] Feature request: option to keep/add flags to pathfix.

2019-09-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15359
pull_request: https://github.com/python/cpython/pull/15705

___
Python tracker 

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



[issue37064] Feature request: option to keep/add flags to pathfix.

2019-09-05 Thread STINNER Victor


STINNER Victor  added the comment:

The newly added test fails if Python is installed:

https://buildbot.python.org/all/#/builders/188/builds/927

==
FAIL: test_pathfix (test.test_tools.test_pathfix.TestPathfixFunctional)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora.installed/build/target/lib/python3.9/test/test_tools/test_pathfix.py",
 line 36, in test_pathfix
self.pathfix(
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora.installed/build/target/lib/python3.9/test/test_tools/test_pathfix.py",
 line 24, in pathfix
self.assertEqual(proc.returncode, 0, proc)
AssertionError: 2 != 0 : 
CompletedProcess(args=['/home/buildbot/buildarea/3.x.cstratak-fedora.installed/build/target/bin/python3.9',
 
'/home/buildbot/buildarea/3.x.cstratak-fedora.installed/build/target/lib/Tools/scripts/pathfix.py',
 '-i', '/usr/bin/python3', '-n', '@test_1589863_tmp'], returncode=2, 
stdout=b'', 
stderr=b"/home/buildbot/buildarea/3.x.cstratak-fedora.installed/build/target/bin/python3.9:
 can't open file 
'/home/buildbot/buildarea/3.x.cstratak-fedora.installed/build/target/lib/Tools/scripts/pathfix.py':
 [Errno 2] No such file or directory\n")

==
FAIL: test_pathfix_keeping_flags 
(test.test_tools.test_pathfix.TestPathfixFunctional)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora.installed/build/target/lib/python3.9/test/test_tools/test_pathfix.py",
 line 50, in test_pathfix_keeping_flags
self.pathfix(
  File 
"/home/buildbot/buildarea/3.x.cstratak-fedora.installed/build/target/lib/python3.9/test/test_tools/test_pathfix.py",
 line 24, in pathfix
self.assertEqual(proc.returncode, 0, proc)
AssertionError: 2 != 0 : 
CompletedProcess(args=['/home/buildbot/buildarea/3.x.cstratak-fedora.installed/build/target/bin/python3.9',
 
'/home/buildbot/buildarea/3.x.cstratak-fedora.installed/build/target/lib/Tools/scripts/pathfix.py',
 '-i', '/usr/bin/python3', '-k', '-n', '@test_1589863_tmp'], returncode=2, 
stdout=b'', 
stderr=b"/home/buildbot/buildarea/3.x.cstratak-fedora.installed/build/target/bin/python3.9:
 can't open file 
'/home/buildbot/buildarea/3.x.cstratak-fedora.installed/build/target/lib/Tools/scripts/pathfix.py':
 [Errno 2] No such file or directory\n")

--

___
Python tracker 

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



[issue15088] PyGen_NeedsFinalizing is public, but undocumented

2019-09-05 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

My searches show references to this function in CPython cloned repositories. 
From @pitrous's views, I think it is better to deprecate it with a removal 
notice for a later release.

I have deprecated the Function instead and will be removed in the next release 
in this PR https://github.com/python/cpython/pull/15702 .

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue37380] subprocess.Popen._cleanup() "The handle is invalid" error when some old process is gone

2019-09-05 Thread Chip Lynch


Chip Lynch  added the comment:

I see there is a merged patch for this 
(https://github.com/python/cpython/pull/14360); is it possible to get it tagged 
for backport to 3.7?  I haven't seen the 3.7.5 tag drop yet so wanted to 
recommend it's included, it's giving us fits.  On our Windows 10 dev boxes and 
Win 2016 servers, emanuel's repro fails 3.5.4, 3.6.8, 3.7.4, and 3.8.0b4, but 
not apparently 2.7 (I think we tested 2.7.12).  Per vstinner's request, I agree 
and would like to see it get a 3.7 and 3.8 backport.

Many thanks!

--
nosy: +Chip Lynch

___
Python tracker 

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



[issue36797] Cull more oudated distutils information

2019-09-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15358
pull_request: https://github.com/python/cpython/pull/15704

___
Python tracker 

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



[issue36797] Cull more oudated distutils information

2019-09-05 Thread miss-islington

miss-islington  added the comment:


New changeset 2c2b561967c1916855399f809e30ae0ba7e09ae2 by Miss Islington (bot) 
(Miro Hrončok) in branch 'master':
bpo-36797: Fix a dead link in  Doc/distutils/apiref (GH-15700)
https://github.com/python/cpython/commit/2c2b561967c1916855399f809e30ae0ba7e09ae2


--

___
Python tracker 

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



[issue37064] Feature request: option to keep/add flags to pathfix.

2019-09-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 50254ac4c179cb412e90682098c97db786143929 by Victor Stinner 
(PatrikKopkan) in branch 'master':
bpo-37064: Add option -k to Tools/scripts/pathfix.py (GH-15548)
https://github.com/python/cpython/commit/50254ac4c179cb412e90682098c97db786143929


--
nosy: +vstinner

___
Python tracker 

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



[issue37926] regression: PySys_SetArgvEx(0, NULL, 0): SystemError: Python-3.8.0b3/Objects/unicodeobject.c:2089: bad argument to internal function

2019-09-05 Thread STINNER Victor


STINNER Victor  added the comment:

FYI this bug was found in paraview in Fedora Rawhide: 
https://bugzilla.redhat.com/show_bug.cgi?id=1743896

--

___
Python tracker 

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



[issue38038] Remove urllib.parse._ from xmlrpc.client

2019-09-05 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue38038] Remove urllib.parse._ from xmlrpc.client

2019-09-05 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue38038] Remove urllib.parse._ from xmlrpc.client

2019-09-05 Thread Dong-hee Na


Change by Dong-hee Na :


--
versions: +Python 3.7

___
Python tracker 

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



[issue38038] Remove urllib.parse._ from xmlrpc.client

2019-09-05 Thread Dong-hee Na


New submission from Dong-hee Na :

This issue is the same as bpo-22347.
Let's remove the deprecated urllib.parse._splituser and urllib.parse._splittype 
from xmlrpc.client

--
components: Library (Lib)
messages: 351199
nosy: corona10, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Remove urllib.parse._ from xmlrpc.client
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



[issue38037] Assertion failed: object has negative ref count

2019-09-05 Thread Ma Lin


Ma Lin  added the comment:

I did a Git bisect, this is the first bad commit:
https://github.com/python/cpython/commit/9541bd321a94f13dc41163a5d7a1a847816fac84

nosy involved mates.

--
nosy: +berker.peksag, nanjekyejoannah

___
Python tracker 

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



[issue15088] PyGen_NeedsFinalizing is public, but undocumented

2019-09-05 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


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

___
Python tracker 

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



[issue38037] Assertion failed: object has negative ref count

2019-09-05 Thread Ma Lin


Change by Ma Lin :


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

___
Python tracker 

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



[issue36409] plistlib old API should be removed

2019-09-05 Thread Jon Janzen


Change by Jon Janzen :


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



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

2019-09-05 Thread Dong-hee Na


Dong-hee Na  added the comment:

@vstinner

Here is the new benchmark with you suggested.
It seems to affect performance.

== Baseline == 
Mean +- std dev: 134 ns +- 2 ns

== PR 15633 ==
Mean +- std dev: 174 ns +- 5 ns

--

___
Python tracker 

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



[issue36797] Cull more oudated distutils information

2019-09-05 Thread Miro Hrončok

Change by Miro Hrončok :


--
pull_requests: +15354
pull_request: https://github.com/python/cpython/pull/15700

___
Python tracker 

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



[issue35939] Remove urllib.parse._splittype from mimetypes.guess_type

2019-09-05 Thread Dong-hee Na


Change by Dong-hee Na :


--
resolution: fixed -> duplicate
superseder:  -> mimetypes.guess_type("//example.com") misinterprets host name 
as file name

___
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

2019-09-05 Thread STINNER Victor


STINNER Victor  added the comment:

"""
./python.exe -m timeit -r11 -s 'import datetime' -s 'a = 
datetime.datetime.now().isocalendar()'
5000 loops, best of 11: 8.72 nsec per loop

Let me know if the benchmark code is not appropriate
"""

Hum wait, this benchmark measures the performance of the pass opcode... That's 
why it's so fast :-) -s 'a = datetime.datetime.now().isocalendar()' is run 
exactly once for the whole benchmark, not at each benchmark iteration...

I suggest you this microbenchmark instead:

./python.exe -m pyperf timeit -s 'import datetime; dt = 
datetime.datetime.now()' 'dt.isocalendar()'

For example, on my Fedora 30 with Python 3.7.4, I get:

Mean +- std dev: 108 ns +- 4 ns

--

___
Python tracker 

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



[issue38037] Assertion failed: object has negative ref count

2019-09-05 Thread Ma Lin


New submission from Ma Lin :

Adding these two lines to /Objects/longobject.c will disable the "preallocated 
small integer pool":

#define NSMALLPOSINTS  0
#define NSMALLNEGINTS  0

Then run this reproduce code (attached):

from enum import IntEnum
import _signal

class Handlers(IntEnum):
A = _signal.SIG_DFL
B = _signal.SIG_IGN

When the interpreter exits, will get this error:

d:\dev\cpython\PCbuild\win32>python_d.exe d:\a.py
d:\dev\cpython\include\object.h:541: _Py_NegativeRefcount: Assertion 
failed: object has negative ref count

Fatal Python error: _PyObject_AssertFailed

Current thread 0x200c (most recent call first):

3.8 and 3.9 branches are affected.
I'm sorry, this issue is beyond my ability.

--
files: reproduce.py
messages: 351196
nosy: Ma Lin
priority: normal
severity: normal
status: open
title: Assertion failed: object has negative ref count
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48594/reproduce.py

___
Python tracker 

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



[issue18049] Re-enable threading test on macOS

2019-09-05 Thread STINNER Victor


STINNER Victor  added the comment:

> Ronald, is it feasible that the changes made in 
> https://github.com/python/cpython/pull/14748/files to THREAD_STACK_SIZE in 
> Python/thread_pthread.h could be causing intermittent failures for the Azure 
> macOS PR tests?

See also bpo-37245 ("Azure Pipeline 3.8 CI: multiple tests hung and timed out 
on macOS 10.13").

--

___
Python tracker 

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



[issue37245] Azure Pipeline 3.8 CI: multiple tests hung and timed out on macOS 10.13

2019-09-05 Thread Kyle Stanley


Kyle Stanley  added the comment:

It looks like the Azure macOS tests timed out again in the recently opened 
PR-15688. Specifically, for test_multiprocessing_spawn and test_functools (both 
of which also timed out in PR-15651, which Victor mentioned earlier):

0:26:41 load avg: 2.89 [418/419/1] test_multiprocessing_spawn crashed (Exit 
code 1) -- running: test_functools (14 min 38 sec)
Timeout (0:20:00)!

0:32:03 load avg: 3.17 [419/419/2] test_functools crashed (Exit code 1)
Timeout (0:20:00)!

Build logs: 
https://dev.azure.com/Python/cpython/_build/results?buildId=49868=logs=18d1a34d-6940-5fc1-f55b-405e2fba32b1

As far as I can tell, PR-15688 should have had no direct influence on 
test_multiprocessing_spawn or test_functools.

> Maybe macOS on Azure is running slower and we should just increase the 
> timeout?

> Yeah, I agree that increasing the timeout shouldn't be the answer here. 

Since this seems to be affecting multiple PRs, would it be appropriate to 
attempt to increase the timeout duration as a temporary fix and open an issue 
for further investigation on the cause of the intermittent slowdown on those 
tests?

--
nosy: +aeros167

___
Python tracker 

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



[issue32689] shutil.move raises AttributeError if first argument is a pathlib.Path object and destination is a directory

2019-09-05 Thread Maxwell McKinnon


Change by Maxwell McKinnon :


--
nosy: +bodom

___
Python tracker 

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



[issue37402] Fatal Python error: Cannot recover from stack overflow issues on Python 3.6 and 3.7

2019-09-05 Thread hongweipeng


hongweipeng  added the comment:

According to the provided text.py file. `__exit__` will always execute due to 
the `with` syntax. It looks like this:
```
def rec():
try:
rec()
except RecursionError:
rec()

rec()
```

--
nosy: +hongweipeng

___
Python tracker 

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



[issue37934] Docs: Clarify NotImplemented use cases

2019-09-05 Thread Vedran Čačić

Vedran Čačić  added the comment:

Of course, if there are independent use cases already in the codebase, then my 
opinion is changed.

--

___
Python tracker 

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



[issue36409] plistlib old API should be removed

2019-09-05 Thread Ronald Oussoren


Ronald Oussoren  added the comment:


New changeset ce81a925ef2d466b0d801deaba9af44a0dfc2aa1 by Ronald Oussoren (Jon 
Janzen) in branch 'master':
bpo-36409: Remove old plistlib API deprecated in 3.4 (GH-15615)
https://github.com/python/cpython/commit/ce81a925ef2d466b0d801deaba9af44a0dfc2aa1


--

___
Python tracker 

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



[issue36324] Inverse cumulative normal distribution function

2019-09-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset f5649bfe7622447b302ef55e4db3a96b5840f8e8 by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-36324:  Apply review comment from Jake Vanderplas (GH-15695) (GH-15696)
https://github.com/python/cpython/commit/f5649bfe7622447b302ef55e4db3a96b5840f8e8


--

___
Python tracker 

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



[issue36324] Inverse cumulative normal distribution function

2019-09-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 9b51570ffd0494c07dafe10c7d2afe865754694c by Raymond Hettinger in 
branch 'master':
bpo-36324:  Apply review comment from Jake Vanderplas (GH-15695)
https://github.com/python/cpython/commit/9b51570ffd0494c07dafe10c7d2afe865754694c


--

___
Python tracker 

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



[issue36324] Inverse cumulative normal distribution function

2019-09-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15353
pull_request: https://github.com/python/cpython/pull/15696

___
Python tracker 

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



[issue38036] ssl docs say that ssl.SSLContext() is secure-by-default since 3.6, but it isn't

2019-09-05 Thread Christian Heimes


Christian Heimes  added the comment:

Indeed, the text is misleading. "secure default values" refers to 
SSLContext.options only (no compression, "good" TLS versions) and not to cert 
and host name verification.

--

___
Python tracker 

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



[issue36324] Inverse cumulative normal distribution function

2019-09-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +15352
pull_request: https://github.com/python/cpython/pull/15695

___
Python tracker 

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



[issue36324] Inverse cumulative normal distribution function

2019-09-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset dafbe3265657dc5a5c46e762080023f0aa25ec58 by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-36324:  Apply review comments from Allen Downey (GH-15693) (GH-15694)
https://github.com/python/cpython/commit/dafbe3265657dc5a5c46e762080023f0aa25ec58


--

___
Python tracker 

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



[issue38036] ssl docs say that ssl.SSLContext() is secure-by-default since 3.6, but it isn't

2019-09-05 Thread Nathaniel Smith


New submission from Nathaniel Smith :

Quoting from the docs for ssl.SSLContext:

"Changed in version 3.6: The context is created with secure default values."
- https://docs.python.org/3/library/ssl.html#ssl.SSLContext

This is not true. If you call ssl.SSLContext(), you get a context with cert 
validation entirely disabled. And this has led to serious security bugs in 
practice: https://github.com/theelous3/asks/issues/134

Changing the defaults to make them actually secure would of course be nice, but 
is a complicated question that would need discussion. In the mean time, the 
docs shouldn't claim that it's secure. There should be a big bold note saying 
"UNLESS YOU HAVE A VERY GOOD REASON, DON'T USE THIS, USE 
ssl.create_default_connection()".

--
messages: 351186
nosy: alex, christian.heimes, dstufft, janssen, njs
priority: normal
severity: normal
status: open
title: ssl docs say that ssl.SSLContext() is secure-by-default since 3.6, but 
it isn't

___
Python tracker 

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



[issue18049] Re-enable threading test on macOS

2019-09-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

@aeros167 The build log failures due to timeout in the linked Azure pipeline 
failure seem to be similar to report at issue37245

--
nosy: +xtreak

___
Python tracker 

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



[issue36324] Inverse cumulative normal distribution function

2019-09-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset e4810b2a6c1d0db1a27ad046831b8fa3b57967a4 by Raymond Hettinger in 
branch 'master':
bpo-36324:  Apply review comments from Allen Downey (GH-15693)
https://github.com/python/cpython/commit/e4810b2a6c1d0db1a27ad046831b8fa3b57967a4


--

___
Python tracker 

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



[issue36324] Inverse cumulative normal distribution function

2019-09-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15351
pull_request: https://github.com/python/cpython/pull/15694

___
Python tracker 

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



[issue38034] Typo on logging.handlers.QueueListener documentation

2019-09-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. Would you be able to make a PR for this? I think this is 
a good newcomer friendly issue.

--
nosy: +vinay.sajip, xtreak
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



[issue37669] Make mock_open return per-file content

2019-09-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Using a side_effect is one way to achieve this currently if I understand the 
use case correctly. For every open side_effect will be called and hence it will 
return a new mock_open with read_data for the given filename used inside the 
context. This can handle nested calls since each will have it's own mock_open 
object. PR seems to do similar approach to refactor out to created predefined 
mock_open per filename and to return objects from a dictionary.


from unittest.mock import mock_open, patch

DEFAULT_MOCK_DATA = "default mock data"
data_dict = {"file1": "data1",
 "file2": "data2"}

def open_side_effect(name):
return mock_open(read_data=data_dict.get(name, DEFAULT_MOCK_DATA))()

with patch(f"{__name__}.open", side_effect=open_side_effect):
with open("file1") as file1:
assert file1.read() == "data1"

with open("file2") as file2:
assert file2.read() == "data2"

with open("file1") as file3:
assert file3.read(1) == "d"

assert file1.read() == ""

with open("defaultfile") as file4:
assert file4.read() == "default mock data"

--

___
Python tracker 

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



[issue36324] Inverse cumulative normal distribution function

2019-09-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +15350
pull_request: https://github.com/python/cpython/pull/15693

___
Python tracker 

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



[issue37934] Docs: Clarify NotImplemented use cases

2019-09-05 Thread Kyle Stanley


Kyle Stanley  added the comment:

> As you say, we currently have only one usage of NotImplemented outside its 
> intended purpose. Maybe we should wait to see whether it becomes at least a 
> little bit more popular, before thinking about blessing it.

> I know at least 3 in CPython, so it's not so rare to use NotImplemented for 
> something else than binary operators


I'm thinking that it might be worthwhile to start a discussion about this on 
python-dev, to see what the others think about how the NotImplemented docs 
should be defined, and whether or not it should be used outside of binary 
operators.

Based on the feedback from Raymond and Vedran, I'm in agreement that it might 
not be the best idea in the long term to keep adding additional use cases to 
the documentation. But, it really doesn't make much sense to me that the 
constant is entirely defined around a single use case in the doc while we're 
using it for other purposes throughout CPython.

--

___
Python tracker 

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



[issue18049] Re-enable threading test on macOS

2019-09-05 Thread Kyle Stanley


Kyle Stanley  added the comment:

Ronald, is it feasible that the changes made in 
https://github.com/python/cpython/pull/14748/files to THREAD_STACK_SIZE in 
Python/thread_pthread.h could be causing intermittent failures for the Azure 
macOS PR tests?

In a recent PR (https://github.com/python/cpython/pull/15651), 
test_pending_calls_race (test.test_concurrent_futures.ThreadPoolWaitTests) 
seemed to be timing out. See the build log for more details:  
https://dev.azure.com/Python/cpython/_build/results?buildId=49786=logs=18d1a34d-6940-5fc1-f55b-405e2fba32b1.

It doesn't appear to be causing consistent failures for Azure, but the latest 
commit to PR-15651 was only involving a formatting change to the news entry, so 
it should not have had any influence on the test that timed out. Prior to that 
commit, there were no CI failures.

--
nosy: +aeros167

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-09-05 Thread Niels Albers


Niels Albers  added the comment:

Thanks Srinivas for the suggestion. IMO exception chaining has more utility 
than only dealing with new exceptions that are caused by exception handling. 
It's all about preserving exception context. As both a writer of libraries and 
a user of such, I do like to have a full context chain when I have to handle an 
exception (or more importantly as a devops engineeer: log it)

Is this edit acceptable?

"If you need to track exception context, you can use exception chaining. You 
can chain exceptions by using the ``from`` clause. Just raise a new exception 
class or instance from an existing exception. The existing exception will be 
set as 
the cause for the new exception."

--

___
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

2019-09-05 Thread Tal Einat


Tal Einat  added the comment:

> Would it be possible to tell pickle to serialize .isocalendar() as a tuple, 
> and deserialize it from a tuple to a structseq?

The former is possible but that latter is not: If the object is pickled as a 
tuple, it will always be unpickled as a simple tuple. To customize unpickling, 
the serialized data must include the name of the class to use, and that class 
will never exist in earlier Python versions. I don't think there's a way around 
this.

However, I find Raymond's note very convincing, in that we should likely not 
let the unpickling issue get in the way of this improvement:

> FWIW, most things in Python that return a structseq previously returned a 
> tuple (for example, time.localtime() and sys.version_info).
>
> This is not an unprecedented upgrade to improve the repr and provide access 
> by field name in addition to positional access.

--

___
Python tracker 

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