[issue37545] Argparse Tutorial - unreasonable operators

2019-07-11 Thread Aldwin Pollefeyt


Aldwin Pollefeyt  added the comment:

@Zachary, you are right ... the last one should be >= 1. Now i see the 
difference with the previous examples. It changed the output drastically from 
"the square of {} equals {}" vs "{}^2 == {}" to suddenly printing the filename 
at -vv. I was focused more on the structural change to always print answer. ... 
I will adjust.

--

___
Python tracker 

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



[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-11 Thread Neil Schemenauer


Change by Neil Schemenauer :


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

___
Python tracker 

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



[issue37544] Multiple test failures during build

2019-07-11 Thread Jarek Zgoda


Jarek Zgoda  added the comment:

test.pythoninfo output

--
Added file: https://bugs.python.org/file48467/test.pythoninfo.txt

___
Python tracker 

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



[issue37544] Multiple test failures during build

2019-07-11 Thread Jarek Zgoda


Jarek Zgoda  added the comment:

make test output from unoptimized build with --disable-shared 
--prefix=/opt/python-3.7.4

--
Added file: https://bugs.python.org/file48468/3.7.4-test_output.txt

___
Python tracker 

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



[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-11 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

I tweaked the list of unit tests a little more, trying to incorporate some from 
your Docker build settings.  Not sure what's going on with the pickle results.  
Below are new pyperformance runs, comparing my PR to the "master" version it is 
based on.

I added the --with-profile-task configure option.  If someone really wants to 
wait for a long build to gain a tiny bit of extra speed, that makes it pretty 
easy to do so.

BTW, I tried making the --pgo disable most of the gc_collect() calls.  It 
doesn't actually make much difference in profile generation time so I discarded 
those changes.

--

___
Python tracker 

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



[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-11 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

+-+---+-+
| Benchmark   | task-all2 | task-short7 |
+=+===+=+
| 2to3| 304 ms| 305 ms: 1.00x slower (+0%)  |
+-+---+-+
| crypto_pyaes| 109 ms| 107 ms: 1.01x faster (-1%)  |
+-+---+-+
| django_template | 116 ms| 109 ms: 1.06x faster (-6%)  |
+-+---+-+
| dulwich_log | 76.8 ms   | 77.0 ms: 1.00x slower (+0%) |
+-+---+-+
| fannkuch| 454 ms| 449 ms: 1.01x faster (-1%)  |
+-+---+-+
| float   | 113 ms| 112 ms: 1.02x faster (-2%)  |
+-+---+-+
| hexiom  | 9.50 ms   | 9.56 ms: 1.01x slower (+1%) |
+-+---+-+
| html5lib| 93.4 ms   | 95.4 ms: 1.02x slower (+2%) |
+-+---+-+
| json_loads  | 24.7 us   | 26.5 us: 1.07x slower (+7%) |
+-+---+-+
| logging_format  | 9.55 us   | 9.63 us: 1.01x slower (+1%) |
+-+---+-+
| logging_simple  | 8.54 us   | 8.72 us: 1.02x slower (+2%) |
+-+---+-+
| nbody   | 131 ms| 130 ms: 1.01x faster (-1%)  |
+-+---+-+
| nqueens | 93.6 ms   | 92.8 ms: 1.01x faster (-1%) |
+-+---+-+
| pathlib | 19.0 ms   | 19.1 ms: 1.01x slower (+1%) |
+-+---+-+
| pickle_list | 2.72 us   | 2.66 us: 1.02x faster (-2%) |
+-+---+-+
| pidigits| 168 ms| 168 ms: 1.00x faster (-0%)  |
+-+---+-+
| python_startup  | 7.89 ms   | 7.89 ms: 1.00x slower (+0%) |
+-+---+-+
| python_startup_no_site  | 5.41 ms   | 5.41 ms: 1.00x slower (+0%) |
+-+---+-+
| raytrace| 470 ms| 481 ms: 1.02x slower (+2%)  |
+-+---+-+
| regex_compile   | 168 ms| 169 ms: 1.01x slower (+1%)  |
+-+---+-+
| regex_dna   | 168 ms| 173 ms: 1.03x slower (+3%)  |
+-+---+-+
| regex_effbot| 2.91 ms   | 2.72 ms: 1.07x faster (-7%) |
+-+---+-+
| regex_v8| 20.4 ms   | 21.1 ms: 1.03x slower (+3%) |
+-+---+-+
| richards| 67.6 ms   | 66.9 ms: 1.01x faster (-1%) |
+-+---+-+
| scimark_fft | 341 ms| 339 ms: 1.01x faster (-1%)  |
+-+---+-+
| scimark_monte_carlo | 101 ms| 98.2 ms: 1.03x faster (-3%) |
+-+---+-+
| scimark_sparse_mat_mult | 4.05 ms   | 3.97 ms: 1.02x faster (-2%) |
+-+---+-+
| spectral_norm   | 128 ms| 129 ms: 1.01x slower (+1%)  |
+-+---+-+
| sqlalchemy_imperative   | 30.0 ms   | 30.4 ms: 1.01x slower (+1%) |
+-+---+-+
| sympy_expand| 408 ms| 411 ms: 1.01x slower (+1%)  |
+-+---+-+
| sympy_sum   | 90.1 ms   | 89.6 ms: 1.01x faster (-1%) |
+-+---+-+
| sympy_str   | 182 ms| 180 ms: 1.01x faster (-1%)  |
+-+---+-+
| tornado_http| 175 ms| 179 ms: 1.03x slower (+3%)  |
+-+---+-+
| unpack_sequence | 50.0 ns   | 47.5 ns: 1.05x faster (-5%) |
+-+---+

[issue37558] Shared memory tests are failing due to double slashes

2019-07-11 Thread Jakub Kulik


New submission from Jakub Kulik :

Hi,

with the addition of shared memory into Python 3.8, we now have three tests 
failing on Solaris, namely `test_multiprocessing_fork`, 
`test_multiprocessing_forkserver` and `test_multiprocessing_spawn`. All of them 
fail in the same way:

==
ERROR: test_shared_memory_cleaned_after_process_termination 
(test.test_multiprocessing_fork.WithProcessesTestSharedMemory)
--
Traceback (most recent call last):
  File ".../Python-3.8.0b2/Lib/test/_test_multiprocessing.py", line 4013, in 
test_shared_memory_cleaned_after_process_termination
smm = shared_memory.SharedMemory(name, create=False)
  File ".../Python-3.8.0b2/Lib/multiprocessing/shared_memory.py", line 100, in 
__init__
self._fd = _posixshmem.shm_open(
OSError: [Errno 22] Invalid argument: '//psm_5c1b5800'

The reason for this, in my opinion, is that the test suite is accessing private 
`sm._name` instead of the normalized `sm.name`. Returned value already has one 
slash prepended, and another one is prepended SharedMemory init is called, 
resulting in double slashes, which is incorrect.

Change to `sm.name` fixes this problem.

--
components: Tests
messages: 347662
nosy: kulikjak
priority: normal
severity: normal
status: open
title: Shared memory tests are failing due to double slashes
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



[issue37558] Shared memory tests are failing due to double slashes

2019-07-11 Thread Jakub Kulik


Change by Jakub Kulik :


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

___
Python tracker 

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



[issue37547] Add _PyObject_CallMethodOneArg()

2019-07-11 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 59ad110d7a7784d53d0b502eebce0346597a6bef by Inada Naoki (Jeroen 
Demeyer) in branch 'master':
bpo-37547: add _PyObject_CallMethodOneArg (GH-14685)
https://github.com/python/cpython/commit/59ad110d7a7784d53d0b502eebce0346597a6bef


--

___
Python tracker 

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



[issue37547] Add _PyObject_CallMethodOneArg()

2019-07-11 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2019-07-11 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

I understand the arguments for not removing these functions. However, I still 
think that we should deprecate them but without planning in advance when they 
should be removed. Victor said that we should document these functions as 
"please don't use them", and that is exactly what a deprecation message 
accomplishes.

Most other projects that I know have only a minimum deprecation period (i.e. 
feature X can only be removed if it was deprecated for Y time). I don't 
understand why CPython insists that the minimum of 2 releases should also be a 
maximum (i.e. feature X MUST be removed after it was deprecated for Y time). I 
don't see the problem with long-term deprecations for stuff that we don't plan 
to remove soon.

--
nosy: +jdemeyer

___
Python tracker 

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



[issue37524] IDLE error on closing 3.8+ debug build

2019-07-11 Thread Tal Einat


Tal Einat  added the comment:

Doesn't reproduce on Win10 with current master.

--

___
Python tracker 

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



[issue37559] IDLE: Scrolling issues with code context shown

2019-07-11 Thread Tal Einat


New submission from Tal Einat :

With code context shown, scrolling a window by dragging the scrollbar causes 
the scrollbar's tab to "jump around" and sometimes some "flashing" visual 
artifacts.

The "flashing" appears to occur only before the screen is resized for the first 
time, in which case the entire window is resized whenever the number of context 
lines changes during scrolling.

See attached animated screen capture.

Reproduced on latest versions of Win10 and macOS.

See also PR GH-14030, adding line numbers, which makes this more likely to 
occur for users.

--
assignee: terry.reedy
components: IDLE
files: code-context-scolling-compressed.gif
messages: 347666
nosy: cheryl.sabella, taleinat, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Scrolling issues with code context shown
versions: Python 3.7, Python 3.8, Python 3.9
Added file: 
https://bugs.python.org/file48469/code-context-scolling-compressed.gif

___
Python tracker 

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



[issue37560] with cgi.FieldStorage(...) fails on cleanup with AttributeError, missing try/except in __exit__

2019-07-11 Thread Stefanik Gábor

New submission from Stefanik Gábor :

cgi.FieldStorage has this for its __del__ method:

def __del__(self):
try:
self.file.close()
except AttributeError:
pass

By contrast, __exit__ is missing the exception handler:

def __exit__(self, *args):
self.file.close()

Because self.file isn't populated in every instance of the FieldStorage class, 
this can cause FieldStorage to fail with AttributeError when used in a with 
statement.

--
components: Library (Lib)
messages: 347667
nosy: Stefanik Gábor
priority: normal
severity: normal
status: open
title: with cgi.FieldStorage(...) fails on cleanup with AttributeError, missing 
try/except in __exit__
type: behavior
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



[issue37549] os.dup() fails for standard streams on Windows 7

2019-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, os.dup() doc says: "On Windows, when duplicating a standard stream (0: 
stdin, 1: stdout, 2: stderr), the new file descriptor is inheritable."
https://docs.python.org/dev/library/os.html

Maybe we should add an inheritable paramater to os.dup() in Python 3.8?

--

___
Python tracker 

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



[issue37559] IDLE: Scrolling issues with code context shown

2019-07-11 Thread Tal Einat


Change by Tal Einat :


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

___
Python tracker 

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



[issue37550] SSL Pip Error

2019-07-11 Thread Christian Heimes


Christian Heimes  added the comment:

Please provide more information. What is your operating system, how did you 
install Python, and which error message are you getting?

--

___
Python tracker 

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



[issue37561] the _sysconfigdata name should not encode MACHDEP and PLATFORM_TRIPLET

2019-07-11 Thread Matthias Klose


New submission from Matthias Klose :

so issue28046 decided to encode both MACHDEP and PLATFORM_TRIPLET/MULTIARCH in 
the _sysconfigdata name.  Unfortunately on KFreeBSD MACHDEP includes the kernel 
version, so you end up with a changing MACHDEP.  The _sysconfigdata name should 
only encode the MULTIARCH triplet, and if that's not define, the MACHDEP.  
Working on a fix.

--
messages: 347670
nosy: doko
priority: normal
severity: normal
status: open
title: the _sysconfigdata name should not encode MACHDEP and PLATFORM_TRIPLET
versions: Python 3.8

___
Python tracker 

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



[issue37549] os.dup() fails for standard streams on Windows 7

2019-07-11 Thread Eryk Sun


Eryk Sun  added the comment:

> os.dup() doc says: "On Windows, when duplicating a standard stream 
> (0: stdin, 1: stdout, 2: stderr), the new file descriptor is 
> inheritable."

That's not necessarily correct. For example, if stdout is a pipe or disk file:

C:\>python -V
Python 3.7.3

C:\>python -c "import os; fd = os.dup(1); print(os.get_inheritable(fd))" | 
more
False

C:\>python -c "import os; fd = os.dup(1); print(os.get_inheritable(fd))" > 
stdout.txt

C:\>type stdout.txt
False

What 3.7.3 does is to skip calling _Py_set_inheritable for all files of type 
FILE_TYPE_CHAR, which is wrong for character devices in general, such as NUL 
and serial ports. NUL is a common target for standard I/O redirection.

--

___
Python tracker 

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



[issue37562] PEP 590 implementation introduced a performance regression

2019-07-11 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

Many functions are significantly slower after commit 
aacc77fbd77640a8f03638216fa09372cc21673d was applied:

aacc77fbd77640a8f03638216fa09372cc21673d is the first bad commit
commit aacc77fbd77640a8f03638216fa09372cc21673d
Author: Jeroen Demeyer 
Date:   Wed May 29 20:31:52 2019 +0200

bpo-36974: implement PEP 590 (GH-13185)


Co-authored-by: Jeroen Demeyer 
Co-authored-by: Mark Shannon 


Experiment in 3.8 
-

./python -m perf timeit -s '_len=len' '_len("hello")'
.
Mean +- std dev: 157 ns +- 3 ns


Experiment in parent of aacc77fbd77640a8f03638216fa09372cc21673d


python -m perf timeit -s '_len=len' '_len("hello")'
.
Mean +- std dev: 133 ns +- 3 ns


The same regression happens consistently in many other functions (hex, len, 
deque methods)

--
components: Interpreter Core
keywords: 3.8regression
messages: 347672
nosy: Mark.Shannon, jdemeyer, pablogsal, petr.viktorin, rhettinger
priority: high
severity: normal
status: open
title: PEP 590 implementation introduced a performance regression
type: performance
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



[issue37562] PEP 590 implementation introduced a performance regression

2019-07-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I have bisected again and I always get commit 
aacc77fbd77640a8f03638216fa09372cc21673d but it would be great if someone can 
confirm these results independently.

--

___
Python tracker 

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



[issue24338] In argparse adding wrong arguments makes malformed namespace

2019-07-11 Thread tomas platz


Change by tomas platz :


Added file: https://bugs.python.org/file48470/126.pdf

___
Python tracker 

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



[issue24338] In argparse adding wrong arguments makes malformed namespace

2019-07-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


Removed file: https://bugs.python.org/file48470/126.pdf

___
Python tracker 

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



[issue37562] PEP 590 implementation introduced a performance regression

2019-07-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is the stack difference for my previous experiment:

   * frame #0: 0x0001001578ee 
python.exe`unicode_length(self=0x00010140d220) at unicodeobject.c:12231:9
frame #1: 0x0001b453 python.exe`PyObject_Size(o=0x00010140d220) 
at abstract.c:57:26
frame #2: 0x0001001cea29 
python.exe`builtin_len(module=0x0001006ad280, obj=0x00010140d220) at 
bltinmodule.c:1548:11
frame #3: 0x000100044518 
python.exe`_PyMethodDef_RawFastCallKeywords(method=0x0001003e5540, 
self=0x0001006ad280, args=0x0001013f0e10, nargs=1, 
kwnames=0x) at call.c:656:18
frame #4: 0x00010004487a 
python.exe`_PyCFunction_FastCallKeywords(func=0x0001006af210, 
args=0x0001013f0e10, nargsf=9223372036854775809, 
kwnames=0x) at call.c:743:14
frame #5: 0x0001001edc09 
python.exe`_PyObject_Vectorcall(callable=0x0001006af210, 
args=0x0001013f0e10, nargsf=9223372036854775809, 
kwnames=0x) at abstract.h:128:21
frame #6: 0x0001001eaa6a 
python.exe`call_function(tstate=0x000101103910, 
pp_stack=0x7ffeefbfdc50, oparg=1, kwnames=0x) at 
ceval.c:4859:13
frame #7: 0x0001001e5436 
python.exe`_PyEval_EvalFrameDefault(f=0x0001013f0c90, throwflag=0) at 
ceval.c:3356:19


---


  * frame #0: 0x000100153f7e 
python.exe`unicode_length(self=0x000101526580) at unicodeobject.c:12231:9
frame #1: 0x0001a623 python.exe`PyObject_Size(o=0x000101526580) 
at abstract.c:57:26
frame #2: 0x0001001cab69 
python.exe`builtin_len(module=0x0001006a4280, obj=0x000101526580) at 
bltinmodule.c:1548:11
frame #3: 0x000100042d28 
python.exe`_PyMethodDef_RawFastCallKeywords(method=0x0001003deff0, 
self=0x0001006a4280, args=0x00010150fe10, nargs=1, 
kwnames=0x) at call.c:650:18
frame #4: 0x00010004144d 
python.exe`_PyCFunction_FastCallKeywords(func=0x0001006a6210, 
args=0x00010150fe10, nargs=1, kwnames=0x) at call.c:736:14
frame #5: 0x0001001e6c5e 
python.exe`call_function(tstate=0x000101103910, 
pp_stack=0x7ffeefbfdc40, oparg=1, kwnames=0x) at 
ceval.c:4825:9
frame #6: 0x0001001e1561 
python.exe`_PyEval_EvalFrameDefault(f=0x00010150fc90, throwflag=0) at 
ceval.c:3356:19

--

___
Python tracker 

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



[issue37562] PEP 590 implementation introduced a performance regression

2019-07-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Updated stack for the tip of 3.8:

  * frame #0: 0x00010015854e 
python.exe`unicode_length(self=0x0001014a4040) at unicodeobject.c:12235:9
frame #1: 0x0001a913 python.exe`PyObject_Size(o=0x0001014a4040) 
at abstract.c:57:26
frame #2: 0x0001001cf709 
python.exe`builtin_len(module=0x0001006b22f0, obj=0x0001014a4040) at 
bltinmodule.c:1551:11
frame #3: 0x000100043fd8 
python.exe`_PyMethodDef_RawFastCallKeywords(method=0x0001003e8ac0, 
self=0x0001006b22f0, args=0x0001013f5e10, nargs=1, 
kwnames=0x) at call.c:650:18
frame #4: 0x00010004433a 
python.exe`_PyCFunction_Vectorcall(func=0x0001006b4280, 
args=0x0001013f5e10, nargsf=9223372036854775809, 
kwnames=0x) at call.c:737:14
frame #5: 0x0001001eec89 
python.exe`_PyObject_Vectorcall(callable=0x0001006b4280, 
args=0x0001013f5e10, nargsf=9223372036854775809, 
kwnames=0x) at abstract.h:127:11
frame #6: 0x0001001ebc2a 
python.exe`call_function(tstate=0x000101103950, 
pp_stack=0x7ffeefbfdc30, oparg=1, kwnames=0x) at 
ceval.c:4987:13
frame #7: 0x0001001e65ef 
python.exe`_PyEval_EvalFrameDefault(f=0x0001013f5c90, throwflag=0) at 
ceval.c:3500:19

--

___
Python tracker 

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



[issue37559] IDLE: Scrolling issues with code context shown

2019-07-11 Thread Tal Einat


Change by Tal Einat :


--
pull_requests:  -14503

___
Python tracker 

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



[issue37559] IDLE: Scrolling issues with code context shown

2019-07-11 Thread Tal Einat


Change by Tal Einat :


--
stage: patch review -> 
type:  -> behavior

___
Python tracker 

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



[issue34369] kqueue.control() documentation and implementation mismatch

2019-07-11 Thread Tal Einat


Change by Tal Einat :


--
versions: +Python 3.8, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue34369] kqueue.control() documentation and implementation mismatch

2019-07-11 Thread Tal Einat


Tal Einat  added the comment:


New changeset 79042ac4348ccc09344014f20dd49401579f8795 by Tal Einat in branch 
'master':
bpo-34369: make kqueue.control() docs better reflect that timeout is 
positional-only (GH-9499)
https://github.com/python/cpython/commit/79042ac4348ccc09344014f20dd49401579f8795


--

___
Python tracker 

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



[issue34369] kqueue.control() documentation and implementation mismatch

2019-07-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14505
pull_request: https://github.com/python/cpython/pull/14705

___
Python tracker 

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



[issue34369] kqueue.control() documentation and implementation mismatch

2019-07-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14504
pull_request: https://github.com/python/cpython/pull/14704

___
Python tracker 

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



[issue34369] kqueue.control() documentation and implementation mismatch

2019-07-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14506
pull_request: https://github.com/python/cpython/pull/14706

___
Python tracker 

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



[issue37563] Documentation - default for StreamHandler

2019-07-11 Thread Jonathan


New submission from Jonathan :

https://docs.python.org/2/library/logging.handlers.html
https://docs.python.org/3/library/logging.handlers.html

Both say:

"""class logging.StreamHandler(stream=None)

Returns a new instance of the StreamHandler class. If stream is specified, the 
instance will use it for logging output; otherwise, sys.stderr will be used."""

Surely that means from an user perspective that the default is actually 
`sys.stderr`, not `None`?

--
assignee: docs@python
components: Documentation
messages: 347677
nosy: docs@python, jonathan-lp
priority: normal
severity: normal
status: open
title: Documentation - default for StreamHandler
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



[issue37563] Documentation - default for StreamHandler

2019-07-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue34369] kqueue.control() documentation and implementation mismatch

2019-07-11 Thread miss-islington


miss-islington  added the comment:


New changeset dc0b6af42eca70e520b67d0bcf4dc5278a3f02dd by Miss Islington (bot) 
in branch '3.8':
bpo-34369: make kqueue.control() docs better reflect that timeout is 
positional-only (GH-9499)
https://github.com/python/cpython/commit/dc0b6af42eca70e520b67d0bcf4dc5278a3f02dd


--
nosy: +miss-islington

___
Python tracker 

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



[issue34369] kqueue.control() documentation and implementation mismatch

2019-07-11 Thread Tal Einat


Tal Einat  added the comment:


New changeset d3747fd8fa91b768b73b60f2e2a14044e5404afa by Tal Einat (Miss 
Islington (bot)) in branch '3.7':
bpo-34369: make kqueue.control() docs better reflect that timeout is 
positional-only (GH-9499)
https://github.com/python/cpython/commit/d3747fd8fa91b768b73b60f2e2a14044e5404afa


--

___
Python tracker 

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



[issue34369] kqueue.control() documentation and implementation mismatch

2019-07-11 Thread Tal Einat


Tal Einat  added the comment:


New changeset 46c2eff5adca7dc309f077ec65faf95b95c47b43 by Tal Einat (Miss 
Islington (bot)) in branch '2.7':
bpo-34369: make kqueue.control() docs better reflect that timeout is 
positional-only (GH-9499)
https://github.com/python/cpython/commit/46c2eff5adca7dc309f077ec65faf95b95c47b43


--

___
Python tracker 

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



[issue34369] kqueue.control() documentation and implementation mismatch

2019-07-11 Thread Tal Einat


Change by Tal Einat :


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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-11 Thread Tal Einat


Tal Einat  added the comment:


New changeset 9b5ce62cac27fec9dea473865d79c2c654312957 by Tal Einat in branch 
'master':
bpo-36390: simplify classifyws(), rename it and add unit tests (GH-14500)
https://github.com/python/cpython/commit/9b5ce62cac27fec9dea473865d79c2c654312957


--

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14508
pull_request: https://github.com/python/cpython/pull/14708

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14507
pull_request: https://github.com/python/cpython/pull/14707

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-11 Thread Tal Einat


Tal Einat  added the comment:

> I propose to merge PR 12481 first, after review, with tests, and then include 
> name change with rewrite in PR 14500.

I've gone ahead and merged PR GH-14500 into master, since it was ready to get 
and a clear improvement.  I've already merged this into PR GH-12481.

--

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-11 Thread Tal Einat


Change by Tal Einat :


--
versions: +Python 3.7, Python 3.9

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-11 Thread Tal Einat


Tal Einat  added the comment:


New changeset 242ad1f375bf564c35cf99cd754b2c5819c4d056 by Tal Einat (Miss 
Islington (bot)) in branch '3.8':
bpo-36390: simplify classifyws(), rename it and add unit tests (GH-14500)
https://github.com/python/cpython/commit/242ad1f375bf564c35cf99cd754b2c5819c4d056


--

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-11 Thread Tal Einat


Tal Einat  added the comment:


New changeset a2cf88efc417f1991720856f6913d16660e48941 by Tal Einat (Miss 
Islington (bot)) in branch '3.7':
bpo-36390: simplify classifyws(), rename it and add unit tests (GH-14500)
https://github.com/python/cpython/commit/a2cf88efc417f1991720856f6913d16660e48941


--

___
Python tracker 

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



[issue37563] Documentation - default for StreamHandler

2019-07-11 Thread Vinay Sajip


Vinay Sajip  added the comment:

If None is passed, that is interpreted to mean whatever the implementation 
default is, and that is sys.stderr. For backwards compatibility, that won't 
change: and I don't see any need to update the documentation, as it makes it 
perfectly clear that sys.stderr will be used if None is specified. Nor do I see 
a need to change the default parameter value from its current value of None.

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



[issue37564] ArgumentParser should support bool type according to truth values

2019-07-11 Thread Zach Beniash


New submission from Zach Beniash :

Today when using argparse.ArgumentParser it seems that the bool type is not 
supported in a logical way.
Foe example:
-
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--mybool", type=bool)
parsed_args = parser.parse(["--mybool", "False"])
--
parsed_args.my_bool evaluates to True

Instead we should expect to evaluate False here.

--
components: Library (Lib)
messages: 347686
nosy: Zach Beniash
priority: normal
severity: normal
status: open
title: ArgumentParser should support bool type according to truth values
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37563] Documentation - default for StreamHandler

