[issue36299] Deprecate 'u' type in array module

2019-03-14 Thread Inada Naoki


New submission from Inada Naoki :

The doc says:

> 'u' will be removed together with the rest of the Py_UNICODE API.
> Deprecated since version 3.3, will be removed in version 4.0.
> https://docs.python.org/3/library/array.html

But DeprecationWarning is not raised yet.  Let's raise it.

* 3.8 -- PendingDeprecationWarning
* 3.9 -- DeprecationWarning
* 4.0 or 3.10 -- Remove it.

--
components: Library (Lib)
messages: 337967
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: Deprecate 'u' type in array module
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



[issue36298] Lib/pyclbr.py crashes when the package spec cannot be determined by importlib

2019-03-14 Thread mental


Change by mental :


--
type: crash -> behavior

___
Python tracker 

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



[issue36298] Lib/pyclbr.py crashes when the package spec cannot be determined by importlib

2019-03-14 Thread mental


New submission from mental :

Hi folks! (apologies in advance if any of the code blocks come out irregular, 
this is my first issue)


I was just exploring the `Lib` modules out of curiosity and I discovered 
`pyclbr` a peculiar artifact from the older days of the Python standard library.

I noticed the module could be run directly and after attempting to run it 
withan invalid source target `python -m pyclbr somenonexistentfile` it raised 
```
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/usr/lib/python3.7/pyclbr.py", line 405, in 
_main()
  File "/usr/lib/python3.7/pyclbr.py", line 380, in _main
tree = readmodule_ex(mod, path)
  File "/usr/lib/python3.7/pyclbr.py", line 116, in readmodule_ex
return _readmodule(module, path or [])
  File "/usr/lib/python3.7/pyclbr.py", line 169, in _readmodule
if spec.submodule_search_locations is not None:
AttributeError: 'NoneType' object has no attribute 
'submodule_search_locations'```

I was running 3.7.2, although I assume this affects future versions and 
possibly some older versions. (I suspect the bug originates from importlib 
silently breaking backwards compatability)

I thought it strange for a script to exit so loudly so after reading through 
the source I believe the intended behavior meant for an invalid target is to 
raise an `ImportError` although I admit I'm not convinced this is still the 
best way to exit from erroneous input (or even if the module is still relevant 
in todays code?)

I believe this is a bug (but I would very much appreciate a second opinion) and 
I've identified it as a low priority easy fix, In which case I'd be more than 
happy to submit a fix :)

--
messages: 337966
nosy: mental
priority: normal
severity: normal
status: open
title: Lib/pyclbr.py crashes when the package spec cannot be determined by 
importlib
type: crash
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



[issue36297] Remove unicode_internal codec

2019-03-14 Thread Inada Naoki


New submission from Inada Naoki :

unicode_internal codec is deprecated since Python 3.3.
It raises DeprecationWarning from 3.3.

>>> "hello".encode('unicode_internal')
__main__:1: DeprecationWarning: unicode_internal codec has been deprecated
b'h\x00\x00\x00e\x00\x00\x00l\x00\x00\x00l\x00\x00\x00o\x00\x00\x00'

May I remove it in 3.8?

--
components: Unicode
messages: 337965
nosy: ezio.melotti, inada.naoki, vstinner
priority: normal
severity: normal
status: open
title: Remove unicode_internal codec
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



[issue36286] Random failure in test_idle

2019-03-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I am guessing that test_idle and hence this test have been run over 500 days X 
20 runs/day (1 times) since merged.  This is the first report I have seen, 
though failures that get retested would be masked.  My guess is a sporadic 
timing delay such that the assertion is tested before the widget is updated.  
Serhiy, does this make sense?

I have reproduced the failure 8 times by running the attached file, derived 
from test_configdialog, in IDLE.  Reps required ranged from about 1000 to 
3, plus I stopped once at nearly 10 with no failure.  About half 
appeared to be a direct result.  All appeared to be an up/down font test, the 
first of the pair.

Tomorrow, I intend to run this more, including from command line, and then 
insert update() or update_idletasks() to see if either dependably suppress 
failure.  I am curious what happens on Linux.

--
nosy: +cheryl.sabella
Added file: https://bugs.python.org/file48208/test_cdfail.py

___
Python tracker 

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



[issue23216] IDLE grep/find/replace source code needs docstrings

2019-03-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

There are several minor things to fix after this (and multiple issues), 
including the difference between find in search and replace.  It seems to me 
that is should be the same.  We will definitely need to test changes on both 
Windows and Linux.

The font color issue is essentially the one that resulted in white on white in 
the completions box.  We should always set both foreground and background to 
make sure consistent.  Another nit for followup.

--

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-14 Thread Jess


Jess  added the comment:

Nevermind, the hold over issue was from another bit.

Updated the change request.

--
versions: +Python 2.7, Python 3.4, 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



[issue36276] Python urllib CRLF injection vulnerability

2019-03-14 Thread ragdoll


ragdoll  added the comment:

OK

--

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-14 Thread Jess


Jess  added the comment:

Looks like the brackets are fine even in the bracket case Steve mentioned.

@echo off

if NOT DEFINED ABCDEF (
  echo "all good"
)

if NOT DEFINED ABCDE (
  echo "all good2"
)

set ABCDE=

if NOT DEFINED ABCDE (
  echo "sadness"
)

if [%ABCDE%]==[] (
  echo "all good3"
)

set ABCDE=]

if [%ABCDE%] NEQ [] (
  echo "all good4"
)

set ABCDE="]"

if [%ABCDE%] NEQ [] (
  echo "all good5"
)


>demo.bat
"all good"
"sadness"
"all good3"
"all good4"
"all good5"

--

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-14 Thread Jess


Jess  added the comment:

Alas, "IF NOT DEFINED PYTHON" isn't working - as it's even more possible to get 
into a state where PYTHON="" than it is for a bracket to be in the python name.

Thus, the system would think it declared where we would have created it into an 
actual path otherwise.

--

___
Python tracker 

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



[issue36296] distutils.version.StrictVersion objects cannot be compared with distutils.version.LooseVersionobjects

2019-03-14 Thread Éric Araujo

Éric Araujo  added the comment:

Hello!  Are you seeing this problem when building or installing some package, 
or are you using the classes directly?

If it’s the latter, I would recommand you to use 
https://pypi.org/project/packaging/ rather than distutils, which is not meant 
to be used as a generic library.

--

___
Python tracker 

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



[issue36296] distutils.version.StrictVersion objects cannot be compared with distutils.version.LooseVersionobjects

2019-03-14 Thread Harry Seeber


New submission from Harry Seeber :

The self.version used in Version._cmp is a List in LooseVersion's 
implementation, a Tuple in StrictVersion's implementation. Attempting to 
compare Strict & Loose versions results in a TypeError.

I'd like to PR a fix, but I'd like to know if I'm being stupid first :)

--
components: Distutils
messages: 337957
nosy: Harry Seeber, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: distutils.version.StrictVersion objects cannot be compared with 
distutils.version.LooseVersionobjects
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



[issue36295] Need to yield (sleep(0)) twice in asyncio

2019-03-14 Thread Zachary Ware


Change by Zachary Ware :


--
components: +asyncio
nosy: +asvetlov, yselivanov

___
Python tracker 

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



[issue36010] Please provide a .zip Windows release of Python that is not crippled/for embedding only

2019-03-14 Thread jt


jt  added the comment:

Yeah, having this in the NuGet version would be amazing!

I have been too specific with the ticket with my narrow mind set on a solution, 
but NuGet + complete standard library (including venv and pip) is what I now 
believe I actually should be using.

Not that I would mind an additional .zip only release, but now it's so trivial 
to automatically spill this out from an automated NuGet install that I really 
don't mind!

--

___
Python tracker 

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



[issue36287] Make ast.dump() not output optional default fields

2019-03-14 Thread Brett Cannon


Brett Cannon  added the comment:

@eamanu tests are basically always necessary. :)

--

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-14 Thread Brett Cannon


Brett Cannon  added the comment:

We could also have a new namespace package which is *just* for startup 
injection so it wasn't such a hack to tie into the codecs startup code.

--

___
Python tracker 

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



[issue36276] Python urllib CRLF injection vulnerability

2019-03-14 Thread Brett Cannon


Brett Cannon  added the comment:

Yep, if it's the same problem then close this as a dupe and just poke the other 
issue.

--

___
Python tracker 

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



[issue36010] Please provide a .zip Windows release of Python that is not crippled/for embedding only

2019-03-14 Thread Paul Moore


Paul Moore  added the comment:

Ah, yes, you're right. I'd misremembered. Thanks.

--

___
Python tracker 

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



[issue36268] Change default tar format to modern POSIX 2001 (pax) for better portability/interop, support and standards conformance

2019-03-14 Thread C.A.M. Gerlach


C.A.M. Gerlach  added the comment:

Sure, in work now. Its my first contribution to CPython, so bear with me. I 
presume this is too trivial to go in the What's New in Python article, but does 
merit a NEWS entry so users are aware of the change? Aside from changing [this 
line](https://github.com/python/cpython/blob/3fe7fa316f74ed630fbbcdf54564f15cda7cb045/Lib/tarfile.py#L108),
 updating the documentation to reflect the change, and possibly adding a NEWS 
entry, is there anything else that needs to be done? Thanks.

--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-03-14 Thread Diego Rojas


Change by Diego Rojas :


--
pull_requests: +12306

___
Python tracker 

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



[issue36295] Need to yield (sleep(0)) twice in asyncio

2019-03-14 Thread Assaf Dayan


New submission from Assaf Dayan :

In asyncio, 'await asyncio.sleep(0)' is used to relinquish control and check 
for finished awaitables before continuing. 
In my example, an awaitable returns but is only handled if 'await 
asyncio.sleep(0)' is called twice (adjacently) and only then the returned 
'await' statements are handled correctly.

The attached script generates tasks which do the following: compute for 0.8 
seconds; do an async op for 0.5 seconds; and compute some more for 0.2 seconds.
Before generating each new task, we relinquish control so that existing pending 
tasks will resume operation, if their 'await' statements returned.
We simulate a business-case in which we give precedence to already-processing 
tasks over new ones.

When running the attached script, Task 1 goes async at d=0.8 and should be 
ready by d=1.3 (asyncio.sleep(0.5)). Because Task 2 started at d=0.8 (when T1 
went async) it will relinquish control at d=1.6. By relinquishing control at 
d=1.6, Task 1 should resume, but it doesn't, unless asyncio.sleep(0) is called 
once more.
If asyncio.sleep(0) is not called again (as a fix), Task 1 will only resume at 
d=2.4, which is after Task 3 relinquished control.

--
files: async_yield.py
messages: 337950
nosy: Assaf Dayan
priority: normal
severity: normal
status: open
title: Need to yield (sleep(0)) twice in asyncio
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48207/async_yield.py

___
Python tracker 

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



[issue36010] Please provide a .zip Windows release of Python that is not crippled/for embedding only

2019-03-14 Thread Eryk Sun


Eryk Sun  added the comment:

> It appears that the venv module did not get added to the 3.7.3 rc1 
> embedded distribution. Was that an oversight, or had I misunderstood 
> what was needed for this to have happened?

I think it was supposed to be added to the nuget package:

https://github.com/python/cpython/blob/v3.7.3rc1/PC/layout/support/options.py#L54

--
nosy: +eryksun

___
Python tracker 

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



[issue36010] Please provide a .zip Windows release of Python that is not crippled/for embedding only

2019-03-14 Thread Paul Moore


Paul Moore  added the comment:

It appears that the venv module did not get added to the 3.7.3 rc1 embedded 
distribution. Was that an oversight, or had I misunderstood what was needed for 
this to have happened?

--

___
Python tracker 

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



[issue34714] timeout in test_multiprocessing_spawn x86 Windows7 3.x buildbot

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

We should extend the timeout of this buildbot worker.

More and more tests are failing randomly with the 15 min timeout:

https://buildbot.python.org/all/#/builders/58/builds/2060

0:19:49 [ 36/420/1] test_zipfile crashed (Exit code 1) -- running: 
test_multiprocessing_spawn (14 min 19 sec)
Timeout (0:15:00)!
Thread 0x0a94 (most recent call first):
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\zipfile.py", 
line 603 in _init
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\zipfile.py", 
line 610 in compress
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\zipfile.py", 
line 1100 in write
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_zipfile.py",
 line 65 in make_test_archive
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_zipfile.py",
 line 257 in zip_readlines_test
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_zipfile.py",
 line 268 in test_readlines
...

0:20:33 [ 41/420/2] test_multiprocessing_spawn crashed (Exit code 1)
Timeout (0:15:00)!
Thread 0x0b2c (most recent call first):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\connection.py",
 line 810 in _exhaustive_wait
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\connection.py",
 line 878 in wait
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\connection.py",
 line 330 in _poll
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\connection.py",
 line 257 in poll
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py",
 line 3261 in test_strings

--
nosy: +vstinner

___
Python tracker 

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



[issue18368] PyOS_StdioReadline() leaks memory when realloc() fails

2019-03-14 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
pull_requests: +12305

___
Python tracker 

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



[issue36262] Coverity scan: Python/dtoa.c resource leak

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for the report Charalampos. I fixed dtoa.c in 2.7, 3.7 and master 
branches.

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



[issue36262] Coverity scan: Python/dtoa.c resource leak

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b14057877fd897eaee7bc6626682fc6092b6bbd2 by Victor Stinner in 
branch '2.7':
bpo-36262: Fix _Py_dg_strtod() memory leak (goto undfl) (GH-12276) (GH-12332)
https://github.com/python/cpython/commit/b14057877fd897eaee7bc6626682fc6092b6bbd2


--

___
Python tracker 

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



[issue36292] Coverity scan: Resource leaks in longobject.c

2019-03-14 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

This code is unreachable. Will mark it as such.

--

___
Python tracker 

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



[issue36292] Coverity scan: Resource leaks in longobject.c

2019-03-14 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
versions:  -Python 2.7, Python 3.7

___
Python tracker 

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



[issue36262] Coverity scan: Python/dtoa.c resource leak

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9818360ed94b39c4605951077b73ae798cddbfb9 by Victor Stinner in 
branch '3.7':
bpo-36262: Fix _Py_dg_strtod() memory leak (goto undfl) (GH-12276) (GH-12331)
https://github.com/python/cpython/commit/9818360ed94b39c4605951077b73ae798cddbfb9


--

___
Python tracker 

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



[issue35809] test_concurrent_futures.ProcessPoolForkExecutorDeadlockTest fails intermittently on Travis and passes in verbose mode

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

Another example:
https://travis-ci.org/python/cpython/jobs/506338756

0:06:39 load avg: 4.23 [326/416/1] test_concurrent_futures failed -- running: 
test_multiprocessing_spawn (1 min 27 sec)
Traceback:
 Thread 0x2b2b1c243700 (most recent call first):
  File "/home/travis/build/python/cpython/Lib/threading.py", line 296 in wait
  File "/home/travis/build/python/cpython/Lib/multiprocessing/queues.py", line 
224 in _feed
  File "/home/travis/build/python/cpython/Lib/threading.py", line 865 in run
  File "/home/travis/build/python/cpython/Lib/threading.py", line 917 in 
_bootstrap_inner
  File "/home/travis/build/python/cpython/Lib/threading.py", line 885 in 
_bootstrap
Thread 0x2b2b1c65a700 (most recent call first):
  File "/home/travis/build/python/cpython/Lib/selectors.py", line 415 in select
  File "/home/travis/build/python/cpython/Lib/multiprocessing/connection.py", 
line 920 in wait
  File "/home/travis/build/python/cpython/Lib/concurrent/futures/process.py", 
line 354 in _queue_management_worker
  File "/home/travis/build/python/cpython/Lib/threading.py", line 865 in run
  File "/home/travis/build/python/cpython/Lib/threading.py", line 917 in 
_bootstrap_inner
  File "/home/travis/build/python/cpython/Lib/threading.py", line 885 in 
_bootstrap
Current thread 0x2b2b150439c0 (most recent call first):
  File "/home/travis/build/python/cpython/Lib/test/test_concurrent_futures.py", 
line 901 in _fail_on_deadlock
  File "/home/travis/build/python/cpython/Lib/test/test_concurrent_futures.py", 
line 962 in test_crash
  File "/home/travis/build/python/cpython/Lib/unittest/case.py", line 615 in run
  File "/home/travis/build/python/cpython/Lib/unittest/case.py", line 663 in 
__call__
  File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 122 in 
run
  File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 84 in 
__call__
  File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 122 in 
run
  File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 84 in 
__call__
  File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 122 in 
run
  File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 84 in 
__call__
  File "/home/travis/build/python/cpython/Lib/unittest/runner.py", line 176 in 
run
  File "/home/travis/build/python/cpython/Lib/test/support/__init__.py", line 
1899 in _run_suite
  File "/home/travis/build/python/cpython/Lib/test/support/__init__.py", line 
1995 in run_unittest
  File "/home/travis/build/python/cpython/Lib/test/test_concurrent_futures.py", 
line 1213 in test_main
  File "/home/travis/build/python/cpython/Lib/test/support/__init__.py", line 
2127 in decorator
  File "/home/travis/build/python/cpython/Lib/test/libregrtest/runtest.py", 
line 182 in runtest_inner
  File "/home/travis/build/python/cpython/Lib/test/libregrtest/runtest.py", 
line 127 in runtest
  File "/home/travis/build/python/cpython/Lib/test/libregrtest/runtest_mp.py", 
line 68 in run_tests_worker
  File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 
600 in _main
  File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 
586 in main
  File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 
640 in main
  File "/home/travis/build/python/cpython/Lib/test/regrtest.py", line 46 in 
_main
  File "/home/travis/build/python/cpython/Lib/test/regrtest.py", line 50 in 

  File "/home/travis/build/python/cpython/Lib/runpy.py", line 85 in _run_code
  File "/home/travis/build/python/cpython/Lib/runpy.py", line 193 in 
_run_module_as_main
test_cancel (test.test_concurrent_futures.FutureTests) ... ok
test_cancelled (test.test_concurrent_futures.FutureTests) ... ok
test_done (test.test_concurrent_futures.FutureTests) ... ok
test_done_callback_already_cancelled (test.test_concurrent_futures.FutureTests) 
... ok
test_done_callback_already_failed (test.test_concurrent_futures.FutureTests) 
... ok
test_done_callback_already_successful 
(test.test_concurrent_futures.FutureTests) ... ok
test_done_callback_raises (test.test_concurrent_futures.FutureTests) ... ok
test_done_callback_with_cancel (test.test_concurrent_futures.FutureTests) ... ok
test_done_callback_with_exception (test.test_concurrent_futures.FutureTests) 
... ok
test_done_callback_with_result (test.test_concurrent_futures.FutureTests) ... ok
test_exception_with_success (test.test_concurrent_futures.FutureTests) ... ok
test_exception_with_timeout (test.test_concurrent_futures.FutureTests) ... ok
test_repr (test.test_concurrent_futures.FutureTests) ... ok
test_result_with_cancel (test.test_concurrent_futures.FutureTests) ... ok
test_result_with_success (test.test_concurrent_futures.FutureTests) ... ok
test_result_with_timeout (test.test_concurrent_futures.FutureTests) ... ok
test_running (test.test_concurrent_futures.FutureTests) ... ok
test_correct_timeout_exception_msg 

[issue36294] `io.BufferedIOBase` returns `None`

2019-03-14 Thread Cyker Way


New submission from Cyker Way :

Document of 
[BufferedIOBase](https://docs.python.org/3/library/io.html#io.BufferedIOBase) 
says:

>   ...unlike their RawIOBase counterparts, they will never return None.

But this example shows the above statement is not true:

import io
import os
import sys

os.set_blocking(sys.stdin.fileno(), False)
print(isinstance(sys.stdin.buffer, io.BufferedIOBase))
print(sys.stdin.buffer.read())

Output:

True
None

--
components: IO, Library (Lib)
messages: 337941
nosy: cykerway
priority: normal
severity: normal
status: open
title: `io.BufferedIOBase` returns `None`
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



[issue36293] Nonblocking read sys.stdin raises error

2019-03-14 Thread Cyker Way


New submission from Cyker Way :

This piece of code will raise an error:

import os
import sys

os.set_blocking(sys.stdin.fileno(), False)
sys.stdin.read()

Error:

>   TypeError: can't concat NoneType to bytes

Not sure if this is relevant (for a different version of Python): 
https://bugs.python.org/issue24560

--
components: Library (Lib), Unicode
messages: 337940
nosy: cykerway, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: Nonblocking read sys.stdin raises 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



[issue36292] Coverity scan: Resource leaks in longobject.c

2019-03-14 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
keywords: +patch
pull_requests: +12304
stage:  -> patch review

___
Python tracker 

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



[issue36289] [2.7] Coverity scan: Modules/_io/bufferedio.c leaked_storage: Variable "data" going out of scope leaks the storage it points to.

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Charalampos, I merged your PR.

Python 3.7 and master are not affected: _bufferedreader_read_all() has been 
refactored to add a "cleanup" label which clears all local data including the 
'data' variable.

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



[issue36289] [2.7] Coverity scan: Modules/_io/bufferedio.c leaked_storage: Variable "data" going out of scope leaks the storage it points to.

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2dd6e079ae71f3723fbea2582ac080be06a6968f by Victor Stinner 
(stratakis) in branch '2.7':
[2.7] bpo-36289: Fix a possible reference leak in the io module (GH-12329)
https://github.com/python/cpython/commit/2dd6e079ae71f3723fbea2582ac080be06a6968f


--
nosy: +vstinner

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-03-14 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Please do add an entry to WhatsNew.

--

___
Python tracker 

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



[issue36262] Coverity scan: Python/dtoa.c resource leak

2019-03-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12303

___
Python tracker 

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



[issue36262] Coverity scan: Python/dtoa.c resource leak

2019-03-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12302

___
Python tracker 

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



[issue36292] Coverity scan: Resource leaks in longobject.c

2019-03-14 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue36291] [2.7] Coverity Scan: Modules/_json.c: leaked_storage: Variable "numstr" going out of scope leaks the storage it points to.

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Charalampos, I merged your PR.

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



[issue36291] [2.7] Coverity Scan: Modules/_json.c: leaked_storage: Variable "numstr" going out of scope leaks the storage it points to.

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fb3336acfde3204fd01ce519ef24cc18a94dfa3f by Victor Stinner 
(stratakis) in branch '2.7':
[2.7] bpo-36291: Fix a possible reference leak in the json module (GH-12330)
https://github.com/python/cpython/commit/fb3336acfde3204fd01ce519ef24cc18a94dfa3f


--

___
Python tracker 

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



[issue36291] [2.7] Coverity Scan: Modules/_json.c: leaked_storage: Variable "numstr" going out of scope leaks the storage it points to.

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

Note for myself: Python 3 isn't affected by this issue. The issue in Python 2 
is in the _match_number_str() function which doesn't exist in Python 3. In 
Python 3, _parse_object_unicode() uses a very different code: it calls 
PyFloat_FromString() or PyLong_FromString() for numstr.

--
nosy: +vstinner

___
Python tracker 

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



[issue36292] Coverity scan: Resource leaks in longobject.c

2019-03-14 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue36292] Coverity scan: Resource leaks in longobject.c

