[issue34050] Broken links to "OpenSSL cipher list format" in documentation

2018-07-10 Thread Roland Weber


Roland Weber  added the comment:

Thanks!

--

___
Python tracker 

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



[issue29342] os.posix_fadvise misreports errors

2018-07-10 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> os.posix_fallocate() generate exception with errno 0

___
Python tracker 

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



[issue34033] distutils is not reproducible

2018-07-10 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

We should probably discuss the marshal issue in the preëxisting #31377.

I'm not sure if "distutils is not reproducible" is a larger issue than "pyc 
compilation is not reproducible". This issue could be a meta issue for either.

--

___
Python tracker 

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



[issue34087] Segmentation fault on visit_decref

2018-07-10 Thread INADA Naoki


INADA Naoki  added the comment:

If example cannot be small, you can share the project on Github or other place.
If your project is private, you can create OSS version of reproducer.
If you can't create OSS reproducer, we can't debug it.

3rd party library list may helpful, but I'm not sure.

--

___
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-10 Thread Xiang Zhang


Change by Xiang Zhang :


--
nosy: +vstinner

___
Python tracker 

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



[issue34087] Segmentation fault on visit_decref

2018-07-10 Thread Rodrigo Pinheiro Marques de Araújo

Rodrigo Pinheiro Marques de Araújo  added the comment:

Sorry for that. I’m not able to make a little example to reproduce this bug. 
It’s happens during Django tests on a very large code base. A interest thing is 
that not happens with “-X dev” parameters. Please, any suggestions how I can 
get more details about this bug?

--

___
Python tracker 

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



[issue8036] Interpreter crashes on invalid arg to spawnl on Windows

2018-07-10 Thread Eryk Sun


Eryk Sun  added the comment:

> I don't understand why Python behaves differently in debug mode.
> For me, if Python is able to trigger an exception on EINVAL, we 
> should also get a regular Python exception in debug mode (and not 
> a crash)

The debug build's behavior isn't related to the invalid parameter handler, and 
it's not necessarily a crash. The default report mode for CRT_ERROR and 
CRT_ASSERT is CRTDBG_MODE_WNDW. This pops up a dialog asking whether to abort 
the process, ignore the error (fail and set errno), or retry if a debugger is 
attached (i.e. break into the debugger with a first-chance exception).

The mode can be changed to CRTDBG_MODE_DEBUG, which writes a message to the 
debugger, if one is attached to the process:

msvcrt.CrtSetReportMode(msvcrt.CRT_ASSERT, msvcrt.CRTDBG_MODE_DEBUG)

For example, in this case a message is written about the failed assertion in 
exec\spawv.cpp on line 276 (in this case the debugger is cdb, sharing the same 
console as Python, so the failed assertion message is inlined with Python's 
traceback):

>>> os.spawnl(os.P_WAIT, '', 'non-empty')
minkernel\crts\ucrt\src\desktopcrt\exec\spawnv.cpp(276) : Assertion failed: 
file_name[0] != '\0'
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Program Files\Python37\lib\os.py", line 931, in spawnl
return spawnv(mode, file, args)
OSError: [Errno 22] Invalid argument

or set the report mode to CRTDBG_MODE_FILE with the file set to 
CRTDBG_FILE_STDERR:

msvcrt.CrtSetReportMode(msvcrt.CRT_ASSERT, msvcrt.CRTDBG_MODE_FILE)
msvcrt.CrtSetReportFile(msvcrt.CRT_ASSERT, msvcrt.CRTDBG_FILE_STDERR)

--

___
Python tracker 

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



[issue33597] Compact PyGC_Head

2018-07-10 Thread INADA Naoki


Change by INADA Naoki :


--
pull_requests: +7772

___
Python tracker 

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



[issue27351] Unexpected ConfigParser.read() behavior when passed fileobject

2018-07-10 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz
versions: +Python 3.7, Python 3.8 -Python 3.5

___
Python tracker 

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



[issue27351] Unexpected ConfigParser.read() behavior when passed fileobject

2018-07-10 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
pull_requests: +7771
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



[issue34087] Segmentation fault on visit_decref

2018-07-10 Thread INADA Naoki


INADA Naoki  added the comment:

It's difficult to investigate without reproducible example.

Do you use 3rd party extension module?
Typical cause of these crash is bug in 3rd party extensions.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue29342] os.posix_fadvise misreports errors

2018-07-10 Thread Zackery Spytz


Zackery Spytz  added the comment:

This was fixed in #31106.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue33597] Compact PyGC_Head

2018-07-10 Thread STINNER Victor


STINNER Victor  added the comment:

Would you mind to mention your optimization in What's New in Python 3.8? IHMO 
any enhancement of the memory footprint should be documented :-)

--

___
Python tracker 

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



[issue33735] test_multiprocessing_spawn leaked [1, 2, 1] memory blocks on AMD64 Windows8.1 Refleaks 3.7

2018-07-10 Thread STINNER Victor


STINNER Victor  added the comment:

Note for myself: the commit 127bd9bfd591c8ec1a97eb7f4037c8b884eef973, fix for 
bpo-34042 has no impact on this issue since this issue is about memory blocks 
and not references.

--

___
Python tracker 

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



[issue34089] Remove required (non-optional) modules from Modules/Setup.dist

2018-07-10 Thread Neil Schemenauer


Change by Neil Schemenauer :