2019-07-11 Thread Jonathan


Change by Jonathan :


--
status:  -> open

___
Python tracker 

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



[issue37565] test_faulthandler failure

2019-07-11 Thread Michelle Johnson


New submission from Michelle Johnson :

CentOS 7.6, running Linux gl-build.arc-ts.umich.edu 3.10.0-957.10.1.el7.x86_64 
#1 SMP Mon Mar 18 15:06:45 UTC 2019 x86_64 on Intel(R) Xeon(R) Gold 6140 CPU @ 
2.30GHz.

Using gcc 8.2.0 compiled from source to build python 3.7.4 from source, make 
test fails with the following errors:

```
0:00:22 load avg: 3.12 [402/416/1] test_faulthandler failed
test test_faulthandler failed -- Traceback (most recent call last):
  File "/tmp/shellysw/build/Python-3.7.4/Lib/test/test_faulthandler.py", line 
724, in test_register_chain
self.check_register(chain=True)
  File "/tmp/shellysw/build/Python-3.7.4/Lib/test/test_faulthandler.py", line 
702, in check_register
self.assertEqual(exitcode, 0)
AssertionError: -11 != 0
```

I found a similar error reported in RedHat bugzilla (1687171) and tried running 
the script provided by Victor Stinner, and this closed issue on GitHub seems 
like it might be related?
#32 because of the Skylake chipset.