2019-03-14 Thread Charalampos Stratakis


New submission from Charalampos Stratakis :

The coverity scan was run on python2, however the same defect seems to exist in 
python3 as well.

Error: RESOURCE_LEAK (CWE-772): [#def69]
Python-2.7.15/Objects/longobject.c:3793: alloc_fn: Storage is returned from 
allocation function "_PyLong_New".
Python-2.7.15/Objects/longobject.c:76:5: alloc_fn: Storage is returned from 
allocation function "PyObject_Malloc".
Python-2.7.15/Objects/obmalloc.c:982:5: alloc_fn: Storage is returned from 
allocation function "malloc".
Python-2.7.15/Objects/obmalloc.c:982:5: return_alloc_fn: Directly returning 
storage allocated by "malloc".
Python-2.7.15/Objects/longobject.c:76:5: identity_transfer: Passing 
"(PyVarObject *)PyObject_Malloc((size_t)(PyLong_Type.tp_basicsize + size * 
PyLong_Type.tp_itemsize + 7L & 0xfff8L))" as argument 1 to function 
"PyObject_InitVar", which returns that argument.
Python-2.7.15/Objects/object.c:237:5: return_parm: Returning parameter "op".
Python-2.7.15/Objects/longobject.c:76:5: return_alloc_fn: Directly returning 
storage allocated by "PyObject_InitVar".
Python-2.7.15/Objects/longobject.c:3793: var_assign: Assigning: "z" = storage 
returned from "_PyLong_New(size_a)".
Python-2.7.15/Objects/longobject.c:3797: var_assign: Assigning: "a" = "z".
Python-2.7.15/Objects/longobject.c:3847: leaked_storage: Variable "z" going out 
of scope leaks the storage it points to.
Python-2.7.15/Objects/longobject.c:3847: leaked_storage: Returning without 
freeing "a" leaks the storage that it points to.
 3845|   default:
 3846|   PyErr_BadArgument();
 3847|-> return NULL;
 3848|   }
 3849|   