--
keywords: +patch
pull_requests: +7770

___
Python tracker 

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



[issue34090] Python function call optimization: avoid temporary tuple to pass **kwargs

2018-07-10 Thread STINNER Victor


New submission from STINNER Victor :

On the following code, f() uses CALL_FUNCTION_EX bytecode to call g(). The 
bytecode loads 'kw' variable which is a dictionary. But internally, the 
dictionary is converted to a temporary tuple, and later a new dictionary is 
created. Maybe the temporary tuple could be avoided?

def g(*args, **kw):
...

def f(*args, **kw):
g(*args, **kw)

In Python 3.6, before FASTCALL, CALL_FUNCTION_EX calls:

* do_call_core(): kw dict
* PyObject_Call(): kw dict
* function_call(): kw dict -> create a temporary tuple of keys and names: 
(key[0], value[0], ...)
* _PyEval_EvalCodeWithName(): if CO_VARKEYWORDS, rebuild a new dictionary for 
keyword arguments (**kw)

In Python master branch (future 3.8) with FASTCALL, CALL_FUNCTION_EX calls:

* do_call_core(): kw dict
* _PyFunction_FastCallDict(): kw dict -> a temporary tuple for keyword names 
('kwnames') is created
* _PyEval_EvalCodeWithName(): if CO_VARKEYWORDS, rebuild a new dictionary for 
keyword arguments (**kw)

To be clear: FASTCALL didn't make this specific function call (Python => Python 
with **kw) worse nor better.

--
components: Interpreter Core
messages: 321400
nosy: inada.naoki, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Python function call optimization: avoid temporary tuple to pass **kwargs
type: performance
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



[issue34089] Remove required (non-optional) modules from Modules/Setup.dist

2018-07-10 Thread Neil Schemenauer


New submission from Neil Schemenauer :

This is related to Issue32430.  The behavior of Modules/Setup.dist and 
Modules/Setup is quirky and problematic.  Issue32430 links to some of the 
related issues.  The problem discussed in Issue24575 is also related 
(Py_BUILD_CORE not being defined when it should be because Modules/Setup is not 
updated after a git pull).

I think it is better if, by default, Python does not require Module/Setup to 
contain anything.  The modules currently listed in there are not optional 
anyhow as they are required to run setup.py.  So, I think moving them to 
Makefile.pre.in and Modules/config.c.in directly is better.  That way, they are 
contained in files tracked by the VCS and the build dependencies will work as 
they should.

There are some downsides.  First, it is more verbose in terms of source lines 
of code to add them directly.  I suspect that is the main reason why new 
modules ended up in Setup.dist rather than in Makefile.pre.in (e.g. in contrast 
to gcmodule.c).  However, a few extra lines of code seems better than a 
complicated build system.  Modules/Setup and makesetup is complicated, for 
sure.  For example, the Makefile depends on Setup.  So, if you run "make", the 
Makefile can be re-generated.  That is slightly crazy.  Setup is created on the 
first run of configure but not on following runs (most people don't realize 
that, even I forget).

Another possible downside is that perhaps someone does not want these modules 
to be built-in.  That would be strange as these modules are quite important and 
you cannot run setup.py without them.  After this change, they would have to 
edit source code rather than a config file in order to disable these modules.

A third downside is that this change could break existing 3rd party build 
systems.  E.g. if they create a Setup file that includes some of these always 
built-in modules.  You will end up trying to link the same .o multiple times 
into "python".  I expect that would cause a link error.  However, if these 3rd 
party builds start with Setup.dist and then edit it, things should continue to 
work.

Rather than this approach, I considered introducing Modules/Setup.builtin.  It 
would contain all the modules needed to run setup.py plus whatever else people 
wanted to include statically.  The Modules/Setup.builtin file would not get the 
same weird treatment as Modules/Setup.  I.e. Modules/Setup.builtin would be 
tracked by the VCS and no copy to the build folder would be made.  That would 
take care of some issues we currently have with the build.  However, I don't 
like that approach because it makes it more complicated to understand how 
things are built.  With this patch, you can look at Makefile and 
Modules/config.c to see what is getting built.

--
components: Build
messages: 321399
nosy: nascheme
priority: low
severity: normal
stage: patch review
status: open
title: Remove required (non-optional) modules from Modules/Setup.dist
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



[issue8036] Interpreter crashes on invalid arg to spawnl on Windows

2018-07-10 Thread STINNER Victor


STINNER Victor  added the comment:

> Crashing happens only with the debug build.

I don't understand why Python behaves differently in debug mode. For me, if 
Python is able to trigger an exception on EINVAL, we should also get a regular 
Python exception in debug mode (and not a crash).

--

___
Python tracker 

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



[issue22689] Posix getenv makes no guarantee of lifetime of returned string

2018-07-10 Thread STINNER Victor


STINNER Victor  added the comment:

> char *_rtpypath = Py_GETENV("PYTHONPATH"); /* XXX use wide version on 
> Windows */

Python now copies the env var. In master, Modules/main.c:

int res = config_get_env_var_dup(, L"PYTHONPATH", "PYTHONPATH");

Moreover, bytes are decoded to Unicode (wchar_t) on UNIX.

This issue is now 4 years old and Serhiy just fixed one issue, so I close the 
issue.