Script:
```
import faulthandler, signal, os

def handler(signum, frame):
handler.called = True
handler.called = False

faulthandler.enable()

signum = signal.SIGUSR1
signal.signal(signum, handler)
faulthandler.register(signum, chain=True)
os.kill(os.getpid(), signum)
print("called", handler.called)
```

It produced a segmentation fault. I also ran that script using the python 3.6.6 
binary that came installed with centos and it also produced a segmentation 
fault as well.

--
components: Build, Tests
messages: 347688
nosy: jshelly
priority: normal
severity: normal
status: open
title: test_faulthandler failure
type: compile error
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



[issue37564] ArgumentParser should support bool type according to truth values

2019-07-11 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue37564] ArgumentParser should support bool type according to truth values

2019-07-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +paul.j3

___
Python tracker 

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



[issue37565] test_faulthandler failure

2019-07-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vstinner

___
Python tracker 

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



[issue3753] bytearray incompatible with y#

2019-07-11 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests:  -14485

___
Python tracker 

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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2019-07-11 Thread Inada Naoki


Inada Naoki  added the comment:

FYI, PyEval_CallFunction and PyEval_CallMethod doesn't respect Py_SSIZE_T_CLEAN.
So runtime warning is raised when they are used with "#" format.

--

___
Python tracker 

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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2019-07-11 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 1dbd084f1f68d7293718b663df675cfbd0c65712 by Inada Naoki (Jeroen 
Demeyer) in branch 'master':
bpo-29548: no longer use PyEval_Call* functions (GH-14683)
https://github.com/python/cpython/commit/1dbd084f1f68d7293718b663df675cfbd0c65712