Error: RESOURCE_LEAK (CWE-772): [#def70]
Python-2.7.15/Objects/longobject.c:3793: alloc_fn: Storage is returned from 
allocation function "_PyLong_New".
Python-2.7.15/Objects/longobject.c:76:5: alloc_fn: Storage is returned from 
allocation function "PyObject_Malloc".
Python-2.7.15/Objects/obmalloc.c:982:5: alloc_fn: Storage is returned from 
allocation function "malloc".
Python-2.7.15/Objects/obmalloc.c:982:5: return_alloc_fn: Directly returning 
storage allocated by "malloc".
Python-2.7.15/Objects/longobject.c:76:5: identity_transfer: Passing 
"(PyVarObject *)PyObject_Malloc((size_t)(PyLong_Type.tp_basicsize + size * 
PyLong_Type.tp_itemsize + 7L & 0xfff8L))" as argument 1 to function 
"PyObject_InitVar", which returns that argument.
Python-2.7.15/Objects/object.c:237:5: return_parm: Returning parameter "op".
Python-2.7.15/Objects/longobject.c:76:5: return_alloc_fn: Directly returning 
storage allocated by "PyObject_InitVar".
Python-2.7.15/Objects/longobject.c:3793: var_assign: Assigning: "z" = storage 
returned from "_PyLong_New(size_a)".
Python-2.7.15/Objects/longobject.c:3797: var_assign: Assigning: "a" = "z".
Python-2.7.15/Objects/longobject.c:3820: var_assign: Assigning: "z" = "a".
Python-2.7.15/Objects/longobject.c:3820: var_assign: Assigning: "b" = "z".
Python-2.7.15/Objects/longobject.c:3847: leaked_storage: Variable "z" going out 
of scope leaks the storage it points to.
Python-2.7.15/Objects/longobject.c:3847: leaked_storage: Returning without 
freeing "b" leaks the storage that it points to.
 3845|   default:
 3846|   PyErr_BadArgument();
 3847|-> return NULL;
 3848|   }
 3849|

--
components: Interpreter Core
messages: 337933
nosy: cstratak
priority: normal
severity: normal
status: open
title: Coverity scan: Resource leaks in longobject.c
versions: Python 2.7, Python 3.7, Python 3.8

___
Python tracker 

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



[issue36212] [2.7] Coverity scan: Modules/_hotshot.c , Variable "s1" going out of scope leaks the storage it points to.

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2832ad53358e3fbc4bdc601b9f3fa04dd0deae46 by Victor Stinner 
(stratakis) in branch '2.7':
[2.7] bpo-36212: Fix two possible reference leaks in the hotshot module 
(GH-12327)
https://github.com/python/cpython/commit/2832ad53358e3fbc4bdc601b9f3fa04dd0deae46


--

___
Python tracker 

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



[issue36212] [2.7] Coverity scan: Modules/_hotshot.c , Variable "s1" going out of scope leaks the storage it points to.

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Charalampos, I merged your PR. I made minor changes in your commit 
message.

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



[issue36212] [2.7] Coverity scan: Modules/_hotshot.c , Variable "s1" going out of scope leaks the storage it points to.

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

Note for myself: Python 3 isn't affected, _hotshot module has been removed from 
Python 3.

--
nosy: +vstinner

___
Python tracker 

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



[issue36268] Change default tar format to modern POSIX 2001 (pax) for better portability/interop, support and standards conformance

2019-03-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Do you mind to create a PR?

--

___
Python tracker 

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



[issue36291] [2.7] Coverity Scan: Modules/_json.c: leaked_storage: Variable "numstr" going out of scope leaks the storage it points to.

2019-03-14 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
keywords: +patch
pull_requests: +12301
stage:  -> patch review

___
Python tracker 

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



[issue36291] [2.7] Coverity Scan: Modules/_json.c: leaked_storage: Variable "numstr" going out of scope leaks the storage it points to.

2019-03-14 Thread Julien Palard


Change by Julien Palard :


--
assignee:  -> matrixise
nosy: +matrixise

___
Python tracker 

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



[issue33002] Making a class formattable as hex/oct integer with printf-style formatting requires both __int__ and __index__ for no good reason

2019-03-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Resolved in issue36048.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deprecate implicit truncating when convert Python numbers to C 
integers: use __index__, not __int__

___
Python tracker 

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



[issue12974] array module: deprecate '__int__' conversion support for array elements

2019-03-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Deprecate implicit truncating when convert Python numbers to C 
integers: use __index__, not __int__

___
Python tracker 

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



[issue36291] [2.7] Coverity Scan: Modules/_json.c: leaked_storage: Variable "numstr" going out of scope leaks the storage it points to.

2019-03-14 Thread Charalampos Stratakis


New submission from Charalampos Stratakis :

Coverity reports a leak within the json module:

Error: RESOURCE_LEAK (CWE-772): [#def26]
Python-2.7.15/Modules/_json.c:1367: alloc_fn: Storage is returned from 
allocation function "PyString_FromStringAndSize".
Python-2.7.15/Objects/stringobject.c:88:5: alloc_fn: Storage is returned from 
allocation function "PyObject_Malloc".
Python-2.7.15/Objects/obmalloc.c:982:5: alloc_fn: Storage is returned from 
allocation function "malloc".
Python-2.7.15/Objects/obmalloc.c:982:5: return_alloc_fn: Directly returning 
storage allocated by "malloc".
Python-2.7.15/Objects/stringobject.c:88:5: var_assign: Assigning: "op" = 
"PyObject_Malloc(37UL + size)".
Python-2.7.15/Objects/stringobject.c:111:5: return_alloc: Returning allocated 
memory "op".
Python-2.7.15/Modules/_json.c:1367: var_assign: Assigning: "numstr" = storage 
returned from "PyString_FromStringAndSize([start], idx - start)".
Python-2.7.15/Modules/_json.c:1379: leaked_storage: Variable "numstr" going out 
of scope leaks the storage it points to.
 1377|NULL, NULL);
 1378|   if (d == -1.0 && PyErr_Occurred())
 1379|-> return NULL;
 1380|   rval = PyFloat_FromDouble(d);
 1381|   }

--
components: Extension Modules
messages: 337927
nosy: cstratak
priority: normal
severity: normal
status: open
title: [2.7] Coverity Scan: Modules/_json.c: leaked_storage: Variable "numstr" 
going out of scope leaks the storage it points to.
versions: Python 2.7

___
Python tracker 

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



[issue36290] _ast.ast_type_init does not handle args and kwargs correctly.

2019-03-14 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

While looking at issue 36287 I noticed that the argument parsing logic in 
_ast.ast_type_init is wrong, for example ast.Constant takes only one argument:

✗ ./python.exe 
Python 3.8.0a2+ (remotes/origin/HEAD-1-ged9b774cf3:ed9b774cf3, Mar 14 2019, 
00:50:47) 
[Clang 10.0.0 (clang-1000.10.44.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> ast.Constant(1, 2)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Constant constructor takes at most 1 positional argument
>>> ast.Constant(1)
<_ast.Constant object at 0x105b52950>
>>> ast.Constant(value=2)
<_ast.Constant object at 0x105b528f0>
>>> ast.Constant(1, value=2)
<_ast.Constant object at 0x105b529b0>
>>> ast.Constant(1, value=2).value
2


The last lines should have raised TypeError. I could reproduce the issue with 
Python 2.7, 3.7 and 3.8 but I'm not sure it's worth fixing for 2.7.

I will write a patch to fix the issue.

--
components: Library (Lib)
messages: 337926
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: _ast.ast_type_init does not handle args and kwargs correctly.
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue36289] [2.7] Coverity scan: Modules/_io/bufferedio.c leaked_storage: Variable "data" going out of scope leaks the storage it points to.

2019-03-14 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
keywords: +patch
pull_requests: +12300
stage:  -> patch review

___
Python tracker 

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



[issue36288] Incorrect answer when using round()

2019-03-14 Thread Zachary Ware


Change by Zachary Ware :


--
components:  -Build

___
Python tracker 

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



[issue36288] Incorrect answer when using round()

2019-03-14 Thread Zachary Ware


Zachary Ware  added the comment:

Please see the documentation for `round`, it explains this: 
https://docs.python.org/3/library/functions.html#round

--
nosy: +zach.ware -remi.lapeyre
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: behavior -> 

___
Python tracker 

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



[issue36288] Incorrect answer when using round()

2019-03-14 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Thanks for submitting a report MeeranRizvi.

This is the expected behavior, according to the IEEE 754 Python round to 
nearest even integer. This is called the bankers' rounding and is done (I 
think) to limitate the propagation of errors.

I suggest we close this as not a bug.

--
nosy: +remi.lapeyre
type:  -> behavior

___
Python tracker 

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



[issue36289] [2.7] Coverity scan: Modules/_io/bufferedio.c leaked_storage: Variable "data" going out of scope leaks the storage it points to.

2019-03-14 Thread Charalampos Stratakis


New submission from Charalampos Stratakis :

Coverity scan reports this for bufferedio.c :

Error: RESOURCE_LEAK (CWE-772): [#def23]
Python-2.7.15/Modules/_io/bufferedio.c:1353: alloc_fn: Storage is returned from 
allocation function "PyString_FromStringAndSize".
Python-2.7.15/Objects/stringobject.c:88:5: alloc_fn: Storage is returned from 
allocation function "PyObject_Malloc".
Python-2.7.15/Objects/obmalloc.c:982:5: alloc_fn: Storage is returned from 
allocation function "malloc".
Python-2.7.15/Objects/obmalloc.c:982:5: return_alloc_fn: Directly returning 
storage allocated by "malloc".
Python-2.7.15/Objects/stringobject.c:88:5: var_assign: Assigning: "op" = 
"PyObject_Malloc(37UL + size)".
Python-2.7.15/Objects/stringobject.c:111:5: return_alloc: Returning allocated 
memory "op".
Python-2.7.15/Modules/_io/bufferedio.c:1353: var_assign: Assigning: "data" = 
storage returned from "PyString_FromStringAndSize(self->buffer + self->pos, 
current_size)".
Python-2.7.15/Modules/_io/bufferedio.c:1366: leaked_storage: Variable "data" 
going out of scope leaks the storage it points to.
 1364|   if (res == NULL) {
 1365|   Py_DECREF(chunks);
 1366|-> return NULL;
 1367|   }
 1368|   Py_CLEAR(res);

--
components: Extension Modules
messages: 337923
nosy: cstratak
priority: normal
severity: normal
status: open
title: [2.7] Coverity scan: Modules/_io/bufferedio.c leaked_storage: Variable 
"data" going out of scope leaks the storage it points to.
versions: Python 2.7

___
Python tracker 

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



[issue36288] Incorrect answer when using round()

2019-03-14 Thread MeeranRizvi


New submission from MeeranRizvi :

When using round() for calculation it gives the incorrect answer.

For Example:
round(1.5)
>>2(Which is correct)

But when we calculate:
round(2.5)
>>2(Should give 3 right?)

