[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-24 Thread STINNER Victor


STINNER Victor  added the comment:

I added many fields to _PyCoreConfig which duplicate global configuration 
varibles: _PyConfigCore.isolated duplicates Py_IsolatedFlag.

I started to modify Python to read the core configuration rather than global 
configuration flags. The problem is that sometimes, global configuration flags 
are updated, but not their duplicated core configuration fields.

Example from Modules/main.c:

static void
pymain_repl(_PyMain *pymain, _PyCoreConfig *config, PyCompilerFlags *cf)
{
/* Check this environment variable at the end, to give programs the
   opportunity to set it from Python. */
if (!Py_InspectFlag && config_get_env_var(config, "PYTHONINSPECT")) {
Py_InspectFlag = 1;
}
...
}

Only Py_InspectFlag is not, not core_config.inspect.

--

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-24 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7980

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-24 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1dc6e3906acb81163725e98378bf4d1bd1ce771a by Victor Stinner in 
branch 'master':
bpo-34170: Add _Py_InitializeFromConfig() (GH-8454)
https://github.com/python/cpython/commit/1dc6e3906acb81163725e98378bf4d1bd1ce771a


--

___
Python tracker 

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



[issue34217] windows: cross compilation fails due to headers with uppercase

2018-07-24 Thread INADA Naoki


Change by INADA Naoki :


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



[issue34217] windows: cross compilation fails due to headers with uppercase

2018-07-24 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset 6cf8255912c36fec6f87f62513034d0818f61390 by INADA Naoki 
(erikjanss) in branch 'master':
bpo-34217: Use lowercase header for Windows (GH-8453)
https://github.com/python/cpython/commit/6cf8255912c36fec6f87f62513034d0818f61390


--
nosy: +inada.naoki

___
Python tracker 

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



[issue34209] racecondition

2018-07-24 Thread INADA Naoki


INADA Naoki  added the comment:

https://docs.python.org/3/library/os.html#os.access
It is already documented.  What's point of this issue?

--
nosy: +inada.naoki

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-24 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7979

___
Python tracker 

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



[issue34217] windows: cross compilation fails due to headers with uppercase

2018-07-24 Thread Erik Janssens


Change by Erik Janssens :


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

___
Python tracker 

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



[issue34217] windows: cross compilation fails due to headers with uppercase

2018-07-24 Thread Erik Janssens


New submission from Erik Janssens :

When cross compiling python on a linux host with a case sensitive file system 
for a windows target.  The compilation will fail due to header
files which contain uppercases.

--
components: Cross-Build, Windows
messages: 322333
nosy: Alex.Willmer, erikjanss, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: windows: cross compilation fails due to headers with uppercase
type: compile error
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



[issue34213] Frozen dataclass __init__ fails for "object" property"

2018-07-24 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

Hello.

This is my solution for this problem - 
https://github.com/python/cpython/pull/8452

Sorry if I'm not supposed to do anything about the already assigned issue, feel 
free to ignore my PR.

--

___
Python tracker 

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



[issue34213] Frozen dataclass __init__ fails for "object" property"

2018-07-24 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue34216] python platform no child error

2018-07-24 Thread sachin


New submission from sachin :

We are trying to utilize librosa library for some processing. When we try to 
load the librosa library, python platform library is triggered via the  Numba 
library. Numba is trying to find the underlying OS which is installed. Function 
"_syscmd_uname" is triggered to find out the underlying os, but in the above 
function the os.popen object which is opened to determine the OS , but when the 
object is closed it throws a no child process error. This is mainly due to the 
closure of the popen object before the close fuction is called. we can get 
around this problem 
by catching the error and returning a default value if the closing of the popen 
pipeline fails

python platform.py file

def _syscmd_uname(option, default=''):

""" Interface to the system's uname command.
"""
if sys.platform in ('dos', 'win32', 'win16'):
# XXX Others too ?
return default
try:
f = os.popen('uname %s 2> %s' % (option, DEV_NULL))
except (AttributeError, OSError):
return default
output = f.read().strip()
rc = f.close()  # error at this place enclose in a try except statement to 
catrch the exception
if not output or rc:
return default
else:
return output

--
components: Build
messages: 322330
nosy: sskamble619
priority: normal
severity: normal
status: open
title: python platform no child error
type: compile error
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



[issue34215] streams.py:readuntil IncompleteReadError is message is incorrect

2018-07-24 Thread Tyler Bell


New submission from Tyler Bell :

This may have already been cleared as I opened the PR months ago
But the gist is that the Exception is misleading and the test is incorrect.

--
components: Library (Lib)
messages: 322329
nosy: mrbell...@gmail.com
priority: normal
pull_requests: 7975
severity: normal
status: open
title: streams.py:readuntil IncompleteReadError is message is incorrect
type: enhancement
versions: Python 3.5

___
Python tracker 

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



[issue34213] Frozen dataclass __init__ fails for "object" property"

2018-07-24 Thread Vadim Pushtaev


Change by Vadim Pushtaev :


--
nosy: +Vadim Pushtaev

___
Python tracker 

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



[issue34214] Pylint recusion stack overflow abort

2018-07-24 Thread Nick Drozd


New submission from Nick Drozd :

In certain very, very specific circumstances, Pylint can cause the interpreter 
to abort with a stack overflow error.

I've seen this issue on 3.5, 3.6, and 3.8 (I assume it affects 3.7 as well) and 
on both Mac and Ubuntu.

It requires:
  * 1.7 <= Pylint version < 1.9
  * 1.6.0 <= Astroid version < 1.6.2
- (For interpreter versions > 3.6, commit 
https://github.com/PyCQA/astroid/commit/c09743079d07ffc3918969ab203f766b29e0
 is also required.)
  * The dependencies of Pylint and Astroid (I'm not aware of any specific 
versions needed.)