--

___
Python tracker 

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



[issue27379] SocketType changed in Python 3

2019-07-11 Thread hai shi


Change by hai shi :


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

___
Python tracker 

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



[issue27379] SocketType changed in Python 3

2019-07-11 Thread hai shi


hai shi  added the comment:

In order to keep back compatible, I would prefer to update SocketType ;)

--
nosy: +shihai1991

___
Python tracker 

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



[issue37566] Remove redudant code in socket.py

2019-07-11 Thread hai shi


New submission from hai shi :

Looks like the _realsocket in socket.py is redudnat. But I am not sure somebody 
would use it or not.

REF: https://github.com/python/cpython/blob/master/Lib/socket.py#L107

--
components: Library (Lib)
messages: 347692
nosy: shihai1991
priority: normal
severity: normal
status: open
title: Remove redudant code in socket.py

___
Python tracker 

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



[issue37566] Remove redudant code in socket.py

2019-07-11 Thread hai shi


Change by hai shi :


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

___
Python tracker 

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



[issue37554] Typo in os.rename docs

2019-07-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14512
pull_request: https://github.com/python/cpython/pull/14712

___
Python tracker 

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



[issue37554] Typo in os.rename docs

2019-07-11 Thread miss-islington


miss-islington  added the comment:


New changeset 7cbef72902f32866a416ca6c4e732af4541951b8 by Miss Islington (bot) 
(Mariatta) in branch 'master':
closes bpo-37554: Remove `q:q` in os.rst documentation (GH-14692)
https://github.com/python/cpython/commit/7cbef72902f32866a416ca6c4e732af4541951b8