--
components: Build
messages: 337921
nosy: MeeranRizvi
priority: normal
severity: normal
status: open
title: Incorrect answer when using round()
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



[issue33944] Deprecate and remove pth files

2019-03-14 Thread Nick Coghlan


Nick Coghlan  added the comment:

Just noting that https://bugs.python.org/issue14803 is probably our most 
comprehensive discussion of the coverage use case for arbitrary pre-__main__ 
code execution.

Steve also made a comment above about potentially turning encodings into a 
namespace package: that's difficult due to the non-empty `__init__.py` file 
that registers a couple of codec search functions as a side effect of import: 
https://github.com/python/cpython/blob/master/Lib/encodings/__init__.py

However, it would be possible to define a *new* namespace package for codec 
discovery that was searched after the standard search locations (so you could 
use it to add extra codecs, but not hijack existing ones).

--
dependencies: +Add feature to allow code execution prior to __main__ invocation

___
Python tracker 

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



[issue36287] Make ast.dump() not output optional default fields

2019-03-14 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
keywords: +patch
pull_requests: +12299
stage:  -> patch review

___
Python tracker 

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



[issue36287] Make ast.dump() not output optional default fields

2019-03-14 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

Hi @serhiy.storchaka,

I send a patch to Github to review. Let me know if is necessary unittest. 

Regards

--

___
Python tracker 

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



[issue36263] test_hashlib.test_scrypt() fails on Fedora 29

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote a PR to fix OpenSSL:
https://github.com/openssl/openssl/pull/8483

--

___
Python tracker 

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



[issue36266] Which module could not be found?

2019-03-14 Thread Steve Dower


Steve Dower  added the comment:

Okay, in that case we're just adding `shortname` into the formatted `message` 
in _PyImport_FindSharedFuncptrWindows in Python/dynload_win.c

I've marked this as "easy (C)" as it seems like a good first contribution for 
someone.

--
keywords: +easy (C)
resolution: third party -> 
stage: resolved -> test needed
status: closed -> open
type:  -> enhancement
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

> Victor, I thought that the news changes were only for major changes.

It's a backward incompatible change. It broke at least docutils. So it should 
be mentioned at least at:
https://docs.python.org/dev/whatsnew/3.8.html#changes-in-the-python-api

--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-03-14 Thread Diego Rojas


Diego Rojas  added the comment:

Victor, I thought that the news changes were only for major changes. 

In another hand, I could retake this bug in a few days with the issues that you 
mentioned.

--

___
Python tracker 

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



[issue36202] Calling Py_DecodeLocale() before _PyPreConfig_Write() can produce mojibake

2019-03-14 Thread Nick Coghlan


Nick Coghlan  added the comment:

Victor and I were discussing the appropriate behaviour for the "What do we do 
if _Py_PreInitialize() hasn't been called?" case, and Victor pointed out that 
the potential for mojibake provides a solid rationale for going back to the 
Python 3.6 behaviour: disable both C locale coercion *and* UTF-8 mode, and 
instead leave locale management to the embedding application.

That would also get us back to the originally intended behaviour of PEP 538, 
where it only happens by default in the CLI app, not the runtime support 
library. Back when I decided that doing that would be too complicated, the 
_Py_PreInitialize API didn't exist yet, and it didn't occur to me that the 
mojibake problem would affect UTF-8 mode as well.

--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

This change broke docutils test suite: 
https://sourceforge.net/p/docutils/bugs/359/

Problems:

* I cannot see the change documented anywhere in 
https://docs.python.org/dev/whatsnew/3.8.html
* I don't see any simple workaround. It would be nice to add an opt-in option 
to sort attributes just to get Python 3.7 behavior.

--

___
Python tracker 

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



[issue36212] [2.7] Coverity scan: Modules/_hotshot.c , Variable "s1" going out of scope leaks the storage it points to.

2019-03-14 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
keywords: +patch
pull_requests: +12298
stage:  -> patch review

___
Python tracker 

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



[issue15749] cgitb prints html for text when display disabled.

2019-03-14 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Hi Rémi, 

I think @r.david.murray would need to review the PR, based on his last comment. 
 That's why I was asking whether the patch should be converted to a PR.  There 
seemed to be a conflict between this and issue 12890 and I wasn't certain which 
parts of this one were still useful.

However, having the PR may make it easier to review, so thank you for opening 
it.

--

___
Python tracker 

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



[issue36231] no "proper" header files on macOS 10.14 Mojave

2019-03-14 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report and for the PR offer but let's hold off on that for the 
moment: I'm planning to merge a somewhat different approach.

--
assignee:  -> ned.deily

___
Python tracker 

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



[issue35647] Cookie path check returns incorrect results

2019-03-14 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Got it, Larry. I wanted to track it and make sure you don't miss it. Looks like 
we have the PR from @xtreak for 3.4 and 3.5 branches.
Thank you!

--

___
Python tracker 

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



[issue36287] Make ast.dump() not output optional default fields

2019-03-14 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



[issue36216] CVE-2019-9636: urlsplit does not handle NFKC normalization

2019-03-14 Thread STINNER Victor


Change by STINNER Victor :


--
title: urlsplit does not handle NFKC normalization -> CVE-2019-9636: urlsplit 
does not handle NFKC normalization

___
Python tracker 

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



[issue36276] Python urllib CRLF injection vulnerability

2019-03-14 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Thanks for this report. Should we make this a duplicate of this issue30458 - as 
they are both referring to the same problem with the underlying library?

--

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2019-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

Please stop to send new PRs which depend on other PRs which are not merged yet, 
it becomes too hard to follow :-( Let's focus on first PRs.

--

___
Python tracker 

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



[issue30040] new empty dict can be more small

2019-03-14 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 3fe7fa316f74ed630fbbcdf54564f15cda7cb045 by Inada Naoki in branch 
'master':
bpo-30040: update news entry (GH-12324)
https://github.com/python/cpython/commit/3fe7fa316f74ed630fbbcdf54564f15cda7cb045


--

___
Python tracker 

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



[issue36287] Make ast.dump() not output optional default fields

2019-03-14 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Currently ast.dump() outputs values for optional fields even if they are equal 
to defaults. This makes the output unnecessary verbose.

For example (kind and type_comment are optional):

>>> ast.dump(ast.parse('x = 1'))
"Module(body=[Assign(targets=[Name(id='x', ctx=Store())], 
value=Constant(value=1, kind=None), type_comment=None)], type_ignores=[])"