The crash comes from running Pylint on the file stack-overflow-abort.py 
(https://github.com/nickdrozd/pylint/blob/80b05dace5049b8a837b8c530a57321381717ddb/stack-overflow-abort.py).
 This causes the interpreter to abort with the message "Fatal Python error: 
Cannot recover from stack overflow."

Now, it's not surprising that some kind of stack depth error occurs here, as 
the target code is recursive, Pylint is recursive, and and Astroid 1.6.0 had a 
bug in its handling of augmented assign statements (this bug was fixed in 1.6.2 
with a one-line change: 
https://github.com/PyCQA/astroid/commit/3fae32f99c7f432a1281b151ea17e163a2e8dc47).
 But this recursion bug should be handled with a RecursionError instead of an 
abort.

What's strange is that running Pylint on the file caught-recursion-error.py 
(https://github.com/nickdrozd/pylint/blob/80b05dace5049b8a837b8c530a57321381717ddb/caught-recursion-error.py),
 which differs from stack-overflow-abort.py in just three characters, does end 
up with a RecursionError (neither file is large at all). So it looks like 
something subtle is happening here. I tried looking around to see if I could 
figure it out, and I could not. All I was able to discover is that changing 50 
to other numbers in _Py_CheckRecursiveCall causes the error to come from 
different places: at the beginning of the eval loop, "while calling a Python 
object" at several points, and "in comparison".

I've included the text of a shell session showing the errors.

Repo links to versions of Pylint and Astroid that cause the error:
https://github.com/nickdrozd/pylint/tree/crash
https://github.com/nickdrozd/astroid/tree/crash

See https://github.com/PyCQA/pylint/issues/1805 for further discussion.

--
components: Interpreter Core
files: shell-session
messages: 322328
nosy: nickdrozd
priority: normal
severity: normal
status: open
title: Pylint recusion stack overflow abort
type: crash
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47711/shell-session

___
Python tracker 

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



[issue34115] code.InteractiveConsole.interact() closes stdin

2018-07-24 Thread Yonatan Zunger


Yonatan Zunger  added the comment:

Eryk: Thanks for finding that! So that I'm sure I understand, if 34187 is
resolved, does that mean the stdin.close() is no longer required at all in
_Quitter?

On Sun, Jul 22, 2018 at 2:12 AM Eryk Sun  wrote:

>
> Eryk Sun  added the comment:
>
> > On Windows Console, sys.stdin.close() does not prevent a second
> > interact call.  This might be considered a bug.
>
> This is a bug in io._WindowsConsoleIO.
>
> In Python 3, the sys.std* file objects that get created at startup use
> closefd=False:
>
> >>> sys.stdin.buffer.raw.closefd
> False
> >>> sys.stdout.buffer.raw.closefd
> False
> >>> sys.stderr.buffer.raw.closefd
> False
>
> Since the REPL uses C FILE streams (or in 3.6+ the underlying console file
> handle in Windows), closing sys.stdin does not cause the REPL to exit, and
> the PyOS_ReadLine call in the interactive loop continues to work in both
> POSIX and Windows.
>
> That said, closing sys.stdin should cause input() to raise ValueError due
> to sys.stdin.fileno() failing (i.e. take the non-tty path) and subsequently
> sys.stdin.readline() failing. A second call to
> code.InteractiveConsole.interact() should thus fail. The issue is that the
> fileno() method of _WindowsConsoleIO isn't raising ValueError like it
> should when the file is closed and closefd is false. I've created issue
> 34187 with a suggested fix.
>
> --
> nosy: +eryksun
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue1539381] Add readinto method to StringIO and cStringIO

2018-07-24 Thread Alan Justino


Alan Justino  added the comment:

Issued a related PR (https://github.com/python/cpython/pull/8451) to allow 
SpooledTemporaryFile to propagate `readinto` calls to TemporaryFile, BytesIO or 
StringIO.

Of this ones, only StringIO will fail.

--

___
Python tracker 

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



[issue1539381] Add readinto method to StringIO and cStringIO

2018-07-24 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +7973

___
Python tracker 

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



[issue25083] Python can sometimes create incorrect .pyc files

2018-07-24 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-24 Thread tzickel


Change by tzickel :


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

___
Python tracker 

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



[issue25083] Python can sometimes create incorrect .pyc files

2018-07-24 Thread tzickel


Change by tzickel :


--
pull_requests: +7971
stage:  -> patch review

___
Python tracker 

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



[issue34158] Documentation of datetime '%z' format code is odd

2018-07-24 Thread Christophe Nanteuil


Christophe Nanteuil  added the comment:

PR updated according to Martin Panter comments.

--

___
Python tracker 

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



[issue1539381] Add readinto method to StringIO and cStringIO

2018-07-24 Thread Alan Justino


Alan Justino  added the comment:

It affects SpooledTemporaryFile too. Because it switches between StringIO, 
BytesIO and TemporaryFile internally. Only StringIO have not this interface.

Discovered trying to `pickle.load` a remote storage file.

Please reopen.

--
nosy: +alanjds

___
Python tracker 

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



[issue34195] test_nt_helpers fails with case difference in drive letter

2018-07-24 Thread Tim Golden


Change by Tim Golden :


--
keywords: +patch
pull_requests: +7970
stage: needs patch -> patch review

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-24 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7969

___
Python tracker 

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



[issue34213] Frozen dataclass __init__ fails for "object" property"

2018-07-24 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith
nosy: +eric.smith

___
Python tracker 

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



[issue34060] regrtest: log "CPU usage" on Windows

2018-07-24 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

> PR 8287 seems short to me and it seems like psutils doesn't expose Processor 
> Queue Length, so I'm not sure why we are talking about depending on psutils?

I'm not sure if you're strictly interested in getting system load or if CPU 
utilization is also fine. FWIW with psutil you would be able to get the 
system-wide CPU utilization occurred in a given period of time:

>>> import psutil, time
>>> psutil.cpu_percent(interval=None)  # non-blocking
0.0
>>> time.sleep(60)
>>> psutil.cpu_percent(interval=None)  # average of the last 60 secs
23.6
>>>

...and you can do the same for the current process too 
(psutil.Process().cpu_percent()).

--

___
Python tracker 

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



[issue34213] Frozen dataclass __init__ fails for "object" property"

2018-07-24 Thread Edward Jones


New submission from Edward Jones :

When `__init__` is called for a class which 1) is annotated with 
`@dataclasses.dataclass(frozen=True)` and 2) has a attribute named `object` a 
TypeError is raised because `object` is overridden for the local scope and as a 
result `__setattr__` is called on the passed in argument value instead of the 
standard `object` base type.

I was able to reproduce this in a Docker container running 
https://github.com/docker-library/python/blob/7a794688c7246e7eff898f5288716a3e7dc08484/3.7/stretch/Dockerfile
 with the attached .py file.
Python 3.7.0 (default, Jul 17 2018, 11:04:33) 
[GCC 6.3.0 20170516] on linux

--
components: Library (Lib)
files: frozen_dataclass_init_typeerror.py
messages: 322321
nosy: Omenien
priority: normal
severity: normal
status: open
title: Frozen dataclass __init__ fails for "object" property"
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file47710/frozen_dataclass_init_typeerror.py

___
Python tracker 

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



[issue34173] [3.7] deadlock in /usr/lib/python3.7/concurrent/futures/thread.py

2018-07-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Sorry for the noise about the title change. It seems you have edited it while I 
was typing my comment. There was a form error while I tried submit but I 
ignored it to try again and it had set my title. I have reverted back to your 
edit.

Thanks

--
title: [3.7] possible race condition in 
/usr/lib/python3.7/concurrent/futures/thread.py -> [3.7] deadlock in 
/usr/lib/python3.7/concurrent/futures/thread.py

___
Python tracker 

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



[issue34173] [3.7] possible race condition in /usr/lib/python3.7/concurrent/futures/thread.py

2018-07-24 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Thanks, can confirm it on Python 3.7 . Unfortunately I couldn't test it with 
master since I have some problems setting up virtualenv and pip with the 
compiled binary. Running it on Python 3.7 hangs

(bpo34173-env) ➜  cpython git:(master) ✗ python
Python 3.7.0 (default, Jun 28 2018, 02:32:19)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

(bpo34173-env) ➜  cpython git:(master) ✗ python bpo34173-recreate.py
^CException in worker
Traceback (most recent call last):
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 78, in _worker
work_item = work_queue.get(block=True)
KeyboardInterrupt
^CException in worker
Traceback (most recent call last):
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 78, in _worker
work_item = work_queue.get(block=True)
KeyboardInterrupt
^CException in worker
Traceback (most recent call last):
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 78, in _worker
work_item = work_queue.get(block=True)
KeyboardInterrupt
^CException in worker
Traceback (most recent call last):
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 78, in _worker
work_item = work_queue.get(block=True)
KeyboardInterrupt
^CException in worker
Traceback (most recent call last):
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 78, in _worker
work_item = work_queue.get(block=True)
KeyboardInterrupt
Finished Tasks ['UnnamedTask', 'UnnamedTask', 'UnnamedTask', 'UnnamedTask', 
'UnnamedTask']s in 14.368564367294312fs



Thanks

--
title: [3.7] deadlock in /usr/lib/python3.7/concurrent/futures/thread.py -> 
[3.7] possible race condition in /usr/lib/python3.7/concurrent/futures/thread.py

___
Python tracker 

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



[issue34173] [3.7] deadlock in /usr/lib/python3.7/concurrent/futures/thread.py

2018-07-24 Thread Corey Bryant


Change by Corey Bryant :


--
title: [3.7] possible race condition in 
/usr/lib/python3.7/concurrent/futures/thread.py -> [3.7] deadlock in 
/usr/lib/python3.7/concurrent/futures/thread.py

___
Python tracker 

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



[issue34173] [3.7] possible race condition in /usr/lib/python3.7/concurrent/futures/thread.py

2018-07-24 Thread Corey Bryant


Corey Bryant  added the comment:

eventlet issue opened at: https://github.com/eventlet/eventlet/issues/508

--

___
Python tracker 

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



[issue34173] [3.7] possible race condition in /usr/lib/python3.7/concurrent/futures/thread.py

2018-07-24 Thread Corey Bryant


Corey Bryant  added the comment:

I've narrowed this down a bit more. It appears to be caused by eventlet 
patching of standard library thread modules. See new attached patch 
bp034173-recreate.py. I'll get a bug opened against eventlet.

--
Added file: https://bugs.python.org/file47709/bpo34173-recreate.py

___
Python tracker 

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



[issue34212] Cygwin link failure with builtin modules since issue30860

2018-07-24 Thread Erik Bray


Change by Erik Bray :


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

___
Python tracker 

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



[issue34212] Cygwin link failure with builtin modules since issue30860

2018-07-24 Thread Erik Bray


New submission from Erik Bray :

Since issue30860, libpython is no longer able to be linked as a shared library, 
because built-in modules are not compiled with the correct external linkage 
flags.

This is due to the removal of -DPy_BUILD_CORE, which in pyport.h is used to 
control wither __declspec(dllexport) is used as opposed to 
__declspec(dllimport).

Fortunately Eric Snow already added in 
https://github.com/python/cpython/pull/3458 a new flag Py_BUILD_CORE_BUILTIN 
which is used sparingly on Windows, and which should also be used, e.g. on 
Cygwin or MinGW, when compiling modules that are linked into libpython as 
built-ins.  It sets the right external linkage flags without carrying the 
additional weight of Py_BUILD_CORE.

This along with issue34211 need to be fixed in order to get Python 3.7+ 
building on Cygwin again.

--
components: Build
keywords: 3.7regression
messages: 322316
nosy: erik.bray
priority: normal
severity: normal
status: open
title: Cygwin link failure with builtin modules since issue30860
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



[issue34192] FunctionType.__new__ can generate functions that immediately crash

2018-07-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34211] Cygwin build broken due to use of _Type in static declaration in _abc module