--
nosy: +miss-islington
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



[issue37554] Typo in os.rename docs

2019-07-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14513
pull_request: https://github.com/python/cpython/pull/14713

___
Python tracker 

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



[issue37554] Typo in os.rename docs

2019-07-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14514
pull_request: https://github.com/python/cpython/pull/14714

___
Python tracker 

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



[issue37554] Typo in os.rename docs

2019-07-11 Thread Mariatta


Mariatta  added the comment:

Thanks for the report!

--
nosy: +Mariatta

___
Python tracker 

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



[issue37554] Typo in os.rename docs

2019-07-11 Thread miss-islington


miss-islington  added the comment:


New changeset 107171500d7d6e60f463eeb4db492c0ae292a669 by Miss Islington (bot) 
in branch '3.8':
closes bpo-37554: Remove `q:q` in os.rst documentation (GH-14692)
https://github.com/python/cpython/commit/107171500d7d6e60f463eeb4db492c0ae292a669


--

___
Python tracker 

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



[issue37545] Argparse Tutorial - unreasonable operators

2019-07-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I concur with Zachary. The current writing is more errorproof.

--
nosy: +serhiy.storchaka
resolution:  -> rejected
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



[issue37554] Typo in os.rename docs

2019-07-11 Thread miss-islington


miss-islington  added the comment:


New changeset 71435f685c0423f878946e584f4b9eb01233d332 by Miss Islington (bot) 
in branch '3.7':
closes bpo-37554: Remove `q:q` in os.rst documentation (GH-14692)
https://github.com/python/cpython/commit/71435f685c0423f878946e584f4b9eb01233d332


--

___
Python tracker 

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



[issue37555] _CallList.__contains__ doesn't always respect ANY.

2019-07-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Karthikeyan, I think there is a flaw in your example. The good __eq__ should 
return NotImplemented instead of False for other types. This wil allow the 
right operand's __eq__ to play.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37558] Shared memory tests are failing due to double slashes

2019-07-11 Thread miss-islington

miss-islington  added the comment:


New changeset 4737265622251756a9480ab84af2442b6b986850 by Miss Islington (bot) 
(Jakub Kulík) in branch 'master':
bpo-37558: Shared memory tests are failing due to double slashes (GH-14703)
https://github.com/python/cpython/commit/4737265622251756a9480ab84af2442b6b986850


--
nosy: +miss-islington

___
Python tracker 

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



[issue37558] Shared memory tests are failing due to double slashes

2019-07-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14515
pull_request: https://github.com/python/cpython/pull/14715

___
Python tracker 

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



[issue37558] Shared memory tests are failing due to double slashes

2019-07-11 Thread miss-islington


miss-islington  added the comment:


New changeset 3d58b78481e0238593f85cc182b798fe3b77648c by Miss Islington (bot) 
in branch '3.8':
bpo-37558: Shared memory tests are failing due to double slashes (GH-14703)
https://github.com/python/cpython/commit/3d58b78481e0238593f85cc182b798fe3b77648c


--

___
Python tracker 

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



[issue37567] Python compiles empty bytecode files when out of virtual memory on windows

2019-07-11 Thread Mike Lovelace


New submission from Mike Lovelace :

On a system under heavy load last night Windows ran out of virtual memory, and 
it appears that python interpreted that as the pyc files did not exist and 
attempted to recreate them. In recreating them, it created essentially empty 
files, which caused further attempts to use the service to fail with 500 errors.

--
files: urllib_RENAME.pyc
messages: 347701
nosy: Mike Lovelace
priority: normal
severity: normal
status: open
title: Python compiles empty bytecode files when out of virtual memory on 
windows
type: compile error
versions: Python 2.7
Added file: https://bugs.python.org/file48471/urllib_RENAME.pyc

___
Python tracker 

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