--
components: Library (Lib)
messages: 337907
nosy: benjamin.peterson, brett.cannon, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Make ast.dump() not output optional default fields
type: enhancement
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



[issue30040] new empty dict can be more small

2019-03-14 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +12297

___
Python tracker 

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



[issue36231] no "proper" header files on macOS 10.14 Mojave

2019-03-14 Thread Dmitrii Pasechnik


Dmitrii Pasechnik  added the comment:

I won't mind to provide a PR for this. but it is not clear what the goal should 
be. Is it to build a working OSX Python with as few external to Xcode deps (it 
seems that only lzma is needed) as possible?

--

___
Python tracker 

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



[issue33350] WinError 10038 is raised when loop.sock_connect is wrapped with asyncio.wait_for

2019-03-14 Thread yjq


yjq  added the comment:

I'm using python 3.7.2. And I met the same problem.

--
nosy: +yjqiang

___
Python tracker 

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



[issue36254] Fix invalid uses of %d in format strings in C

2019-03-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 783bed4c8daf65a2893d94761ea44af4e3718f4f by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264). 
(GH-12322)
https://github.com/python/cpython/commit/783bed4c8daf65a2893d94761ea44af4e3718f4f


--

___
Python tracker 

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



[issue36127] Argument Clinic: inline parsing code for functions with keyword parameters

2019-03-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 3191391515824fa7f3c573d807f1034c6a28fab3 by Serhiy Storchaka in 
branch 'master':
bpo-36127: Argument Clinic: inline parsing code for keyword parameters. 
(GH-12058)
https://github.com/python/cpython/commit/3191391515824fa7f3c573d807f1034c6a28fab3


--

___
Python tracker 

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



[issue36254] Fix invalid uses of %d in format strings in C

2019-03-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +12296

___
Python tracker 

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



[issue30040] new empty dict can be more small

2019-03-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I do not like how much code is needed for such minor optimization.

--

___
Python tracker 

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



[issue36254] Fix invalid uses of %d in format strings in C

2019-03-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2c0d3f454705bb5ccf5f6189f3cf77bbae4f056b by Serhiy Storchaka in 
branch 'master':
bpo-36254: Fix yet one invalid use of %d in format string in C. (GH-12318)
https://github.com/python/cpython/commit/2c0d3f454705bb5ccf5f6189f3cf77bbae4f056b


--

___
Python tracker 

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



[issue30040] new empty dict can be more small

2019-03-14 Thread Inada Naoki


Inada Naoki  added the comment:

Benchmark result is here.

https://github.com/methane/sandbox/tree/master/2019.01/empty-dict

notes:

* Overhead introduced by PR 1080 (https://bugs.python.org/issue30040#msg337778) 
is cancelled by first insert optimization.  It is now faster than before.

* PR 12307 (first insert optimization) is about 2x faster on creating & destroy 
empty dict.  Other performance diff is small.

* PR 12308 (use keys=NULL instead of shared empty keys) is more faster than PR 
12307 on some cases, while it requires much `if (md->ma_keys == NULL)` checks.

--

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2019-03-14 Thread Peixing Xin


Change by Peixing Xin :


--
pull_requests: +12295

___
Python tracker 

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



[issue36254] Fix invalid uses of %d in format strings in C

2019-03-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +12294

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2019-03-14 Thread Yue Sun


Change by Yue Sun :


--
pull_requests: +12293

___
Python tracker 

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



[issue36282] Not accurate error message for exact number of positional arguments

2019-03-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type: behavior -> enhancement

___
Python tracker 

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



[issue36284] importlib.import_module() not thread safe if Exception is raised (3.4, 3.5)

2019-03-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

3.4 and 3.5 take only security fixes. The only solution of this problem is 
upgrading to 3.6 or 3.7.

--
nosy: +serhiy.storchaka
resolution:  -> out of date
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



[issue36254] Fix invalid uses of %d in format strings in C

2019-03-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +12292

___
Python tracker 

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



[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2019-03-14 Thread SilentGhost


Change by SilentGhost :


--
Removed message: https://bugs.python.org/msg337895

___
Python tracker 

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



[issue36266] Which module could not be found?

2019-03-14 Thread Phillip M. Feldman


Phillip M. Feldman  added the comment:

'Should include "_ssl" somewhere in the message?'  Exactly so.  If a given
import statement imports 30 items, it would be helpful to know which one
caused the hickup.  Thanks!

On Wed, Mar 13, 2019 at 12:28 PM Steve Dower  wrote:

>
> Steve Dower  added the comment:
>
> You mean like this:
>
> >>> import _ssl
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: DLL load failed: The specified module could not be found.
>
> Should include "_ssl" somewhere in the message? That's easy enough, but
> it's never been what anyone else has meant when they've asked for this, so
> I assumed you wanted the more helpful message (where it tells you exactly
> which DLL is missing - libcrypto-1_1-x64.dll in this case - and *that's*
> the one we can't do).
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2019-03-14 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
Removed message: https://bugs.python.org/msg337896

___
Python tracker 

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



[issue36286] Random failure in test_idle

2019-03-14 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

I have got a failure in test_idle:

0:00:21 load avg: 3.40 [ 76/420/1] test_idle failed
test test_idle failed -- Traceback (most recent call last):
  File 
"/home/serhiy/py/cpython-clinic/Lib/idlelib/idle_test/test_configdialog.py", 
line 104, in test_fontlist_key
self.assertNotEqual(down_font, font)
AssertionError: 'Abyssinica SIL' == 'Abyssinica SIL'

It has not reproduced when run test_idle separately.

--
assignee: terry.reedy
components: IDLE, Tests
messages: 337897
nosy: serhiy.storchaka, terry.reedy
priority: normal
severity: normal
status: open
title: Random failure in test_idle
type: behavior
versions: Python 3.8

___
Python tracker 

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