2018-07-24 Thread Erik Bray


Change by Erik Bray :


--
keywords: +patch
pull_requests: +7967
stage: needs patch -> patch review

___
Python tracker 

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



[issue34211] Cygwin build broken due to use of _Type in static declaration in _abc module

2018-07-24 Thread Erik Bray


New submission from Erik Bray :

This is essentially the same as issue21124, but introduced more recently with 
the addition of the _abc_data_type in the _abc module.

The workaround is simply to use PyVarObject_HEAD_INIT(NULL, 0) instead of 
PyVarObject_HEAD_INIT(_Type, 0); PyType_Ready should take care of the 
rest.

P.S. I'm trying to get going again on the project of adding an AppVeyor build, 
and eventually a buildbot for Cygwin.  My previous attempt was doomed because I 
wanted to fix all failing tests on Cygwin *first*.  This time I am going for a 
more "instant gratification" approach of just skipping the tests that fail (for 
now) so that I can at least catch new regressions, and then gradually 
re-enabled skipped tests as I can find fixes for them.

However, for that to happen we at least need a minimal build to work.

--
components: Build
keywords: 3.7regression
messages: 322315
nosy: erik.bray
priority: normal
severity: normal
stage: needs patch
status: open
title: Cygwin build broken due to use of _Type in static declaration in  
_abc module
type: compile error
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