[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-07-11 Thread Tal Einat


Tal Einat  added the comment:

To those following this issue, PR GH-14030 is now in a very good state, and 
would benefit from more feedback.

--

___
Python tracker 

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



[issue37553] SendfileUsingSendTest tests timeout too short for Windows ARM32

2019-07-11 Thread Paul Monson


Change by Paul Monson :


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

___
Python tracker 

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



[issue37568] Misleading UnBoundLocalError on assignment to closure variable

2019-07-11 Thread kolia


New submission from kolia :

def outer(a):   
def inner():
  print(a)  
  a = 43
return inner

t = outer(42)   

print(t())  


Outputs:

~/Documents/repro.py in inner()   
  1 def outer(a): 
  2 def inner():  
> 3   print(a)
  4   a = 43  
  5 return inner  
  
UnboundLocalError: local variable 'a' referenced before assignment


This is misleading, since `a` is actually in scope on line 3. What is making it 
fail is the assignment on line 4, since `a` has not been declared `nonlocal`.

Instead, the error should point to line 4 and report an illegal assignment to a 
read-only closure variable.

--
components: Interpreter Core
messages: 347703
nosy: kolia
priority: normal
severity: normal
status: open
title: Misleading UnBoundLocalError on assignment to closure variable
type: compile error
versions: Python 3.6

___
Python tracker 

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



[issue37564] ArgumentParser should support bool type according to truth values

2019-07-11 Thread paul j3


paul j3  added the comment:

This is an old topic, though it may be easier to find a relevant StackOverflow 
thread.

https://stackoverflow.com/a/19233287/901925  (a 2013 thread)

I and others have explained that the `type` parameter is supposed to be a 
callable.  The default Python `bool` function only returns False for an empty 
string.  Previous discussions have suggested writing a function that parses 
strings like 'False' and 'No'.  It's nice that you have found a 
'distutils.utils.strtobool' that does this well.

But I have several qualms about the proposed patch:

- do we need to define a 'bool' type?  We already has 'store_true' and 
'store_false' actions.

- does this function need a 'bool' wrapper?

- do we need another import?  There's a relatively recent bug/issue that tries 
to speed up argparse by reducing the number of imports.

- if added, should this type be registered as the object bool or string 'bool'? 
 

Seems to me that the patch could be simplified to:

 self.register('type', 'bool', _strtobool)

According the original developer `type=bool` should be allowed (even if it 
doesn't do what many users expect):

https://bugs.python.org/issue14392

I point out that users are used to providing strings for 'action', but not for 
'type'.  The registry mechanism can be used to provide specialized type but so 
far only 'None' is registered.

https://bugs.python.org/issue26994

https://bugs.python.org/issue24754

This proposed patch might be innocuous, but it does break a consistent behavior 
- that 'type' should be a callable, and 'bool' is a standard Python function.

An alternative is to add to the docs a note (in the 'type' section) that

from distutils.util import strtobool
type=strtobool

could be used to parse strings as booleans.

--

___
Python tracker 

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



[issue30755] locale.normalize() and getdefaultlocale() convert C.UTF-8 to en_US.UTF-8

2019-07-11 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
nosy: +Jeffrey.Kintscher

___
Python tracker 

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



[issue21478] mock calls don't propagate to parent (autospec)

2019-07-11 Thread Jack Wong


Jack Wong  added the comment:

Thanks, Karthikeyan! I applied your change to Lib/unittest/mock.py, and it 
fixed the bug for me. I confirmed that calls to the child mock now appear in 
the parent's mock_calls in my test suite. Your PR looks good to me.

--

___
Python tracker 

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



[issue37568] Misleading UnBoundLocalError on assignment to closure variable

2019-07-11 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

The behaviour and error message is correct, and your interpretation is 
incorrect. You are not assigning to a closure variable on line 4; you are 
printing an unbound local variable on line 3, precisely as the error message 
says. That may not match your *intention*, but Python doesn't do what we want 
it to do, only what we tell it to do :-)

Like global variables, nonlocals (closures) are NOT defined by "does this name 
match a name in the surrounding scope?". Rather, *local* variables are defined 
by assignment: any assignment in the body of the function defines a local, 
unless otherwise declared as nonlocal or global.


> Instead, the error should point to line 4 and report an illegal assignment to 
> a read-only closure variable.

That can't happen without a huge and backwards-incompatible change to Python 
semantics. (Possibly in Python 5000?)

The only reason I'm not closing this as "Not a bug" is in case someone would 
like to suggest an improvement to error message. Perhaps:

UnboundLocalError: local variable 'a' referenced before assignment -- did you 
forget a nonlocal or global declaration?

--
nosy: +steven.daprano

___
Python tracker 

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



[issue37562] PEP 590 implementation introduced a performance regression

2019-07-11 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

Could you please specify:
- which commits are you comparing exactly? From your explanation, I guess 
aacc77fbd and its parent, but that's not completely fair since PEP 590 consists 
of many commits (see #36974). A better comparison would be master against 3.8a4.
- are you compiling with PGO (--enable-optimizations) or not?

--

___
Python tracker 

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



[issue37569] Complete your registration to Python tracker

2019-07-11 Thread David


New submission from David :

Here is the link to register.

From: report=bugs.python@roundup.psfhosted.org 
 on behalf of Python tracker 

Sent: Thursday, July 11, 2019 8:59 PM
To: davedro...@hotmail.com
Subject: Complete your registration to Python tracker

To complete your registration of the user "ddrouin" with
Python tracker, please visit the following URL:

https://bugs.python.org/?@action=confrego&otk=yx0D8CJvzNqeUY0usWJfgG0vnPc7HsWM

--
messages: 347708
nosy: ddrouin
priority: normal
severity: normal
status: open
title: Complete your registration to Python tracker

___
Python tracker 

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



[issue37568] Misleading UnBoundLocalError on assignment to closure variable

2019-07-11 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

To clarify further, unlike (say) Lua, Python doesn't allow variables to change 
scope part-way through a function. (At least not without hacking the 
byte-code.) In any function, a name refers to precisely one of (1) a local, (2) 
a nonlocal, and (3) a global, so you cannot have something like this:

a = 1
def func():
print(a)  # refers to global a
a = a + 1  # make a new local 'a'

--

___
Python tracker 

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



[issue37569] Complete your registration to Python tracker

2019-07-11 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Seems to have been created in error.

--
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue37558] Shared memory tests are failing due to double slashes

2019-07-11 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue37568] Misleading UnBoundLocalError on assignment to closure variable

2019-07-11 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

I'm inclined to close as Not a Bug as well. I'm worried the expanded error 
message would confuse people when they simply failed to assign a variable, and 
make them try bad workarounds like adding global/nonlocal when it's not the 
problem, e.g.:

def foo(bar):
if bar > 0:
baz = 'a'
elif bar < 0:
baz = 'b'
return baz

Even if baz exists in an outer scope, they almost certainly didn't intend to 
use it, they just didn't properly account for all the paths to ensure baz is 
initialized. Adding a global or nonlocal declaration would make calling with 
zero as the arg "work" if the function was called with a non-zero value first, 
but it wouldn't be correct. When the error message suggests a fix, people tend 
to do it without thinking critically (or understanding the underlying problem), 
which is worse than a message without a fix where solving it involves learning 
what it actually means.

--
nosy: +josh.r

___
Python tracker 

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



[issue30550] Document order-preserving dictionary output in json

2019-07-11 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Is there a reason to document object_pairs_hook=OrderedDict rather than just 
making the decoder populate a regular dict in an order-preserving way? (No idea 
if it does this already)

--
nosy: +josh.r

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I believe I meant the opposite of what I said, which fortunately is what Tal 
did.  PR 14500 is the one I looked at and commented on and the name change in 
PR 14500 is what needed to be included in PR 12481 (done).

I would like to retitle this issue 'IDLE: Move format functions into 1 file:. 
and put all the functions for the Format submenu in one file, format.py, with 
test_format.py.  The result will be near 400 lines.  Rename paragraph.py and 
test_paragraph.py and put contents of proposed new files in those instead.  Add 
another class, FormatFile for the 3 file reforming functions.

If you want, I would not mind merging the PR as is, but with 'region' removed 
from the names, and adding in FormatParagraph and a new FormatFile in a 
separate PR.  But I don't know the consequence for the file history and git 
blame.  I would prefer that format.py be seen as the successor of paragraph.py 
if that would enable blame to trace back through the rename.

paragraph already has some utility functions, including get_indent, which is 
similar to get_line_indent.  We might combine them in the follow-up 
refactoring.  There is at least one bug, mentioned in file, to fix.

Followup refactoring should include examination of docstrings and IDLE doc.  
The doc should briefly define 'region'.

SimpleDialog.AskInteger should be replaced by a Query subclass both here and in 
EditorWindow.goto_line_event (another issue and PR).