Even if there is a risk of an issue, nobody came up with a concrete way to 
trigger a bug, so I don't think that it's a big issue. For example, the 
reported bug was on Py_GETENV("PYTHONPATH"), whereas this code is critical for 
Python: if it fails, everybody will complain. Except that since the bug has 
been reported, nobody ever saw an issue with this code. The code is part of the 
early code to initialize Python, when there is not possible to execute 
arbitrary code nor have a second thread, so we should be fine.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue34086] logging.Handler.handleError regressed in python3

2018-07-10 Thread Oren


Change by Oren :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2018-07-10 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



[issue4260] Document that ctypes.xFUNCTYPE are decorators.

2018-07-10 Thread Andrés Delfino

Change by Andrés Delfino :


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge

___
Python tracker 

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



[issue29672] `catch_warnings` context manager causes all warnings to be printed every time, even after exiting

2018-07-10 Thread Segev Finer


Change by Segev Finer :


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

___
Python tracker 

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



[issue34088] sndhdr.what() throws exceptions on unknown files

2018-07-10 Thread Jussi Judin


New submission from Jussi Judin :

sndhdr.what() function throws several types of exceptions on unknown files 
instead of returning None (as documentation says).

Following code can replicate these crashes:

```
import sndhdr
import sys

sndhdr.what(sys.argv[1])
```

First crash is from wave or chunk module (input data is base64 encoded in the 
echo command):

```
$ echo UklGRjAwMDBXQVZFZm10IDAwMDABADAwMDAwMDAwMDAwMDAw | python3.7 -mbase64 -d 
> in.file
$ python3.7 sndhdr/test.py in.file
Traceback (most recent call last):
  File "sndhdr/test.py", line 4, in 
sndhdr.what(sys.argv[1])
  File "/tmp/python-3.7-bin/lib/python3.7/sndhdr.py", line 54, in what
res = whathdr(filename)
  File "/tmp/python-3.7-bin/lib/python3.7/sndhdr.py", line 63, in whathdr
res = tf(h, f)
  File "/tmp/python-3.7-bin/lib/python3.7/sndhdr.py", line 163, in test_wav
w = wave.open(f, 'r')
  File "/tmp/python-3.7-bin/lib/python3.7/wave.py", line 510, in open
return Wave_read(f)
  File "/tmp/python-3.7-bin/lib/python3.7/wave.py", line 164, in __init__
self.initfp(f)
  File "/tmp/python-3.7-bin/lib/python3.7/wave.py", line 153, in initfp
chunk.skip()
  File "/tmp/python-3.7-bin/lib/python3.7/chunk.py", line 160, in skip
self.file.seek(n, 1)
  File "/tmp/python-3.7-bin/lib/python3.7/chunk.py", line 113, in seek
raise RuntimeError
RuntimeError
```

Second crash comes from sndhdr module itself (again base64 encoded data is 
first decoded on command line):

```
$ echo AAA= | python3.7 -mbase64 -d > in.file
$ python3.7 sndhdr/test.py in.fileTraceback (most recent call last):
  File "sndhdr/test.py", line 4, in 
sndhdr.what(sys.argv[1])
  File "/tmp/python-3.7-bin/lib/python3.7/sndhdr.py", line 54, in what
res = whathdr(filename)
  File "/tmp/python-3.7-bin/lib/python3.7/sndhdr.py", line 63, in whathdr
res = tf(h, f)
  File "/tmp/python-3.7-bin/lib/python3.7/sndhdr.py", line 192, in test_sndr
rate = get_short_le(h[2:4])
  File "/tmp/python-3.7-bin/lib/python3.7/sndhdr.py", line 213, in get_short_le
return (b[1] << 8) | b[0]
IndexError: index out of range
```

--
components: Library (Lib)
messages: 321396
nosy: Barro
priority: normal
severity: normal
status: open
title: sndhdr.what() throws exceptions on unknown files
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



[issue32430] Simplify Modules/Setup{,.dist,.local}

2018-07-10 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I've created a PR that renames Setup.dist to Setup and removes extraneous logic.

--

___
Python tracker 

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



[issue34083] Functional Programming HOWTO: Dictionary ordering isn't "essentially random"

2018-07-10 Thread Stig Johan Berggren


Change by Stig Johan Berggren :


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

___
Python tracker 

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



[issue32430] Simplify Modules/Setup{,.dist,.local}

2018-07-10 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue34087] Segmentation fault on visit_decref

2018-07-10 Thread Rodrigo Pinheiro Marques de Araújo