[issue34159] asyncio basic event loop stuck with no tasks scheduled or ready

2018-07-24 Thread Sheng Zhong


Sheng Zhong  added the comment:

Sorry I'm having trouble extracting a bug-producing portion of the code  but I 
can describe the different components, what I think the problem was, and how I 
resolved it.

There is one main coroutine (aka handler) responsible for handling the logic of 
communicating with a socket (build packet, respond to incoming packet). At the 
start of this coroutine it launches another coroutine with ensure_future (aka 
server) that sends to and receives UDP packets from a socket and puts the 
responses into an `asyncio.queue` for the corresponding transaction. 

When the handler expects a responding packet, it awaits a get from the queue 
for this transaction. The handler's execution is wrapped in an 
`async_timeout.timeout`.

The server is a while True loop that gets its packets from an 
`asyncio.DatagramProtocol` in which its `datagram_received` method feeds an 
internal server queue. The server awaits packets on its queue and forwards it 
to a transaction queue when it receives any. There were no timeouts in the 
server coroutine.

I expected that waiting for a packet through the Protocol would block the 
server coroutine but not the handler coroutine, but the problem was that the 
handler timeout never had a chance to be processed. This issue was resolved by 
putting a timeout in the server coroutine on waiting for a get on its internal 
queue with `wait_for`.

--
resolution:  -> postponed
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



[issue34167] Standard library docs: prev/next skip right over 16.11

2018-07-24 Thread Segev Finer


Segev Finer  added the comment:

I think the prev/next links link to the previous/next document while 16.11 is 
in the same document as 16.10 at the bottom.

--
nosy: +Segev Finer

___
Python tracker 

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



[issue34197] Make csv.Dialect attributes skipinitialspace, doublequote and strict booleans

2018-07-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Hmm, indeed, I forgot to create a PR. Thank you for catching this Karthikeyan!

--

___
Python tracker 

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



[issue34197] Make csv.Dialect attributes skipinitialspace, doublequote and strict booleans

2018-07-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34196] @staticmethod mangles name of outside class with __ (it is not inside class with staticmethod, but name mangled anyway), so NameError is produced

2018-07-24 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Name mangling is intended to create class local references (that is why the 
class name is prepended) and can be used to add a layer of privacy to calls 
*within* a class.   It is not intended to do what you're trying to do outside 
of class definitions.

--
nosy: +rhettinger
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



[issue34210] Small improvements in heapq (refactoring)

2018-07-24 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Sorry, I don't consider any of these changes to be improvements and some make 
the code worse in some ways, overriding intentional coding decisions.

--
nosy: +rhettinger
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



[issue34197] Make csv.Dialect attributes skipinitialspace, doublequote and strict booleans

2018-07-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> The proposed PR makes them False or True.

Sorry, is there a PR missing here? I hope you are referring to 
https://github.com/serhiy-storchaka/cpython/commit/f96e6969b7f73c3fd6ed2166ba3405f9e63b88f7

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue34204] Bump the default pickle protocol in shelve

2018-07-24 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
nosy: +rhettinger

___
Python tracker 

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



[issue34210] Small improvements in heapq (refactoring)

2018-07-24 Thread Alexander Marshalov


Change by Alexander Marshalov <_...@marshalov.org>:


--
title: Small improvements in heapq (refatoring) -> Small improvements in heapq 
(refactoring)

___
Python tracker 

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



[issue33635] OSError when using pathlib.Path.rglob() to list device files

2018-07-24 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Os.stat is defined in C code, in particular in Modules/posixmodule.c. 

Op 20 jul. 2018 om 10:44 heeft Windson Yang  het 
volgende geschreven:

> 
> Windson Yang  added the comment:
> 
> I tried to fix this issue and I found this should be related to os.stat() in 
> os.py. But I can't find the os.stat() API in the file, any ideas?
> 
> --
> nosy: +Windson Yang
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue34210] Small improvements in heapq (refatoring)

2018-07-24 Thread Alexander Marshalov


Change by Alexander Marshalov <_...@marshalov.org>:


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

___
Python tracker 

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



[issue34210] Small improvements in heapq (refatoring)

2018-07-24 Thread Alexander Marshalov

New submission from Alexander Marshalov <_...@marshalov.org>:

I would like to make three small improvements to the "heapq" module.

1) The "nsmallest" function has the following code (a similar code exists in 
the "nlargest" function):

# When n>=size, it's faster to use sorted()
try:
size = len(iterable)
except (TypeError, AttributeError):
pass
else:
if n >= size:
return sorted(iterable, key=key)[:n]

   I think "[:n]" is redundant, because "iterable" contains no more than n 
elements.
   Therefore, that code can be rewritten as follows:
   
# When n>=size, it's faster to use sorted()
try:
size = len(iterable)
except (TypeError, AttributeError):
pass
else:
if n >= size:
return sorted(iterable, key=key)

2) It seems to me that the line:

for i in reversed(range(n//2)):

   will be more optimal in this version:

for i in range(n//2 + 1, -1, -1):


3) Top-level functions can be surrounded with two blank lines for greater 
compliance with PEP-8.

--
messages: 322307
nosy: amper
priority: normal
severity: normal
status: open
title: Small improvements in heapq (refatoring)
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



[issue34207] test_cmd_line test_utf8_mode test_warnings fail in AMD64 FreeBSD CURRENT buildbots

2018-07-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34208] Change in 3.7 expression evaluation?

2018-07-24 Thread Eryk Sun


Eryk Sun  added the comment:

Please refrain from using the issue tracker to satisfy your curiosity. This is 
a question about compiler optimizations that should be asked on python-list, or 
maybe python-dev. 

You can use the dis module to get a superficial answer in terms of the 
constants in the code object. 

3.6:

>>> dis.dis('(100 * 20) is 2000')
  1   0 LOAD_CONST   3 (2000)
  2 LOAD_CONST   2 (2000)
  4 COMPARE_OP   8 (is)
  6 RETURN_VALUE

3.7:

>>> dis.dis('(100 * 20) is 2000')
  1   0 LOAD_CONST   0 (2000)
  2 LOAD_CONST   0 (2000)
  4 COMPARE_OP   8 (is)
  6 RETURN_VALUE

The argument of the LOAD_CONST opcode is the index of the constant in the code 
object's co_consts tuple. In 3.6 you can see it's separate int objects, but in 
3.7 the operation uses the same int object (index 0).

--
nosy: +eryksun
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



[issue34209] racecondition

2018-07-24 Thread Dhiraj


New submission from Dhiraj :

File: /cpython/blob/master/Modules/posixmodule.c#L2657

#endif
result = access(path->narrow, mode);
Py_END_ALLOW_THREADS
return_value = !result;
#endif

If an attacker could change anything along the path between the call `access()` 
and the files actually used, it may exploit the race condition or a 
time-of-check, time-of-use race condition

https://linux.die.net/man/2/access

--
components: Build
messages: 322305
nosy: Dhiraj_Mishra
priority: normal
severity: normal
status: open
title: racecondition
type: security
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



[issue34208] Change in 3.7 expression evaluation?

2018-07-24 Thread Dave Opstad


New submission from Dave Opstad :

In 3.6 I get this:

>>> x = (100 * 20)
>>> x is 2000
False
>>> (100 * 20) is 2000
False

But in 3.7, I get this:

>>> x = (100 * 20)
>>> x is 2000
False
>>> (100 * 20) is 2000
True

This isn't necessarily a problem, but I'm curious why this behavior changed 
from 3.6 to 3.7.

--
components: Interpreter Core
messages: 322304
nosy: opstad
priority: normal
severity: normal
status: open
title: Change in 3.7 expression evaluation?
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



[issue34207] test_cmd_line test_utf8_mode test_warnings fail in AMD64 FreeBSD CURRENT buildbots

2018-07-24 Thread Pablo Galindo Salgado

New submission from Pablo Galindo Salgado :

test_cmd_line test_utf8_mode test_warnings fail in AMD64 FreeBSD CURRENT 
buildbots:

https://buildbot.python.org/all/#/builders/79/builds/186
https://buildbot.python.org/all/#/builders/60/builds/182

Sample error:

test_xoptions (test.test_cmd_line.CmdLineTest) ... ok
test_ignore_PYTHONHASHSEED (test.test_cmd_line.IgnoreEnvironmentTest) ... ok
test_ignore_PYTHONPATH (test.test_cmd_line.IgnoreEnvironmentTest) ... ok
test test_cmd_line failed
test_sys_flags_not_set (test.test_cmd_line.IgnoreEnvironmentTest) ... ok
==
FAIL: test_non_ascii (test.test_cmd_line.CmdLineTest)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_cmd_line.py",
 line 149, in test_non_ascii
assert_python_ok('-c', command)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/support/script_helper.py",
 line 157, in assert_python_ok
return _assert_python(True, *args, **env_vars)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/support/script_helper.py",
 line 143, in _assert_python
res.fail(cmd_line)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/support/script_helper.py",
 line 84, in fail
err))
AssertionError: Process return code is 1
command line: 
['/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/python', 
'-X', 'faulthandler', '-I', '-c', "assert(ord('��') == 230)"]
stdout:
---
---
stderr:
---
Unable to decode the command from the command line:
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 12-13: 
surrogates not allowed
---
--
Ran 43 tests in 17.680s
FAILED (failures=1, skipped=2)
3 tests failed again:
test_cmd_line test_utf8_mode test_warnings


and

est_showwarning_not_callable (test.test_warnings._WarningsTests) ... ok
test_showwarnmsg_missing (test.test_warnings._WarningsTests) ... ok
test test_warnings failed
test_stderr_none (test.test_warnings._WarningsTests) ... ok
==
FAIL: test_nonascii (test.test_warnings.CEnvironmentVariableTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_warnings/__init__.py",
 line 1151, in test_nonascii
"['ignore:Deprecaci��nWarning']".encode('utf-8'))
AssertionError: b"['ignore:Deprecaci\\udcc3\\udcb3nWarning']" != 
b"['ignore:Deprecaci\xc3\xb3nWarning']"
==
FAIL: test_nonascii (test.test_warnings.PyEnvironmentVariableTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_warnings/__init__.py",
 line 1151, in test_nonascii
"['ignore:Deprecaci��nWarning']".encode('utf-8'))
AssertionError: b"['ignore:Deprecaci\\udcc3\\udcb3nWarning']" != 
b"['ignore:Deprecaci\xc3\xb3nWarning']"
--
Ran 111 tests in 4.635s
FAILED (failures=2)
3 tests failed again:
test_cmd_line test_utf8_mode test_warnings
== Tests result: FAILURE then FAILURE ==

--
components: Tests
messages: 322303
nosy: pablogsal
priority: normal
severity: normal
status: open
title: test_cmd_line test_utf8_mode test_warnings fail in AMD64 FreeBSD CURRENT 
buildbots
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