Menu adjustments: Move Format Paragraph to top, leaving the 3 file operations 
together at the bottom.  ^[ also indents.  (Tab indents if more than one line 
is selected.)  Strip trailing whitespace should string trailing blank lines.

--

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

When this is merged, I will open a format menu master issue listing todos. 
Dependencies will include 4 issues, #24817, #5150 (two items), #18583 (with 
patch), and #23367 (with patch), other than #36219, follow-up code revisions, 
and revising README.txt.

--

___
Python tracker 

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



[issue37562] PEP 590 implementation introduced a performance regression

2019-07-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>which commits are you comparing exactly? From your explanation, I guess 
>aacc77fbd and its parent, but that's not completely fair since PEP 590 
>consists of many commits (see #36974). A better comparison would be master 
>against 3.8a4.

I am comparing the tip of 3.8 and the parent of aacc77fbd. (Notice that the 
first two stack traces correspond to aacc77fbd and its parent).

>are you compiling with PGO (--enable-optimizations) or not?

Yup, PGO and LTO. I can try repeat them without optimisations if you want.

As I suggested previously I would like to confirm that this results can be 
reproduced first before exploring other things.

--

___
Python tracker 

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



[issue37562] PEP 590 implementation may have introduced a performance regression

2019-07-11 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
title: PEP 590 implementation introduced a performance regression -> PEP 590 
implementation may have introduced a performance regression

___
Python tracker 

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



[issue37566] Remove redudant code in socket.py

2019-07-11 Thread Aldwin Pollefeyt


Aldwin Pollefeyt  added the comment:

seems it is/was used in socket._socketobject in 2.7

--
nosy: +aldwinaldwin

___
Python tracker 

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



[issue37566] Remove redudant code in socket.py

2019-07-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset c8e7146de257930ea8d0d4aa74b3a64fcaa79d4b by Benjamin Peterson 
(Hai Shi) in branch 'master':
closes bpo-37566: Remove _realsocket from socket.py. (GH-14711)
https://github.com/python/cpython/commit/c8e7146de257930ea8d0d4aa74b3a64fcaa79d4b


--
nosy: +benjamin.peterson
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



[issue37570] `distutils.util.byte_compile` fails indirect byte compiling with non-ASCII full-path.

2019-07-11 Thread Suzumizaki


New submission from Suzumizaki :

`distutils.util.byte_compile` fails _indirect_ byte compiling when the
full-path of the .py file contains non-ASCII characters.

Because there is the project (cx_Freeze) which directly uses
`distutils.util.byte_compile`, the problem would happen while installing it
under the non-ASCII path.

Fortunately, it is easy to fix.
 
Ofcourse, the files included in external libraries should be named ASCII only,
but `distutils.util.byte_compile` makes and uses full path of them. I learned
many of libraries uses setuptools instead of distutils, but please consider
the following situations:

1) The case that venv creates the virtual environment under or with
   non-ASCII named folder.
2) And special cases of 1), on Windows, the name of end-users OFTEN be
   composed with non-ASCII characters, this means including theirs
   Documents, Desktop, or Downloads etc.

The more they are not professional,they make easily the situation above.

--
components: Distutils
files: batch.diff
keywords: patch
messages: 347718
nosy: Suzumizaki, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: `distutils.util.byte_compile` fails indirect byte compiling with 
non-ASCII full-path.
type: behavior
versions: Python 3.7, Python 3.8
Added file: https://bugs.python.org/file48472/batch.diff

___
Python tracker 

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



[issue37570] `distutils.util.byte_compile` fails indirect byte compiling with non-ASCII full-path.

2019-07-11 Thread Suzumizaki


Suzumizaki  added the comment:

Here's test code.

Note: I marked just Python 3.8 and 3.7 I tested, but maybe all versions.

--
Added file: https://bugs.python.org/file48473/my_test_case.py

___
Python tracker 

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



[issue37548] Document range of atan, acos and asin

2019-07-11 Thread Giovanni Cappellotto


Change by Giovanni Cappellotto :


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

___
Python tracker 

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



[issue37548] Document range of atan, acos and asin

2019-07-11 Thread Giovanni Cappellotto


Giovanni Cappellotto  added the comment:

I created a small diff to update the documentation of `math.atan`, `math.asin` 
and `math.acos`.

--
nosy: +potomak

___
Python tracker 

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



[issue37570] `distutils.util.byte_compile` fails indirect byte compiling with non-ASCII full-path.

2019-07-11 Thread Aldwin Pollefeyt


Aldwin Pollefeyt  added the comment:

All 'The byte compiling test seems succeeded.' when i tested your script on 
ubuntu 18.04 on latest 3.7.4rc2+, 3.8.0b1+ and 3.9.0a0.

What are the exact python versions and the OS version you see the issue?

--
nosy: +aldwinaldwin

___
Python tracker 

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



[issue37555] _CallList.__contains__ doesn't always respect ANY.

2019-07-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> Karthikeyan, I think there is a flaw in your example. The good __eq__ should 
> return NotImplemented instead of False for other types. This wil allow the 
> right operand's __eq__ to play.

Serhiy, my example was to try reproducing the original report where Django 
model tries to check if the other's type and returns False if the type is not a 
Django model. There could be cases where __eq__ implementation of a class could 
be just returning False instead of raising a NotImplemented error due to 
difference in type that affects comparison of ANY.

> Django first checks if the thing it's comparing to is another Django model, 
> and returns False if not. So,  == ANY is False, but ANY == 
>  is True.

--

___
Python tracker 

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



[issue37570] `distutils.util.byte_compile` fails indirect byte compiling with non-ASCII full-path.

2019-07-11 Thread Suzumizaki


Suzumizaki  added the comment:

Terribly Sorry! I forgot to write this is only Windows Issue! Thanks!

--
components: +Unicode, Windows
nosy: +ezio.melotti, paul.moore, steve.dower, tim.golden, vstinner, zach.ware

___
Python tracker 

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



[issue37570] `distutils.util.byte_compile` fails indirect byte compiling with non-ASCII full-path.

2019-07-11 Thread Suzumizaki


Suzumizaki  added the comment:

... and please check "batch.diff" (Oops, that's typo of 'patch'). I just added 
"encoding" parameter to calling open() function, and added the temp file to 
'utf-8' code declaration. This bug could happen where the default encoding of 
open() function is not utf-8(may not only Windows).

--

___
Python tracker 

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



  1   2   >