New submission from Rodrigo Pinheiro Marques de Araújo :

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS 
(code=1, address=0x656d6f6e2236)
frame #0: 0x00010014c819 python3`visit_decref(op=0x656d6f6e222e, 
data=0x) at gcmodule.c:271 [opt]
   268  visit_decref(PyObject *op, void *data)
   269  {
   270  assert(op != NULL);
-> 271  if (PyObject_IS_GC(op)) {
   272  PyGC_Head *gc = AS_GC(op);
   273  /* We're only interested in gc_refs for objects in the
   274   * generation being collected, which can be recognized
Target 0: (python3) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS 
(code=1, address=0x656d6f6e2236)
  * frame #0: 0x00010014c819 python3`visit_decref(op=0x656d6f6e222e, 
data=0x) at gcmodule.c:271 [opt]
frame #1: 0x00010003af38 python3`list_traverse(o=0x000116971608, 
visit=(python3`visit_decref at gcmodule.c:269), arg=0x) at 
listobject.c:2574 [opt]
frame #2: 0x00010014aca3 python3`collect [inlined] subtract_refs at 
gcmodule.c:296 [opt]
frame #3: 0x00010014ac72 python3`collect(generation=2, 
n_collected=0x7ffeefbff0a8, n_uncollectable=0x7ffeefbff0b0, nofail=0) 
at gcmodule.c:853 [opt]
frame #4: 0x00010014a8f5 python3`PyGC_Collect [inlined] 
collect_with_callback(generation=2) at gcmodule.c:1028 [opt]
frame #5: 0x00010014a8cc python3`PyGC_Collect at gcmodule.c:1573 [opt]
frame #6: 0x00010011f7a8 python3`Py_FinalizeEx at pylifecycle.c:1087 
[opt]
frame #7: 0x000100149605 python3`pymain_main(pymain=) at 
main.c:2664 [opt]
frame #8: 0x00010014a280 python3`_Py_UnixMain(argc=5, 
argv=0x7ffeefbff4b8) at main.c:2697 [opt]
frame #9: 0x7fff5869a015 libdyld.dylib`start + 1
frame #10: 0x7fff5869a015 libdyld.dylib`start + 1

--
components: Interpreter Core
messages: 321394
nosy: fenrrir
priority: normal
severity: normal
status: open
title: Segmentation fault on visit_decref
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



[issue32430] Simplify Modules/Setup{,.dist,.local}

2018-07-10 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
pull_requests: +7767

___
Python tracker 

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



[issue29672] `catch_warnings` context manager causes all warnings to be printed every time, even after exiting

2018-07-10 Thread Erik Bray


Erik Bray  added the comment:

Yes, I think `catch_warnings` should back up and restore the relevant 
`__warningregistry__`.  At which point it's not even clear to me what value 
there is in the _filter_version...

--

___
Python tracker 

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



[issue34086] logging.Handler.handleError regressed in python3

2018-07-10 Thread Oren


Oren  added the comment:

I realize that there is a legitimate argument that handleError() is being used 
wrong in the example, but since it used to work, it'd be nice if it still did. 
I came across this after converting a codebase to python3 and it took a while 
for this problem to appear.
 

I propose the following fix:

$ git diff
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 29a7d46..f2c3023 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -908,7 +908,7 @@ class Handler(Filterer):
 sys.stderr.write('Call stack:\n')
 # Walk the stack frame up until we're out of logging,
 # so as to print the calling context.
-frame = tb.tb_frame
+frame = tb and tb.tb_frame
 while (frame and os.path.dirname(frame.f_code.co_filename) ==
__path__[0]):
 frame = frame.f_back

This results in:
$ python3 logbug.py
--- Logging error ---
NoneType: None
Call stack:
Logged from file logbug.py, line 15
Message: 'this will work in python 2.7, but not 3'
Arguments: ()

--

___
Python tracker 

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



[issue34086] logging.Handler.handleError regressed in python3

2018-07-10 Thread Oren


New submission from Oren :

In python2, calling Handler.handleError may not be strictly correct, but it 
doesn't raise an exception. However, this has regressed since this patch:
https://hg.python.org/cpython/rev/d7b868cdd9bb

$ cat logbug.py
import logging

class CustomHandler(logging.Handler):
def transmit(self, record):
return False
def emit(self, record):
if not self.transmit(record):
self.handleError(record)
def main():
logger = logging.getLogger()
logger.addHandler(CustomHandler())
logger.warning('this will work in python 2.7, but not 3')

if __name__ == '__main__':
main()

$ python2 logbug.py
None
Logged from file logbug.py, line 15

$ python3 logbug.py
--- Logging error ---
NoneType: None
Call stack:
Traceback (most recent call last):
  File "logbug.py", line 20, in 
main()
  File "logbug.py", line 15, in main
logger.warning('this will work in python 2.7, but not 3')
  File 
"/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/__init__.py",
 line 1318, in warning
self._log(WARNING, msg, args, **kwargs)
  File 
"/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/__init__.py",
 line 1442, in _log
self.handle(record)
  File 
"/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/__init__.py",
 line 1452, in handle
self.callHandlers(record)
  File 
"/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/__init__.py",
 line 1514, in callHandlers
hdlr.handle(record)
  File 
"/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/__init__.py",
 line 863, in handle
self.emit(record)
  File "logbug.py", line 9, in emit
self.handleError(record)
  File 
"/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/__init__.py",
 line 920, in handleError
frame = tb.tb_frame
AttributeError: 'NoneType' object has no attribute 'tb_frame'

--
components: Library (Lib)
messages: 321391
nosy: orenl
priority: normal
severity: normal
status: open
title: logging.Handler.handleError regressed in python3
versions: Python 3.4, Python 3.5, Python 3.6, 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



[issue34085] doc Improve wording on classmethod/staticmethod

2018-07-10 Thread Andrés Delfino

Change by Andrés Delfino :


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

___
Python tracker 

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



[issue34085] doc Improve wording on classmethod/staticmethod

2018-07-10 Thread Andrés Delfino

New submission from Andrés Delfino :

1. The classmethod definition reads:

"""
The @classmethod form is a function decorator – see the description of function 
definitions in Function definitions for details.

It can be called either on the class (such as C.f()) or on an instance (such as 
C().f())
"""

The second paragraph seems like talking about the classmethod function instead 
of a class method. The same goes for staticmethod.

2. The staticmethod definition reads:

"""
It can be called either on the class (such as C.f()) or on an instance (such as 
C().f()). The instance is ignored except for its class.
"""

"The instance is ignored except for its class." seems to have been copied from 
classmethod definition.

3. There is redundant text:

"see the description of function definitions in Function definitions"

"consult the documentation on the standard type hierarchy in The standard type 
hierarchy"

PR fixes this.

--
assignee: docs@python
components: Documentation
messages: 321390
nosy: adelfino, docs@python
priority: normal
severity: normal
status: open
title: doc Improve wording on classmethod/staticmethod
type: enhancement
versions: Python 2.7, Python 3.6, 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



[issue34083] Functional Programming HOWTO: Dictionary ordering isn't "essentially random"

2018-07-10 Thread Stig Johan Berggren


Stig Johan Berggren  added the comment:

I'll try to patch it myself.

--

___
Python tracker 

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



[issue28571] llist and scipy.stats conflicts, python segfault

2018-07-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> third party
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



[issue34082] EnumMeta.__new__ should use enum_class.__new__

2018-07-10 Thread Ethan Furman


Change by Ethan Furman :


--
assignee:  -> ethan.furman
nosy: +barry, eli.bendersky, ethan.furman

___
Python tracker 

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



[issue34009] Document Debian 8 / Ubuntu 14.04 OpenSSL compatibility issues

2018-07-10 Thread Nick Coghlan


Nick Coghlan  added the comment:

Merged to master and 3.7 - any further wording tweaks can be handled as a 
trivial docs-only PR, without needing additional tracker issues.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: Document Travis CI / Ubuntu 14.04 OpenSSL compatibility issues -> 
Document Debian 8 / Ubuntu 14.04 OpenSSL compatibility issues

___
Python tracker 

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



[issue34009] Document Travis CI / Ubuntu 14.04 OpenSSL compatibility issues

2018-07-10 Thread miss-islington


miss-islington  added the comment:


New changeset 5cca6f9fbead1fae27c37204f345a9465cc88959 by Miss Islington (bot) 
in branch '3.7':
bpo-34009: Expand on platform support changes (GH-8022)
https://github.com/python/cpython/commit/5cca6f9fbead1fae27c37204f345a9465cc88959


--
nosy: +miss-islington

___
Python tracker 

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



[issue34083] Functional Programming HOWTO: Dictionary ordering isn't "essentially random"

2018-07-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for noticing this.  Do you want to contribute a patch or would you like 
me to just fix it up?

--
assignee: docs@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue34009] Document Travis CI / Ubuntu 14.04 OpenSSL compatibility issues

2018-07-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7765
stage: commit review -> patch review

___
Python tracker 

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



[issue34009] Document Travis CI / Ubuntu 14.04 OpenSSL compatibility issues

2018-07-10 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset 5fe7c98a54d127759cfce323fab831008c945964 by Nick Coghlan in 
branch 'master':
bpo-34009: Expand on platform support changes (GH-8022)
https://github.com/python/cpython/commit/5fe7c98a54d127759cfce323fab831008c945964


--

___
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-10 Thread Nick Coghlan


Nick Coghlan  added the comment:

Thinking about this some more, I'm inclined to go the same way we did with 
issue 33932: classify it as an outright regression, work out the desired 
requirements for a missing embedding test case, and then fix the implementation 
to pass the new test case.

My suggestion for test commands would be:

../Lib/site.py
-m site
-c 'import sys; print(sys.argv)' some test data here

Once those work properly, we'd consider the regression relative to Python 3.6 
fixed.

Those could either be 3 different test cases, or else we could run them all 
within a single test case, with a Py_Initialize() call before each one (since 
Py_Main() calls Py_Finalize() internally).

--

___
Python tracker 

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



[issue34033] distutils is not reproducible

2018-07-10 Thread INADA Naoki


Change by INADA Naoki :


--
pull_requests: +7764

___
Python tracker 

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



[issue34033] distutils is not reproducible

2018-07-10 Thread INADA Naoki


INADA Naoki  added the comment:

Is this issue for only known marshal issue?
Or is this issue for all issues in distutils including unknowns?

--
nosy: +inada.naoki

___
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-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +barry

___
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-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I expected it should be easy to reproduce a crash, but I failed to find an 
example.

--

___
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-10 Thread Xiang Zhang


Change by Xiang Zhang :


--
title: possible free statically allocated string -> possible free statically 
allocated string in compiler when easter egg on

___
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

2018-07-10 Thread Xiang Zhang


New submission from Xiang Zhang :

While reviewing PR8222, I found `err_ret->text` is assigned a not malloced 
string, but it will finally get freed in `err_input`.

--
keywords: easy
messages: 321381
nosy: serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: possible free statically allocated string
versions: Python 3.6, 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



[issue29672] `catch_warnings` context manager causes all warnings to be printed every time, even after exiting

2018-07-10 Thread Segev Finer


Segev Finer  added the comment:

Hmm, I originally missed the per module __warningregistry__... Need to read the 
code more closely...

What should the behavior be? We can add a flag that will make all warning 
actions be "always" when catch_warnings is in effect. But that doesn't feel 
right with the way catch_warnings currently behaves or what is expected of it.

Another idea would be to add a callback that is called whenever we set a module 
registry, allowing catch_warnings to backup the original registry of each 
module and restore them all on exit (Also the _onceregistry and 
_filters_version).

--

___
Python tracker 

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



[issue34076] Nested loop in dictionary comprehension gives `global name not defined` inside class

2018-07-10 Thread Jan Christoph


Jan Christoph  added the comment:

Updated example with reversed variable order for reference. This really seems 
to be related to issue3692, but really not the same thing.

IMHO both `a` and `b` should be passed in a situation like this:


a = range(5)
b = range(3)
c = [x+y for x in a for y in b]


--
Added file: https://bugs.python.org/file47681/what_a_dict.py

___
Python tracker 

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



[issue34076] Nested loop in dictionary comprehension gives `global name not defined` inside class

2018-07-10 Thread Jan Christoph


Jan Christoph  added the comment:

Okay, so we're a in another scope inside the dictionary comprehension (all 
comprehensions for that matter), and only one symbol is passed to the inside.

That's why `strange_reversed_working = {x+s.replace('(+/-)',''):None for x in 
infts.split(', ') for s in ('+','-','')}` functions, but if you reverse the 
order it does not. That's a real trap.

--

___
Python tracker 

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



[issue34031] [EASY] Incorrect usage of unittest.TestCase in test_urllib2_localnet

2018-07-10 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the PR, stoksc!

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



[issue34031] [EASY] Incorrect usage of unittest.TestCase in test_urllib2_localnet

2018-07-10 Thread Tal Einat


Tal Einat  added the comment:


New changeset 6f036bb67d5a20c86c29ea5aeace563e3751baab by Tal Einat in branch 
'2.7':
[2.7] bpo-34031: fix incorrect usage of self.fail in two tests (GH-8091) (#8225)
https://github.com/python/cpython/commit/6f036bb67d5a20c86c29ea5aeace563e3751baab


--

___
Python tracker 

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



[issue34083] Functional Programming HOWTO: Dictionary ordering isn't "essentially random"

2018-07-10 Thread Stig Johan Berggren

New submission from Stig Johan Berggren :

The section about iterators in the Functional Programming HOWTO 
(https://docs.python.org/3/howto/functional.html#data-types-that-support-iterators)
 states the following about looping over dictionary keys:

"Note that the order is essentially random, because it’s based on the hash 
ordering of the objects in the dictionary."

Starting with 3.7, dictionary order is guaranteed to be the same as insertion 
order.

--
assignee: docs@python
components: Documentation
messages: 321375
nosy: Stig Johan Berggren, docs@python
priority: normal
severity: normal
status: open
title: Functional Programming HOWTO: Dictionary ordering isn't "essentially 
random"
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



[issue28657] cmd.Cmd.get_help() implementation can't see do_*() methods added dynamically by setattr()

2018-07-10 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Raymond, would updating the attached PR to change 
https://github.com/remilapeyre/cpython/blob/7c78350f8903f162e5f70ee147c0e97cb1ed5181/Lib/cmd.py#L270
 (and others) from `compfunc = getattr(self, 'complete_' + cmd)` to `compfunc = 
getattr(self.__class__, 'complete_' + cmd)` to have a consistent behavior for 
the help and the complection ?

Maybe the methods could all rely on `get_names` that return 
`dir(self.__class__)`, that way, the behavior would be more consistent and 
Błażej could override this method only to get its desired result.

--

___
Python tracker 

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



[issue34031] [EASY] Incorrect usage of unittest.TestCase in test_urllib2_localnet

2018-07-10 Thread miss-islington


miss-islington  added the comment:


New changeset cb14eb7eedf36cd21aaf41c4d3eb1e6521fa7b11 by Miss Islington (bot) 
in branch '3.6':
bpo-34031: fix incorrect usage of self.fail in two tests (GH-8091)
https://github.com/python/cpython/commit/cb14eb7eedf36cd21aaf41c4d3eb1e6521fa7b11


--

___
Python tracker 

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



[issue34031] [EASY] Incorrect usage of unittest.TestCase in test_urllib2_localnet

2018-07-10 Thread miss-islington


miss-islington  added the comment:


New changeset 125371d2c617d886e1a15b8f940ce29124cdc79c by Miss Islington (bot) 
in branch '3.7':
bpo-34031: fix incorrect usage of self.fail in two tests (GH-8091)
https://github.com/python/cpython/commit/125371d2c617d886e1a15b8f940ce29124cdc79c


--
nosy: +miss-islington

___
Python tracker 

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



[issue34031] [EASY] Incorrect usage of unittest.TestCase in test_urllib2_localnet

2018-07-10 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +7763

___
Python tracker 

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



[issue34031] [EASY] Incorrect usage of unittest.TestCase in test_urllib2_localnet

2018-07-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7762

___
Python tracker 

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



[issue34031] [EASY] Incorrect usage of unittest.TestCase in test_urllib2_localnet

2018-07-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7761

___
Python tracker 

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



[issue34031] [EASY] Incorrect usage of unittest.TestCase in test_urllib2_localnet

2018-07-10 Thread Tal Einat


Tal Einat  added the comment:


New changeset 6b490b5db40fc29588e8e6cc23bb89c4fed74ad5 by Tal Einat (Bradley 
Laney) in branch 'master':
bpo-34031: fix incorrect usage of self.fail in two tests (GH-8091)
https://github.com/python/cpython/commit/6b490b5db40fc29588e8e6cc23bb89c4fed74ad5


--
nosy: +taleinat

___
Python tracker 

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



[issue34082] EnumMeta.__new__ should use enum_class.__new__

2018-07-10 Thread Pav


New submission from Pav :

```python
class Foo:
pass

class Works(str, Foo, Enum):
BAR = 'baz'

class Fails(Foo, str, Enum):
BAR = 'baz'

```

`Fails` fails to be created with an error:

`TypeError: object.__new__(Fails) is not safe, use Fails.__new__()`

See 
https://github.com/python/cpython/blob/e57f91a0f0d5700ec466c9dd0fd2d2b5323a5e76/Lib/enum.py#L205

--
components: Library (Lib)
messages: 321370
nosy: rs2
priority: normal
severity: normal
status: open
title: EnumMeta.__new__ should use enum_class.__new__
type: behavior
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue34081] Sphinx duplicate label warning in docs

2018-07-10 Thread Karthikeyan Singaravelan

New submission from Karthikeyan Singaravelan :

While running make docs sphinx generates a warning that there are duplicate 
labels named `_examples`. It seems it's present in `c-api/typeobj.rst` and 
`distutils/examples.rst` as below : 

➜  Doc git:(master) rg '.. _examples:'
c-api/typeobj.rst
2324:.. _examples:

distutils/examples.rst
1:.. _examples:

# Warning

2018-07-10T07:30:36.8709047Z /opt/vsts/work/1/s/Doc/distutils/examples.rst:5: 
WARNING: duplicate label examples, other instance in 
/opt/vsts/work/1/s/Doc/c-api/typeobj.rst

Sample log : 
https://python.visualstudio.com/cpython/cpython%20Team/_build/results?buildId=16141=logs

There are no references to the label as far as I have checked and I suppose 
this is an easy fix to be done if someone wants to take it up. The effect is 
that in the page https://docs.python.org/3.8/c-api/typeobj.html the following 
text links to distutils/examples for the text "Examples" which should ideally 
link to https://docs.python.org/3.8/c-api/typeobj.html#examples

"In addition to the following quick reference, the Examples section provides 
at-a-glance insight into the meaning and use of PyTypeObject."

It will be also helpful if sphinx warnings are made as an error in CI so that 
these are caught there.

Thanks

--
assignee: docs@python
components: Documentation
messages: 321368
nosy: docs@python, xtreak
priority: normal
severity: normal
status: open
title: Sphinx duplicate label warning in docs
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



[issue34076] Nested loop in dictionary comprehension gives `global name not defined` inside class

2018-07-10 Thread Jan Christoph


Jan Christoph  added the comment:

But the simpler dictionary compprehension `{s.replace('(+/-)',''):None for s in 
infts.split(', ')}` works perfectly. Shouldn't that also give the error if it 
was a scope issue?

--

___
Python tracker 

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



[issue34080] Memory leak in the compiler in case of errors

2018-07-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +vstinner

___
Python tracker 

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



[issue34080] Memory leak in the compiler in case of errors

2018-07-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34080] Memory leak in the compiler in case of errors

2018-07-10 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Merging PR 6517 for issue33305 exposed a leak in the compiler:

https://buildbot.python.org/all/#/builders/1/builds/280

$ ./python -m test -R 3:3 test_compile test_grammar
Run tests sequentially
0:00:00 load avg: 1.95 [1/2] test_compile
beginning 6 repetitions
123456
..
test_compile leaked [15, 16, 15] memory blocks, sum=46
0:00:14 load avg: 1.97 [2/2/1] test_grammar -- test_compile failed
beginning 6 repetitions
123456
..
test_grammar leaked [50, 50, 50] memory blocks, sum=150
test_grammar failed

== Tests result: FAILURE ==

2 tests failed:
test_compile test_grammar

Total duration: 15 sec 226 ms
Tests result: FAILURE


This branch was not common, but after issue33305 it has became more common and 
heavily tested.

--
assignee: serhiy.storchaka
components: Interpreter Core
messages: 321367
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Memory leak in the compiler in case of errors
type: resource usage
versions: Python 2.7, Python 3.6, 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



[issue33597] Compact PyGC_Head

2018-07-10 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



[issue33597] Compact PyGC_Head

2018-07-10 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset 5ac9e6eee5ed18172d70d28cf438df0be4e3b83d by INADA Naoki in branch 
'master':
bpo-33597: Reduce PyGC_Head size (GH-7043)
https://github.com/python/cpython/commit/5ac9e6eee5ed18172d70d28cf438df0be4e3b83d


--

___
Python tracker 

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



[issue33967] functools.singledispatch: Misleading exception when calling without arguments

2018-07-10 Thread miss-islington


miss-islington  added the comment:


New changeset 6ceab46a602c6653356d67d7479391fba0b35697 by Miss Islington (bot) 
in branch '3.6':
bpo-33967: Fix singledispatch raised IndexError when no args (GH-8184)
https://github.com/python/cpython/commit/6ceab46a602c6653356d67d7479391fba0b35697


--

___
Python tracker 

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



[issue34079] Multiprocessing module fails to build on Solaris 11.3

2018-07-10 Thread Clint Allen


Change by Clint Allen :


--
keywords: +patch
Added file: 
https://bugs.python.org/file47680/Python-2.7.15-Modules_multiprocessing_h.patch

___
Python tracker 

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



[issue34079] Multiprocessing module fails to build on Solaris 11.3

2018-07-10 Thread Clint Allen


New submission from Clint Allen :

The build of this module fails with this error:


In file included from /usr/include/limits.h:12:0,
 from 
/usr/gcc/5/lib/gcc/sparcv9-sun-solaris2.11/5.4.0/include-fixed/limits.h:168,
 from 
/usr/gcc/5/lib/gcc/sparcv9-sun-solaris2.11/5.4.0/include-fixed/syslimits.h:7,
 from 
/usr/gcc/5/lib/gcc/sparcv9-sun-solaris2.11/5.4.0/include-fixed/limits.h:34,
 from Include/Python.h:19,
 from 
/opt/apps/salt-build/Python-2.7.15/Modules/_multiprocessing/multiprocessing.h:12,
 from 
/opt/apps/salt-build/Python-2.7.15/Modules/_multiprocessing/multiprocessing.c:9:
/usr/gcc/5/lib/gcc/sparcv9-sun-solaris2.11/5.4.0/include-fixed/sys/feature_tests.h:363:2:
 error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications 
   and pre-2001 POSIX applications"


Changing the value of _XOPEN_SOURCE from 500 to 600 in 
Modules/_multiprocessing/multiprocessing.h fixes it.

--
components: Extension Modules
messages: 321364
nosy: clallen
priority: normal
severity: normal
status: open
title: Multiprocessing module fails to build on Solaris 11.3
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



[issue33967] functools.singledispatch: Misleading exception when calling without arguments

2018-07-10 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



[issue33967] functools.singledispatch: Misleading exception when calling without arguments

2018-07-10 Thread miss-islington


miss-islington  added the comment:


New changeset df9f633f94e97fc43e0235cb2be076491ea7f67f by Miss Islington (bot) 
in branch '3.7':
bpo-33967: Fix singledispatch raised IndexError when no args (GH-8184)
https://github.com/python/cpython/commit/df9f633f94e97fc43e0235cb2be076491ea7f67f


--
nosy: +miss-islington

___
Python tracker 

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



[issue34076] Nested loop in dictionary comprehension gives `global name not defined` inside class

2018-07-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This looks like a duplicate of issue3692.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> improper scope in list comprehension, when used in class 
declaration

___
Python tracker 

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



[issue3692] improper scope in list comprehension, when used in class declaration

2018-07-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Indeed, this issue is more complex than it looked to me.

Technically, LOAD_FAST, which is used for reading the loop
control variables in comprehensions, uses the array f->f_localsplus, while 
LOAD_NAME uses f->f_locals and f->f_globals. When executing class bodies, 
f->f_localsplus is NULL, and if executing functions f->f_locals usually is a 
NULL or a cached copy of a dict created from f->f_localsplus. But we can create 
a hybrid frame for comprehensions in class body, which will contain independent 
f->f_localsplus and f->f_locals. References to the loop
control variables and to the class variables will work as expected, just the 
meaning of locals() will be changed.

--

___
Python tracker 

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



[issue33955] Implement PyOS_CheckStack on macOS using pthread_get_stack*_np

2018-07-10 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Sorry about the slow response.

The patch looks OK, although I'm entirely happy yet about the workaround for 
the stack size on the main thread. Primarily because framework builds use a 
non-standard stack size as the default one is too small for the recursion limit 
(IIRC especially with debug builds). 

BTW. My own use case for this feature is primarily the use of python on threads 
created by the system (such as threads created by Cocoa APIs and libdispatch), 
for threads created in Python we can (and do) create them with a large enough 
stack (although this guard is helpful there too).

My next step will be to test the patch locally. This might take a while because 
I will be traveling the rest of this month. Worst case is that I'll report back 
during EuroPython 2018 (starting at 23th of July)

--

___
Python tracker 

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



[issue33967] functools.singledispatch: Misleading exception when calling without arguments

2018-07-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7759

___
Python tracker 

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



[issue33967] functools.singledispatch: Misleading exception when calling without arguments

2018-07-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7758

___
Python tracker 

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



[issue33967] functools.singledispatch: Misleading exception when calling without arguments

2018-07-10 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset 445f1b35ce8461268438c8a6b327ddc764287e05 by INADA Naoki (Dong-hee 
Na) in branch 'master':
bpo-33967: Fix singledispatch raised IndexError when no args (GH-8184)
https://github.com/python/cpython/commit/445f1b35ce8461268438c8a6b327ddc764287e05


--

___
Python tracker 

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



[issue8036] Interpreter crashes on invalid arg to spawnl on Windows

2018-07-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Crashing happens only with the debug build. With the release mode I got 
OSError(EINVAL). I think it is better to raise the same error in all builds. 
ValueError is not new, it is already raised for paths containing NUL and too 
long paths.

--

___
Python tracker 

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



[issue8036] Interpreter crashes on invalid arg to spawnl on Windows

2018-07-10 Thread Eryk Sun


Eryk Sun  added the comment:

Serhiy, an empty file path shouldn't crash the interpreter. The per-thread 
invalid parameter handler is suppressed before calling _wspawnv, so it should 
raise OSError (EINVAL) if the file path is empty. That's what I observe in 3.7. 
Are you suggesting to raise ValueError in this case instead of calling _wspawnv?

--
nosy: +eryksun

___
Python tracker 

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