[issue34206] Move and clarify Py_Main documentation

2018-07-24 Thread Nick Coghlan


Change by Nick Coghlan :


--
keywords: +patch
pull_requests: +7964

___
Python tracker 

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



[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-24 Thread Nick Coghlan


Nick Coghlan  added the comment:

Since we decided the correct resolution here was to restore the Python 3.6 
behaviour, I've filed https://bugs.python.org/issue34206 as a separate docs 
clarification issue (I'll amend my PR accordingly)

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



[issue34206] Move and clarify Py_Main documentation

2018-07-24 Thread Nick Coghlan


Change by Nick Coghlan :


--
dependencies: +Do we support calling Py_Main() after Py_Initialize()?

___
Python tracker 

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



[issue34206] Move and clarify Py_Main documentation

2018-07-24 Thread Nick Coghlan


New submission from Nick Coghlan :

In resolving issue 34008, we determined that we *do* support calling Py_Main 
after Py_Initialize, but it's not clear from that current documentation that 
this implies a Py_Finalize() call, so you don't need to call that again 
yourself (and it's actually an error to do so).

So this issue covers updating the draft PR I wrote at 
https://github.com/python/cpython/pull/8023 to move the Py_Main documentation 
into the initialization and finalization section, and clarify how it relates to 
the other initialization and finalization functions.

--
assignee: ncoghlan
components: Documentation
messages: 322301
nosy: ncoghlan, vstinner
priority: normal
severity: normal
stage: patch review
status: open
title: Move and clarify Py_Main documentation
type: enhancement
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



[issue34173] [3.7] possible race condition in /usr/lib/python3.7/concurrent/futures/thread.py

2018-07-24 Thread Corey Bryant


Corey Bryant  added the comment:

Karthikeyan, thanks for taking a look. I'm also unable to recreate with your 
test. I'm not sure what the difference is. I'll report back if I can figure it 
out.

--

___
Python tracker 

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



[issue34196] @staticmethod mangles name of outside class with __ (it is not inside class with staticmethod, but name mangled anyway), so NameError is produced

2018-07-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I think below doc gives some indication that it always occurs within the 
definition of the class (hence inside a static method) irrespective of the 
syntactic position for any valid identifier and hence for class 
__SuperPrivateClass too. I will let others explain on this better or give more 
information.

https://docs.python.org/3/tutorial/classes.html#private-variables (second 
paragraph)

Since there is a valid use-case for class-private members (namely to avoid name 
clashes of names with names defined by subclasses), there is limited support 
for such a mechanism, called name mangling. Any identifier of the form __spam 
(at least two leading underscores, at most one trailing underscore) is 
textually replaced with _classname__spam, where classname is the current class 
name with leading underscore(s) stripped. This mangling is done without regard 
to the syntactic position of the identifier, as long as it occurs within the 
definition of a class.

SO answer that gave me the link : https://stackoverflow.com/a/1301369/2610955

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue34193] Fix pluralization in TypeError messages in getargs.c

2018-07-24 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Thanks, this needs to be fixed only in `check_num_args` and can help in all the 
other functions like __lt__, __delattr__ etc. in the file that use this.

Before suggestion : 

➜  cpython git:(bpo34193) ✗ ./python -c "a = {}; a.__delattr__()"
Traceback (most recent call last):
  File "", line 1, in 
TypeError: expected 1 arguments, got 0

After suggested change : 

➜  cpython git:(bpo34193) ✗ ./python -c "a = {}; a.__delattr__()"
Traceback (most recent call last):
  File "", line 1, in 
TypeError: expected 1 argument, got 0 


Is there some doc on clarification of the difference between 'required' 
argument and positional argument errors. I was trying to write to tests for the 
changes and I couldn't find functions that hit the exact branch of code. Some 
of them generate required argument error and some of them generate positional 
argument expected error. I looked up in the argument clinic docs 
(https://docs.python.org/3/howto/clinic.html) but it's little hard for me to 
grasp as a beginner. Any pointers will be helpful.


Thanks

--

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-24 Thread STINNER Victor


STINNER Victor  added the comment:

Reminder for myself: I have to write unit tests :-)
https://github.com/python/cpython/pull/8417#pullrequestreview-139835391

--

___
Python tracker 

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



[issue34193] Fix pluralization in TypeError messages in getargs.c

2018-07-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See also "expected %d arguments, got %zd" in Objects/typeobject.c.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue8525] Display exceptions' subclasses in help()

2018-07-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +Tests -Interpreter Core
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6, Python 3.8

___
Python tracker 

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



[issue34193] Fix pluralization in TypeError messages in getargs.c

2018-07-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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

___
Python tracker 

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



[issue34164] base64.b32decode() leads into UnboundLocalError and OverflowError on some data

2018-07-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue34205] Ansible: _PyImport_LoadDynamicModuleWithSpec() crash on an invalid object (UNREF invalid object)

2018-07-24 Thread Julien Palard


Julien Palard  added the comment:

I think it's already compiled in debug mode 
(https://github.com/pyenv/pyenv/blob/c057a80c8296a7c694e4ef80ecbac0d0c169df7a/plugins/python-build/bin/python-build#L2050).

`-X dev` won't help (it's a 3.6.6 not a 3.7).

The debug come from _Py_ForgetReference which prints op, op->_ob_prev->_ob_next 
and op->_ob_next->_ob_prev, crash occurs on the 2nd one, which make sense 
according to:

(gdb) p *(((PyObject*)(op)))
$12 = {_ob_next = 0x71307e90, _ob_prev = 0x712df950, ob_refcnt = 0, 
ob_type = 0x55ad9f80 }
(gdb) p *(((PyObject*)(op->_ob_prev)))
$13 = {_ob_next = 0x70e667bf, _ob_prev = 0x710c58b0, ob_refcnt = 1, 
ob_type = 0x55ae89a0 }
(gdb) p *(((PyObject*)(op->_ob_prev->_ob_next)))
$14 = {_ob_next = 0x71307e90fb, _ob_prev = 0x712df95000, ob_refcnt 
= 0, ob_type = 0x55ad9f8000}

--

___
Python tracker 

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



[issue34164] base64.b32decode() leads into UnboundLocalError and OverflowError on some data

2018-07-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 113f86e7487e9312a2494667b088854ac942ab00 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-34164: Fix handling of incorrect padding in base64.b32decode(). 
(GH-8351) (GH-8436)
https://github.com/python/cpython/commit/113f86e7487e9312a2494667b088854ac942ab00


--

___
Python tracker 

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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 9b33ca0f4d459c165d711778734b6e1bdc3ec35d by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-34136: Make test_do_not_recreate_annotations more reliable. (GH-8364) 
(GH-8366)
https://github.com/python/cpython/commit/9b33ca0f4d459c165d711778734b6e1bdc3ec35d


--

___
Python tracker 

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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 23a3297ff1076d91ca6d70caadf9606f1fee0776 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.7':
[3.7] bpo-34136: Make test_do_not_recreate_annotations more reliable. (GH-8364) 
(GH-8365)
https://github.com/python/cpython/commit/23a3297ff1076d91ca6d70caadf9606f1fee0776


--

___
Python tracker 

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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset c206f0d1375fab7b58c19a6be3e68e316f718c66 by Serhiy Storchaka in 
branch 'master':
bpo-34136: Make test_do_not_recreate_annotations more lenient. (GH-8437)
https://github.com/python/cpython/commit/c206f0d1375fab7b58c19a6be3e68e316f718c66


--

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-24 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d19d8d5279f156bc8f6736b5f16f069879b9519b by Victor Stinner in 
branch 'master':
bpo-34170: Add _PyCoreConfig.isolated (GH-8417)
https://github.com/python/cpython/commit/d19d8d5279f156bc8f6736b5f16f069879b9519b


--

___
Python tracker 

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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +7962

___
Python tracker 

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



[issue34164] base64.b32decode() leads into UnboundLocalError and OverflowError on some data

2018-07-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +7961

___
Python tracker 

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



[issue34164] base64.b32decode() leads into UnboundLocalError and OverflowError on some data

2018-07-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 0b2716918345b2bff0bb5c36086d5de368125536 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.7':
bpo-34164: Fix handling of incorrect padding in base64.b32decode(). (GH-8351) 
(GH-8435)
https://github.com/python/cpython/commit/0b2716918345b2bff0bb5c36086d5de368125536


--

___
Python tracker 

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



[issue8525] Display exceptions' subclasses in help()

2018-07-24 Thread Nick Coghlan


Nick Coghlan  added the comment:

I think the way modules display this information may actually provide a solid 
precedent that addresses the dynamic state problem I'm concerned about: filter 
the subclass list to only include subclasses that come from the same module as 
the object being displayed, and use the existing showtree/getclasstree 
interfaces to display the nested hierarchy nicely (the same way modules do).

Then the "... and NNN other subclasses in other modules" would only be appended 
when there was cross-module inheritance involved.

--

___
Python tracker 

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



[issue8525] Display exceptions' subclasses in help()

2018-07-24 Thread Nick Coghlan


Nick Coghlan  added the comment:

This is a UX problem folks: dynamic unbounded lists are inherently problematic 
in a line based information display.

For methods on a class, there's the natural constraint that broad class APIs 
are a problem for a variety of reasons, but there's no such design constraint 
for exception hierarchies.

In a Fedora Python 3.6 shell (with the Fedora abrt exception handling hook 
loaded), Exception has 31 subclasses, and OSError has 17.

In a 3.6 shell venv (with no Fedora abrt hook), those numbers are 20 and 13. 

But if you import assorted Django modules then the number of Exception 
subclasses grows significantly, while the number of OSError subclasses grows 
slightly:

>>> import django
>>> len(list(pkgutil.iter_modules(django.__path__)))
17
>>> len(Exception.__subclasses__())
76
>>> len(OSError.__subclasses__())
22

Having "help(Exception)" list 50+ different Django exceptions is unlikely to be 
informative for anyone.


In many ways, Python 2 was actually better in this regard, since you could just 
do "import exceptions; help(exceptions)" to get a nice overview of the full 
exception hierarchy using the standard logic for displaying.


The closest Python 3 currently gets to that is "import builtins; 
help(builtins)", which is significantly harder to discover.

--

___
Python tracker 

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



[issue34205] Ansible: _PyImport_LoadDynamicModuleWithSpec() crash on an invalid object (UNREF invalid object)

2018-07-24 Thread STINNER Victor


STINNER Victor  added the comment:

Recently, there was a discussion to find to detect earlier inconsistent objects:
https://mail.python.org/pipermail/python-dev/2018-June/153857.html

In the meanwhile, if you have time, you can try to run Ansible with a Python 
compiled in debug mode (./configure --with-pydebug).

--

___
Python tracker 

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



[issue34205] Ansible: _PyImport_LoadDynamicModuleWithSpec() crash on an invalid object (UNREF invalid object)

2018-07-24 Thread STINNER Victor


Change by STINNER Victor :


--
title: Segmentation fault in _PyObject_Dump -> Ansible: 
_PyImport_LoadDynamicModuleWithSpec() crash on an invalid object (UNREF invalid 
object)

___
Python tracker 

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



[issue34205] Segmentation fault in _PyObject_Dump

2018-07-24 Thread Julien Palard


New submission from Julien Palard :

On a freshly installed python3.6.6 using "pyenv install --debug 3.6.6", on a 
freshly created venv, after running a `pip install ansible`, I'm getting 
exactly those dependencies:

ansible==2.6.1
asn1crypto==0.24.0
bcrypt==3.1.4
cffi==1.11.5
cryptography==2.3
idna==2.7
Jinja2==2.10
MarkupSafe==1.0
paramiko==2.4.1
pyasn1==0.4.3
pycparser==2.18
PyNaCl==1.2.1
PyYAML==3.13
six==1.11.0

If I run:

$ python $(which ansible-playbook)

I'm getting:

* ob
object  : 
type: bytes
refcount: 0
address : 0x7f2600ecc820
* op->_ob_prev->_ob_next
object  : Segmentation fault

An excerpt of the stack trace:

#0  _PyObject_Dump (op=0x70e667bf) at Objects/object.c:450
#1  0x5566a4cf in _Py_ForgetReference (op=0x70e667c0) at 
Objects/object.c:1767
#2  0x5566a579 in _Py_Dealloc (op=0x70e667c0) at 
Objects/object.c:1790
#3  0x557982c2 in _PyImport_LoadDynamicModuleWithSpec 
(spec=0x7130ec20, fp=0x0) at ./Python/importdl.c:227
#4  0x55797439 in _imp_create_dynamic_impl (module=0x77f3e558, 
spec=0x7130ec20, file=0x0) at Python/import.c:1994
#5  0x55791760 in _imp_create_dynamic (module=0x77f3e558, 
args=0x71307e90) at Python/clinic/import.c.h:289
#6  0x556618fc in PyCFunction_Call (func=0x77f43aa8, 
args=0x71307e90, kwds=0x7126bb20) at Objects/methodobject.c:114
#7  0x55768e90 in do_call_core (func=0x77f43aa8, 
callargs=0x71307e90, kwdict=0x7126bb20) at Python/ceval.c:5095
#8  0x55760fab in _PyEval_EvalFrameDefault (f=0x70ecb058, 
throwflag=0) at Python/ceval.c:3397
#9  0x5574e22a in PyEval_EvalFrameEx (f=0x70ecb058, throwflag=0) at 
Python/ceval.c:754


And what I see in gdb:

(gdb) p (PyObject*)(op)
$1 = (PyObject *) 0x70e667bf
(gdb) p *(PyObject*)(op)
$2 = {_ob_next = 0x71307e90fb, _ob_prev = 0x712df95000, ob_refcnt = 0, 
ob_type = 0x55ad9f8000}
(gdb) p (((PyObject*)(op))->ob_type)
$3 = (struct _typeobject *) 0x55ad9f8000
(gdb) p *(((PyObject*)(op))->ob_type)
Cannot access memory at address 0x55ad9f8000

I now have to go eat, but don't hesitate to ask me further investigations.

--
components: Interpreter Core
messages: 322285
nosy: mdk, vstinner
priority: normal
severity: normal
status: open
title: Segmentation fault in _PyObject_Dump
type: crash
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



[issue34164] base64.b32decode() leads into UnboundLocalError and OverflowError on some data

2018-07-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7960

___
Python tracker 

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



[issue34164] base64.b32decode() leads into UnboundLocalError and OverflowError on some data

2018-07-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ac0b3c2f4d86fc056b833a4e6b9a380741244a63 by Serhiy Storchaka in 
branch 'master':
bpo-34164: Fix handling of incorrect padding in base64.b32decode(). (GH-8351)
https://github.com/python/cpython/commit/ac0b3c2f4d86fc056b833a4e6b9a380741244a63


--

___
Python tracker 

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



[issue34177] test_site fails in macOS-PR VSTS builds for 3.7 branch

2018-07-24 Thread INADA Naoki


INADA Naoki  added the comment:

Maybe, vsts machine installs Homebrew's Python.
Homebrew's Python installes /usr/local/lib/python3.7/sitecustomize.py

https://github.com/Homebrew/homebrew-core/blob/0ce9a5a481b3472608fe4e4188cb5d243deebb99/Formula/python.rb#L295-L329

When running tests, it is imported.
It causes test_startup_imports fail.

Maybe, we can use random prefix instead of default /usr/local to avoid this 
conflict.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue34204] Bump the default pickle protocol in shelve

2018-07-24 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The default pickle protocol is 4 now. But shelve still uses the pickle protocol 
3. Shouldn't it be bumped? Shouldn't shelve use pickle.DEFAULT_PROTOCOL by 
default?

Disadvantages:

1. This will make shelve files incompatible with Python 3.3 by default.

2. Protocol 4 adds 9 bytes of overhead in comparison with protocol 3. This can 
be too large for the shelve containing a lot of small objects. Maybe strip 
redundant frame header for small pickles?

--
components: Library (Lib)
messages: 322281
nosy: alexandre.vassalotti, lukasz.langa, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Bump the default pickle protocol in shelve
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



[issue23403] Use pickle protocol 4 by default?

2018-07-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue23403] Use pickle protocol 4 by default?

2018-07-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Opened issue34204 for shelve.

--

___
Python tracker 

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



[issue29209] Remove old-deprecated ElementTree features

2018-07-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 02ec92fa7b1dddc23d479ee0b87dc283793505a8 by Serhiy Storchaka in 
branch 'master':
bpo-29209: Remove old-deprecated features in ElementTree. (GH-6769)
https://github.com/python/cpython/commit/02ec92fa7b1dddc23d479ee0b87dc283793505a8


--

___
Python tracker 

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



[issue34084] possible free statically allocated string in compiler when easter egg on

2018-07-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue33720] test_marshal: crash in Python 3.7b5 on Windows 10

2018-07-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue33720] test_marshal: crash in Python 3.7b5 on Windows 10

2018-07-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset c5734998d91e9953fd179ba6ed7015b6343e8191 by Serhiy Storchaka in 
branch 'master':
bpo-33720: Refactor marshalling/unmarshalling floats. (GH-8071)
https://github.com/python/cpython/commit/c5734998d91e9953fd179ba6ed7015b6343e8191


--

___
Python tracker 

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



[issue20260] Argument Clinic: add unsigned integers converters

2018-07-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +7959

___
Python tracker 

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



[issue34177] test_site fails in macOS-PR VSTS builds for 3.7 branch

2018-07-24 Thread INADA Naoki


Change by INADA Naoki :


--
pull_requests: +7958

___
Python tracker 

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



[issue27671] FAQ: len() is still function for good reason.

2018-07-24 Thread INADA Naoki


Change by INADA Naoki :


--
pull_requests: +7957
stage:  -> patch review

___
Python tracker 

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