[issue26830] Refactor Tools/scripts/google.py

2016-09-14 Thread Francisco Couzo

Changes by Francisco Couzo :


Added file: http://bugs.python.org/file44652/scripts_google_v4.patch

___
Python tracker 

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



[issue28114] Crash in unicodeobject.c find_maxchar_surrogates on python-3.6.0b1 for Windows

2016-09-14 Thread Berker Peksag

Berker Peksag added the comment:

Here's a patch for Unix. I will add Windows support when I get my Windows VM.

> [...] (and add a test - test_crashers, presumably?) [...]

Unfortunately, test_crashers doesn't run since 2011 (skipped in 481ad9129a0f.) 
parse_envlist() is only used by os.execve() and os.spawnve() so I'm not sure 
what's the best way to test the patch (other than adapting Eryk's snippet in 
msg276241.)

--
keywords: +patch
nosy: +berker.peksag
stage:  -> patch review
Added file: http://bugs.python.org/file44651/issue28114_unix.diff

___
Python tracker 

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



[issue28142] windows installer not adding PYTHONHOME

2016-09-14 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +steve.dower, zach.ware

___
Python tracker 

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



[issue27778] PEP 524: Add os.getrandom()

2016-09-14 Thread Christian Heimes

Christian Heimes added the comment:

Oh sorry, I looked in the wrong location and missed it.

* if (PyErr_CheckSignals() < 0) {return NULL;} does not free buffer with 
PyMem_Free(buffer);

* The function allocates memory once with PyMem_Malloc() and later a second 
time with PyBytes_FromStringAndSize(buffer, n). You can avoid the first 
allocation and a memcpy() with PyBytes_FromStringAndSize(NULL, n) and 
PyBytes_AS_STRING().

* The syscall can also raise EPERM as reported by a user on QNAP. IIRC a 
seccomp policy caused EPERM.

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



[issue28119] Explicit null dereferenced in formatter_unicode.c

2016-09-14 Thread Christian Heimes

Christian Heimes added the comment:

Thanks! You fixed the problem and Coverity is no longer complaining. The code 
is more readable, too.

Are you talking about these lines? Yes, they were confusing me.

if (locale_info->thousands_sep == NULL) {
Py_DECREF(locale_info->decimal_point);
}

--
resolution:  -> fixed
stage: test needed -> 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



[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Crash in unicodeobject.c find_maxchar_surrogates on python-3.6.0b1 for 
Windows -> parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 
3.6.0 when env contains byte strings

___
Python tracker 

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



[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

The issue is not specific to Windows, the following example also crash on Linux:

import os, sys
args = [sys.executable, "-c", "pass"]
os.execve(args[0], args, os.environb)

--

___
Python tracker 

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



[issue26830] Refactor Tools/scripts/google.py

2016-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f8c11b61cfb7 by Berker Peksag in branch 'default':
Issue #26830: Refactor Tools/scripts/google.py
https://hg.python.org/cpython/rev/f8c11b61cfb7

--
nosy: +python-dev

___
Python tracker 

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



[issue26830] Refactor Tools/scripts/google.py

2016-09-14 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread Stefan Krah

Stefan Krah added the comment:

For memoryview this is not possible: It is explicitly unaligned and the feature 
is used in e.g. NumPy.

--

___
Python tracker 

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



[issue28134] socket.socket(fileno=fd) does not work as documented

2016-09-14 Thread Christian Heimes

Christian Heimes added the comment:

Martin, the documentation says "If fileno is specified, the other arguments are 
ignored, causing the socket with the specified file descriptor to return." It's 
a direct quote from Python 3's socket library documentation. For a non-native 
speaker like me, this sentence implies that socket.socket(fileno) not only 
ignores the arguments (which it does not) but that the constructor uses the 
fileno to set family, type and proto.

The socket module uses self->sock_family in several places to calculate the 
addr len or when it handles arguments and address information. Just look at 
this simple example:

>>> import socket
>>> uds = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
>>> s = socket.socket(fileno=uds.fileno())
>>> s.bind('/tmp/sock')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: getsockaddrarg: AF_INET address must be tuple, not str
>>> uds.bind('/tmp/sock')

--

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread Christian Heimes

Christian Heimes added the comment:

It's totally possible. Benjamin's patch implements it like I have suggested it.

--

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread Stefan Krah

Stefan Krah added the comment:

Ah, yes. But compilers optimize memcpy and this is a guaranteed slowdown for 
the unaligned memoryview case.

--

___
Python tracker 

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



[issue27374] Cygwin: Makefile does not install DLL import library

2016-09-14 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

Hello, Eric.
I tried to build the '_speedups' C extension module of simplejson (third party 
library) using the python built on cygwin. As you pointed out, the build of 
'_speedups' C extension module at the stage of the link failed.

build log:
Python3.5.2+ has be used. It has applyed patches to known issues.

$ ./configure --prefix=/opt/py35 --with-threads --with-dbmliborder=gdbm 
--with-system-ffi --with-system-expat
$ make && make altinstall
$ LANG=C /opt/py35/bin/pip3.5 install simplejson
(snip)
running build_ext
building 'simplejson._speedups' extension
creating build/temp.cygwin-2.6.0-i686-3.5
creating build/temp.cygwin-2.6.0-i686-3.5/simplejson
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -I/opt/py35/include/python3.5m -c simplejson/_speedups.c -o 
build/temp.cygwin-2.6.0-i686-3.5/simplejson/_speedups.o
gcc -shared -Wl,--enable-auto-image-base 
build/temp.cygwin-2.6.0-i686-3.5/simplejson/_speedups.o 
-L/opt/py35/lib/python3.5/config -L/opt/py35/lib -lpython3.5m -o 
build/lib.cygwin-2.6.0-i686-3.5/simplejson/_speedups.cpython-35m.dll
/usr/lib/gcc/i686-pc-cygwin/5.4.0/../../../../i686-pc-cygwin/bin/ld: cannot 
find -lpython3.5m
collect2: error: ld returned 1 exit status
***
WARNING: The C extension could not be compiled, speedups are not enabled.
Failure information, if any, is above.
I'm retrying the build without the C extension now.
***
(snip)

In the log, -L option specified to "/opt/py35/lib/python3.5/config". But, the 
current python has "/opt/py35/lib/python3.5/config-3.5m" instead of 
"/opt/py35/lib/python3.5/config". And libpython3.5m.dll.a library exists in the 
config-3.5m. I think that to succeed building a C extension module if -L 
options is changed to "/opt/py35/lib/python3.5/config-3.5m". 
I'm going to try to find the place that add -L option at build time.

--
components: +Extension Modules
nosy: +masamoto
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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread Christian Heimes

Christian Heimes added the comment:

How often does NumPy create a C-style, single dimensional, continuous 
memoryview? I would assume that it deals with matrices, Fortran data and/or 
other strides, multi-dimensional data in almost all cases.

--

___
Python tracker 

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



[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread Eryk Sun

Eryk Sun added the comment:

Berker, this is basically what I had in my initial patch on the Unix side. I 
also addressed the Windows issues in parse_envlist and fsconvert_strdup. I'm 
uploading that patch for reference. It needs a test. I also need to verify that 
there are no additional problems with the high-level os._execvpe function 
regarding bytes support on Windows.

--
Added file: http://bugs.python.org/file44653/issue_28114_01.patch

___
Python tracker 

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



[issue28143] ASDL compatibility with Python 3 system interpreter

2016-09-14 Thread Malthe Borch

New submission from Malthe Borch:

Many systems today use Python 3 as the default interpreter "python". The Python 
2.7 build fails because of syntax incompatibility.

Attached patch fixes this.

--
components: Build
files: 0001-Allow-make-to-be-run-under-Python-3.patch
keywords: patch
messages: 276401
nosy: malthe
priority: normal
severity: normal
status: open
title: ASDL compatibility with Python 3 system interpreter
type: compile error
versions: Python 2.7
Added file: 
http://bugs.python.org/file44654/0001-Allow-make-to-be-run-under-Python-3.patch

___
Python tracker 

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



[issue27374] Cygwin: Makefile does not install DLL import library

2016-09-14 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

I'm so sorry that I misspelled your name, Erik.

--

___
Python tracker 

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



[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-09-14 Thread Xiang Zhang

Xiang Zhang added the comment:

Update the patch with unittest.

--
Added file: http://bugs.python.org/file44655/issue28123_v2.patch

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread Stefan Krah

Stefan Krah added the comment:

Numpy itself internally doesn't. Consumers of numpy arrays use
memoryviews. Numpy is often used as a library these days, even
for simple things like storing a 2-d table, which can easily be
several TB.

It is also easy to generate unaligned data by just taking a slice
of a bytes memoryview.

--

___
Python tracker 

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



[issue28144] Decrease empty_keys_struct's dk_refcnt

2016-09-14 Thread Xiang Zhang

New submission from Xiang Zhang:

There is no dummy_struct any more. So I think we can decrease 
empty_keys_struct's dk_refcnt.

--
files: empty_keys.patch
keywords: patch
messages: 276405
nosy: haypo, methane, xiang.zhang
priority: normal
severity: normal
status: open
title: Decrease empty_keys_struct's dk_refcnt
Added file: http://bugs.python.org/file44656/empty_keys.patch

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread Stefan Krah

Stefan Krah added the comment:

s/unaligned/not 8-byte-aligned/

--

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread Christian Heimes

Christian Heimes added the comment:

memoryview() has to create a copy for NumPy memoryviews already.

--

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread Stefan Krah

Stefan Krah added the comment:

I don't understand this. Could you explain?

--

___
Python tracker 

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



[issue28142] windows installer not adding PYTHONHOME

2016-09-14 Thread Eryk Sun

Eryk Sun added the comment:

PYTHONHOME should only be set temporarily for special cases. If running 
python.exe without PYTHONHOME fails to find the standard library, then your 
system is misconfigured. For additional help with this problem, ask on either 
python-list or python-win32.

--
components: +Windows
nosy: +eryksun, paul.moore, tim.golden
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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread Christian Heimes

Christian Heimes added the comment:

memory_hash has to convert buffers unless the buffer is a single-dimensional, 
C-style and contiguous buffer. A NumPy matrix has more than one dimension, so 
it must be converted.

https://hg.python.org/cpython/file/tip/Objects/memoryobject.c#l2854

if (!MV_C_CONTIGUOUS(self->flags)) {
mem = PyMem_Malloc(view->len);
if (mem == NULL) {
PyErr_NoMemory();
return -1;
}
if (buffer_to_contiguous(mem, view, 'C') < 0) {
PyMem_Free(mem);
return -1;
}
}

--

___
Python tracker 

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



[issue27441] redundant assignments to ob_size of new ints that _PyLong_New returned

2016-09-14 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread Stefan Krah

Stefan Krah added the comment:

I see. No, most NumPy arrays are C-contiguous. Multi-dimmensional arrays
are contiguous, too.

Non C-contiguous arrays arise mostly during slicing or if they're
Fortran-order to begin with.


But NumPy aside, it's weird to have slice of a huge regular bytes view
(this particular slice is still C-contiguous) that is suddenly copied
because the alignment requirements changed.

I really prefer a simple rule for memoryview: If the data is C-contiguous,
you get the fast path.

--

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I support Stefan. Just requiring 8-byte align is the easiest solution, but it 
doesn't work with memoryview without expensive memory allocation and copying.

Look at the FNV code. It supports non-4-byte aligned data, and does it in a 
safe and efficient way.

--

___
Python tracker 

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



[issue28143] ASDL compatibility with Python 3 system interpreter

2016-09-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Shouldn't the NEWS entity be in the C API section?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28145] Fix whitespace in C source code

2016-09-14 Thread Francisco Couzo

New submission from Francisco Couzo:

I changed most of the tabs in the source code to spaces, and removed trailing 
whitespace.

I also made some scripts that generate code use spaces and not generate 
trailing whitespace. (makesetup and makeunicodedata.py)

I fixed a typo in Modules/makesetup (I don't know if I should open another 
issue, if so please tell me)

I think by changing line Tools/unicode/makeunicodedata.py:1260 to 
file.write(s.strip() + "\n") the trailing whitespace in unicodename_db.h and 
unicodedata_db.h would be fixed, but I didn't put that change in the patch 
because I couldn't test it.

I couldn't find where Parser/asdl_c.py is generating the trailing spaces for 
Python-ast.h

--
files: fix_whitespace.patch
keywords: patch
messages: 276414
nosy: franciscouzo
priority: normal
severity: normal
status: open
title: Fix whitespace in C source code
versions: Python 3.7
Added file: http://bugs.python.org/file44657/fix_whitespace.patch

___
Python tracker 

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



[issue28146] Confusing error messages in str.format()

2016-09-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
title: Confusing error examples in str.format() -> Confusing error messages in 
str.format()

___
Python tracker 

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



[issue28146] Confusing error examples in str.format()

2016-09-14 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

For example:

>>> '{:04}'.format('abc')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: '=' alignment not allowed in string format specifier

There is no any '=' in the format string.

>>> '{: }'.format('abc')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: Sign not allowed in string format specifier

There is no any sign ('+' or '-') in the format string.

There also an inconsistency between the wording of "something not allowed in 
string format specifier" and:

>>> '{:x}'.format('abc')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: Unknown format code 'x' for object of type 'str'
>>> '{:xx}'.format('abc')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: Invalid format specifier

--
components: Interpreter Core, Unicode
messages: 276415
nosy: ezio.melotti, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Confusing error examples in str.format()

___
Python tracker 

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



[issue22543] -W option cannot use non-standard categories

2016-09-14 Thread Torsten Landschoff

Torsten Landschoff added the comment:

Wow, this was news to me and I just ran into it in python 2.7. Checked in 
Python 3 and it's still there:

```
(py3)->torsten.landschoff@horatio:~$ python3 --version
Python 3.6.0a3+
(py3)->torsten.landschoff@horatio:~$ python3 -W error::sqlalchemy.exc.SAWarning 
-c "print()"
Invalid -W option ignored: invalid module name: 'sqlalchemy.exc'

```

I see no easy way to fix this. One way I thought about is to have hooks for 
importing of modules (called when a module is put into ``sys.modules``, not 
sure if there is something like this already) and have the warning system 
trigger on that.

There is no way to raise an exception before it is imported anyway...

--
nosy: +torsten

___
Python tracker 

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



[issue28146] Confusing error messages in str.format()

2016-09-14 Thread Eric V. Smith

Eric V. Smith added the comment:

See also issue 27772.

The difference in the error messages is due to the first ones looking for 
specific invalid combinations (in this case things the string formatter does 
not understand), and the last one which is "I have no idea what you're asking 
for".

--
nosy: +eric.smith
type:  -> behavior

___
Python tracker 

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



[issue28147] Memory leak in dictionary resize

2016-09-14 Thread Min RK

New submission from Min RK:

There is a memory leak in the new dictionary resizing in 3.6, which can cause 
memory exhaustion in just a few iterations.

I don't fully understand the details of the bug, but it happens when resizing a 
dict with a split table several times.  The only way that I have found to 
trigger this is by popping items off of an object's `__dict__` repeatedly.

I've attached a script to illustrate the issue. Be careful with it, because it 
will eat up all your memory if you don't interrupt it.

--
components: Interpreter Core
files: test-dict-pop.py
messages: 276418
nosy: minrk
priority: normal
severity: normal
status: open
title: Memory leak in dictionary resize
type: crash
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file44658/test-dict-pop.py

___
Python tracker 

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



[issue28147] Memory leak in dictionary resize

2016-09-14 Thread Min RK

Min RK added the comment:

This patch fixes the memory leak in split-dict resizing.

Each time dict_resize is called, it gets a new, larger size `> minused`. If 
this is triggered many times, it will keep growing in size by a factor of two 
each time, as the previous size is passed as minused for the next call.

Set the lower bound at minused (inclusive), rather than exclusive, so that the 
size does not continue to increase for repeated calls.

A test is added to test_dict.py based on the earlier test script, but if 
someone has a simpler way to trigger the split-dict resize events, I'd be happy 
to see it.

--
keywords: +patch
Added file: 
http://bugs.python.org/file44659/0001-Avoid-unbounded-growth-in-dict_resize.patch

___
Python tracker 

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



[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread Min RK

Changes by Min RK :


--
title: Memory leak in dictionary resize -> Memory leak in new 3.6 dictionary 
resize

___
Python tracker 

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



[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread Berker Peksag

Berker Peksag added the comment:

Can you wrap the test with @support.cpython_only decorator? The patch fixes the 
memory leak demonstrated in test-dict-pop.py.

--
nosy: +berker.peksag, haypo, methane
stage:  -> patch review

___
Python tracker 

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



[issue28148] Also stop using localtime() in timemodule

2016-09-14 Thread Ed Schouten

New submission from Ed Schouten:

In issue 28067, we changed _datetimemodule to stop using localtime() and 
gmtime(), which is nice. I actually needed such a change for CloudABI 
(https://mail.python.org/pipermail/python-dev/2016-July/145708.html) which does 
not provide the thread-unsafe variants. Only localtime_r() and gmtime_r() are 
provided.

If we're starting to make use of these functions, let's complete this by also 
changing timemodule to use them. I've attached a patch.

Maybe it now makes sense to move the Windows wrappers to some header file, so 
that they can be shared between both modules. What would be the right location 
for this?

--
components: Extension Modules
files: patch-no-gmtime-localtime
messages: 276421
nosy: EdSchouten
priority: normal
severity: normal
status: open
title: Also stop using localtime() in timemodule
versions: Python 3.6
Added file: http://bugs.python.org/file44660/patch-no-gmtime-localtime

___
Python tracker 

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



[issue28149] Incorrect indentation under “else” in _bsddb.c

2016-09-14 Thread Martin Panter

New submission from Martin Panter:

Compiling Python 2.7 gives:

/home/proj/python/cpython/Modules/_bsddb.c: In function ‘newDBObject’:
/home/proj/python/cpython/Modules/_bsddb.c:936:5: warning: this ‘else’ clause 
does not guard... [-Wmisleading-indentation]
 else
 ^~~~
/home/proj/python/cpython/Modules/_bsddb.c:938:9: note: ...this statement, but 
the latter is misleadingly indented as if it is guarded by the ‘else’
 self->moduleFlags.cursorSetReturnsNone = 
DEFAULT_CURSOR_SET_RETURNS_NONE;
 ^~~~

The code in question was changed a long time ago in revision defa1d825b08:

 if (self->myenvobj)
-self->getReturnsNone = self->myenvobj->getReturnsNone;
+self->moduleFlags = self->myenvobj->moduleFlags;
 else
-self->getReturnsNone = GET_RETURNS_NONE_DEFAULT;
+self->moduleFlags.getReturnsNone = DEFAULT_GET_RETURNS_NONE;
+self->moduleFlags.cursorSetReturnsNone = 
DEFAULT_CURSOR_SET_RETURNS_NONE;

It looks like the solution is to group both statements with braces, but I don’t 
know this module, so I can’t be sure, and I don’t know how to test it.

--
components: Extension Modules
messages: 276422
nosy: gregory.p.smith, martin.panter
priority: normal
severity: normal
stage: test needed
status: open
title: Incorrect indentation under “else” in _bsddb.c
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



[issue28150] Error CERTIFICATE_VERIFY_FAILED in macOS

2016-09-14 Thread Jason R. Coombs

New submission from Jason R. Coombs:

I saw the notice when installing Python 3.6.0b1 on Mac that said that the 
bundled OpenSSL is no longer used and thus 'certifi' will need to be installed 
and kept up-to-date.

At first, I thought, "no big deal" and pushed forward, but since, I've 
encountered the error in several cases:

- pip install of anything but certifi
- pip install in a new venv of anything but certifi
- distutils upload command (even with certifi installed)

I've only had 3.6.0b1 installed for a day, so I imagine I'm going to encounter 
new cases. Yes, indeed:

$ python
Python 3.6.0b1 (v3.6.0b1:5b0ca4ed5e2f, Sep 12 2016, 09:24:46) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.request
>>> urllib.request.urlopen('https://www.google.com')
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py",
 line 1318, in do_open
...
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 
683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 
(_ssl.c:747)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py",
 line 223, in urlopen
...
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py",
 line 1320, in do_open
raise URLError(err)
urllib.error.URLError: 
>>> import certifi


So it seems that even the guidance of installing certifi isn't sufficient to 
restore the basic expectation that using the stdlib to open URLs securely.

I can't imagine this behavior is acceptable (either requiring a bootstrap step 
in each environment or requiring some call at runtime to set up SSL before 
making HTTPS calls).

I no longer have the message that the installer gave me and I don't see 
anything in the What's New document for 3.6 about certificates.

Is this deficiency something that's planned to be corrected for the next beta? 
Is there a recommended procedure to enable SSL in urllib.request?

--
components: Library (Lib)
messages: 276423
nosy: jason.coombs
priority: normal
severity: normal
status: open
title: Error CERTIFICATE_VERIFY_FAILED in macOS
type: crash
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue28150] Error CERTIFICATE_VERIFY_FAILED in macOS

2016-09-14 Thread Christian Heimes

Christian Heimes added the comment:

We are not going to use certifi in rc and final releases. It's only in b1 
because the infrastructure and cert handling code is not yet in place. Ned has 
a plan.

--
nosy: +christian.heimes, ned.deily

___
Python tracker 

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



[issue28150] Error CERTIFICATE_VERIFY_FAILED in macOS

2016-09-14 Thread Christian Heimes

Changes by Christian Heimes :


--
priority: normal -> critical
type: crash -> security

___
Python tracker 

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



[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread Min RK

Min RK added the comment:

I can add the cpython_only decorator, but I'm not sure it is the right thing to 
do. I would expect the code in the test to pass on any Python implementation, 
which would suggest that it should not be cpython_only, right? If you still 
think so, I'll add it.

--

___
Python tracker 

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



[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-14 Thread Christian Heimes

Christian Heimes added the comment:

Isn't the C API section reserved for C API changes? I haven't changed the C API 
but rather optimized the core.

--

___
Python tracker 

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



[issue28145] Fix whitespace in C source code

2016-09-14 Thread Martin Panter

Martin Panter added the comment:

What is the reasoning behind this? It seems like trading one person’s style, 
fashion, or editor settings for another. I think it is better to just tolerate 
existing styles, unless they cause significant problems. But maybe see what 
other people think.

The disadvantages of any change include adding extra noise to the history, 
conflicts with other patches people write, potential for error.

I am happy to commit your spelling fix though.

--
nosy: +martin.panter

___
Python tracker 

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



[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread INADA Naoki

INADA Naoki added the comment:

I don't understand the leak yet.

> Each time dict_resize is called, it gets a new, larger size `> minused`. If 
> this is triggered many times, it will keep growing in size by a factor of two 
> each time, as the previous size is passed as minused for the next call.

dictresize() is called for converting split table to combined table.
How is it triggered many times?

In your test code, which loop cause leak? new instance loop or re-use instance 
loop?

--

___
Python tracker 

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



[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0ca42273c714 by Victor Stinner in branch '3.6':
Issue #28114: Add unit tests on os.spawn*()
https://hg.python.org/cpython/rev/0ca42273c714

--
nosy: +python-dev

___
Python tracker 

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



[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

Berker and/or Eryksun: Please write unit tests for your patch. I just added a 
new SpawnTests to test_os which tests all os.spawn*() functions.

Please add at least one unit test with env contains a bytes key/value entry. 
Maybe add a use_bytes=False parameter to create_args() to use bytes for the 
variable added by the test?

--

___
Python tracker 

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



[issue28127] Add _PyDict_CheckConsistency()

2016-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ee44c971b3af by Victor Stinner in branch '3.6':
Add _PyDict_CheckConsistency()
https://hg.python.org/cpython/rev/ee44c971b3af

New changeset 070cc3b9d5cc by Victor Stinner in branch 'default':
Merge 3.6
https://hg.python.org/cpython/rev/070cc3b9d5cc

--
nosy: +python-dev

___
Python tracker 

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



[issue28127] Add _PyDict_CheckConsistency()

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

Ok, I pushed my new function. Expensive checks are disabled by default: define 
DEBUG_PYDICT to enable them (ex: gcc -D DEBUG_PYDICT).

Thanks for the review Eric, Naoki & Xiang!

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The Py_MEMCPY name doesn't start by an underscore, and it is not inside the 
"#ifndef Py_LIMITED_API" block. But it is not documented either. I don't know 
what is the status of this macro. If this is a part of public API, this change 
should be documented in the C API section. If it is inner macro, this change 
shouldn't be mentioned in Misc/NEWS.

--

___
Python tracker 

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



[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

The CPython test suite uses a counter on memory allocations. Please add an unit 
test which triggers the memory leak, but you don't need many iterations. One 
iteartion should be enough to be catched by the unit test. Try: ./python -m 
test -R 3:3 test_dict.

The memory allocation counter:
https://docs.python.org/dev/library/sys.html#sys.getallocatedblocks

Note: The tracemalloc module can also be used to track memory leak, but it's 
harder to use it to write unit tests because Python uses a lot of internal 
caches and tracemalloc really tracks every single bytes.

--

___
Python tracker 

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



[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

I don't think that it's very useful to discuss the status of the
macro. Documenting the change doesn't harm ;-)

--

___
Python tracker 

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



[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-14 Thread Christian Heimes

Christian Heimes added the comment:

My change doesn't break or change 3rd party application. They might get a tiny 
bit faster on Windows, if they have used Py_MEMCPY() for up to 16 bytes. That's 
it.

--

___
Python tracker 

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



[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread INADA Naoki

INADA Naoki added the comment:

Ah, is the leak happen in 3.6b1?
dict.pop() in 3.6b1 doesn't combine split table.  It was a bug and
fixed in master branch already.

Regardless the leak, I agree that grow dict when popping is bad idea.
I'll improve your patch.

--

___
Python tracker 

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



[issue28125] identify cross builds by a more generic environment setting.

2016-09-14 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> please try to build extension modules with mismatching abi flags (pydebug is 
> the
relevant one). Post your results for both mismatch cases.

Hum, you are claiming that there is a problem with mismatching abi flags but 
don't care to explain why or to demonstrate the problem, and asking instead 
that it should be proven by someone else running a test that you are right...

Anyway, you are mistaken. The cross-compilation of Android with 'pydebug' set, 
using a native interpreter built without 'pydebug' gives the following results:

The native interpreter:
[xavier@bilboquet python-native]$ ./python
Python 3.7.0a0 (default:879bde95a456+, Sep 13 2016, 18:59:47) 
[GCC 6.1.1 20160707] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.abiflags
'm'

The Android interpreter built with this native interpreter:
root@generic_x86:/data/data/org.bitbucket.pyona # python
Python 3.7.0a0 (default:879bde95a456+, Sep 14 2016, 14:53:50) 
[GCC 4.2.1 Compatible Clang 3.8.243773 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.abiflags
'dm'
>>> import _socket
>>> _socket.__file__
'/data/data/org.bitbucket.pyona/python/lib/python3.7/lib-dynload/_socket.cpython-37dm-i686-linux-android.so'

--

___
Python tracker 

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



[issue15369] pybench and test.pystone poorly documented

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

> I'd also like to request that you reword this dismissive line in the 
> performance package's readme: (...)

Please report issues of the performance module on its own bug tracker:
https://github.com/python/performance

Can you please propose a new description? You might even create a pull
request ;-)

Note: I'm not sure that we should keep pybench, this benchmark really
looks unreliable. But I should still try at least to use the same
number of iterations for all worker child processes. Currently the
calibration is done in each child process.

--

___
Python tracker 

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



[issue28125] identify cross builds by a more generic environment setting.

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

@Matthias Klose: I concur with Xavier, can you please behave as a professional 
and "keep exchanges on the bug tracker strictly on a technical level"? Personal 
attacks doesn't help us to contribute with you.

I didn't follow the discussion, but I'm sure that we can find a solution with 
work for all use cases: multiarch, cross compilation, etc.

--

___
Python tracker 

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



[issue28151] testPythonOrg() of test_robotparser fails on validating python.org HTTPS certificate

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

A workaround is to catch the ssl.SSLError and skip the unit test...

Another fix is to avoid completely network connection to the Internet and only 
uses the temporary HTTP server used by other unit tests.

--

___
Python tracker 

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



[issue28144] Decrease empty_keys_struct's dk_refcnt

2016-09-14 Thread INADA Naoki

INADA Naoki added the comment:

Nice catch!

--

___
Python tracker 

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



[issue28151] testPythonOrg() of test_robotparser fails on validating python.org HTTPS certificate

2016-09-14 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +buildbot
nosy: +zach.ware

___
Python tracker 

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



[issue28151] testPythonOrg() of test_robotparser fails on validating python.org HTTPS certificate

2016-09-14 Thread STINNER Victor

New submission from STINNER Victor:

The "x86 Windows7 3.x" buildbot fails to validate python.org HTTPS certificate.

The unit test uses the clear text HTTP URL, but 
http://www.python.org/robots.txt returns "301 Moved Permanently" with the new 
link: https://www.python.org/robots.txt

Firefox sees the cert as valid on my Fedora 24.

Firefox tells me that the cert organization (O) is "Python Software Foundation" 
and it was emitted by (CN) "DigiCert SHA2 Extended Validation Server CA", (O) 
"DigiCert Inc", (OU) "www.digicert.com".

Does this buildbot lack DigitCert root CA?

http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/11636/steps/test/logs/stdio

==
ERROR: testPythonOrg (test.test_robotparser.NetworkTestCase)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\http\client.py", 
line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\http\client.py", 
line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\http\client.py", 
line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\http\client.py", 
line 1026, in _send_output
self.send(msg)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\http\client.py", 
line 964, in send
self.connect()
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\http\client.py", 
line 1400, in connect
server_hostname=server_hostname)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\ssl.py", 
line 401, in wrap_socket
_context=self, _session=session)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\ssl.py", 
line 808, in __init__
self.do_handshake()
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\ssl.py", 
line 1061, in do_handshake
self._sslobj.do_handshake()
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\ssl.py", 
line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 
(_ssl.c:747)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_robotparser.py",
 line 280, in testPythonOrg
parser.read()
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\robotparser.py",
 line 58, in read
f = urllib.request.urlopen(self.url)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 223, in urlopen
return opener.open(url, data, timeout)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 532, in open
response = meth(req, response)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 642, in http_response
'http', request, response, code, msg, hdrs)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 564, in error
result = self._call_chain(*args)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 504, in _call_chain
result = func(*args)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 756, in http_error_302
return self.parent.open(new, timeout=req.timeout)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 526, in open
response = self._open(req, data)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 544, in _open
'_open', req)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 504, in _call_chain
result = func(*args)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\urllib\request.py", 
line 1320, in do_open
raise URLError(err)
urllib.error.URLError: 

--
components: Tests
messages: 276442
nosy: christian.heimes, haypo
priority: normal
severity: normal
status: open
title: testPythonOrg() of test_robotparser fails on validating python.org HTTPS 
certificate
versions: Python 3.7

___
Python tracker 


[issue28099] Drop Mac OS X Tiger support in Python 3.6

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

The "x86 Tiger 3.6" and "x86 Tiger 3.x" buildbots currently fail to compile 
Python:

* http://buildbot.python.org/all/builders/x86%20Tiger%203.6
* http://buildbot.python.org/all/builders/x86%20Tiger%203.x

--

___
Python tracker 

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



[issue28151] testPythonOrg() of test_robotparser fails on validating python.org HTTPS certificate

2016-09-14 Thread Berker Peksag

Berker Peksag added the comment:

Note that I'm planning to rewrite the test to use pythontest.net.

--
nosy: +berker.peksag
stage:  -> needs patch
type:  -> enhancement
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



[issue28145] Fix whitespace in C source code

2016-09-14 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Well, it's trading one person's style for the PEP7 official style, so it's not 
completely arbitrary.

That said, I'm not sure it's justifiable to apply to the entire historic code 
base; my impression was that PEP7 was not intended to be applied retroactively 
in bulk, per the second reason not to obey a rule:

"To be consistent with surrounding code that also breaks it (maybe for historic 
reasons) -- although this is also an opportunity to clean up someone else's 
mess (in true XP style)."

--
nosy: +josh.r

___
Python tracker 

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



[issue27599] Buffer overrun in binascii

2016-09-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue27599] Buffer overrun in binascii

2016-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 423ad3b14ee1 by Serhiy Storchaka in branch '3.5':
Issue #27599: Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp().
https://hg.python.org/cpython/rev/423ad3b14ee1

New changeset fbc579ec36ab by Serhiy Storchaka in branch '2.7':
Issue #27599: Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp().
https://hg.python.org/cpython/rev/fbc579ec36ab

New changeset d53e1a5576e6 by Serhiy Storchaka in branch '3.6':
Issue #27599: Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp().
https://hg.python.org/cpython/rev/d53e1a5576e6

New changeset 56294e03ad89 by Serhiy Storchaka in branch 'default':
Issue #27599: Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp().
https://hg.python.org/cpython/rev/56294e03ad89

--
nosy: +python-dev

___
Python tracker 

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



[issue28152] Clang warnings: code will never be executed

2016-09-14 Thread STINNER Victor

New submission from STINNER Victor:

The issue #23545 enabled extra warnings on GCC. Clang on FreeBSD now complains 
about unreachable (dead) code:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.x/builds/281/steps/compile/logs/warnings%20%2814%29

Python/ast.c:3133:5: warning: code will never be executed [-Wunreachable-code]
Modules/posixmodule.c:10256:5: warning: code will never be executed 
[-Wunreachable-code]
Modules/zipimport.c:1004:22: warning: code will never be executed 
[-Wunreachable-code]
Modules/faulthandler.c:988:5: warning: code will never be executed 
[-Wunreachable-code]

See also my change ea00c88f7f42 which fixed a similar issue in Parser/grammar.c.

See also the issue #14656.

--
messages: 276448
nosy: benjamin.peterson, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Clang warnings: code will never be executed
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



[issue28145] Fix whitespace in C source code

2016-09-14 Thread Mark Dickinson

Mark Dickinson added the comment:

It's also worth noting that "make patchcheck", which we're encouraged to use by 
the Python developer's guide, autofixes these whitespace issues. I find that 
somewhat annoying, since "make patchcheck" makes changes unrelated to the patch 
I'm committing, which I then have to manually undo. But if the codebase were 
clean with respect to these whitespace issues, that wouldn't be a problem.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread Min RK

Min RK added the comment:

> dictresize() is called for converting split table to combined table.
> How is it triggered many times?

every `self.__dict__.pop` triggers a resize. According to 
https://www.python.org/dev/peps/pep-0412/#split-table-dictionaries 
`obj.__dict__` is always a split-table dict. I do not understand the dict 
implementation enough to say precisely why, but `pop` forces a recombine via 
`resize` because split-table dicts don't support deletion. In `dict_resize`, 
due to a `<=minused` condition, the size is guaranteed to at least double every 
time `dict_resize` is called. It would appear that after this, `__dict__` is 
again forced to be a split-table dict, though I'm not sure how or where this 
happens, but good old-fashioned printf debugging shows that `dict_resize` is 
called for every `__dict__.pop` because _PyDict_HasSplitTable is true every 
time pop is called.


> In your test code, which loop cause leak? new instance loop or re-use 
> instance loop?

Both loops cause the leak. If the `pop_attr()` is not in `__init__`, then only 
the re-used instance has the leak. if `pop_attr` is in `__init__`, then it 
happens across instances as well. I will try to add more comments in the code 
to make this clearer.

Does anyone have a handy way to create a split-table dict other than on 
`obj.__dict__`?


> Please add an unit test which triggers the memory leak

I should not have used the term memory leak, and have updated the title to be 
more precise. It is not memory allocated without a corresponding free, instead 
it is unbounded growth of the memory owned by a split-table dict. Cleaning up 
the object does indeed clean up the memory associated with it. The included 
test exercises the bug with several iterations. Running the test several times 
with only one iteration would not exercise the bug.

--

___
Python tracker 

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



[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread STINNER Victor

STINNER Victor added the comment:

> According to 
> https://www.python.org/dev/peps/pep-0412/#split-table-dictionaries 
> `obj.__dict__` is always a split-table dict.

Hum, this PEP is now probably outdated since Python 3.6 beta 1 :-)

--

___
Python tracker 

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



[issue23148] Missing the charset parameter in as_encoded_word()

2016-09-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> test needed
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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread Min RK

Min RK added the comment:

> Ah, is the leak happen in 3.6b1?

The leak happens in 3.6b1 and master as of an hour ago (git: 
3c06edfe9463f1cf81bc34b702f165ad71ff79b8, hg:r103797)

--
title: Memory leak in new 3.6 dictionary resize -> Unbounded memory growth 
resizing split-table dicts

___
Python tracker 

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



[issue23147] Possible error in _header_value_parser.py

2016-09-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> test needed
versions: +Python 3.6, Python 3.7 -Python 3.4

___
Python tracker 

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



[issue28143] ASDL compatibility with Python 3 system interpreter

2016-09-14 Thread R. David Murray

R. David Murray added the comment:

It's probably not a bad thing to fix this, but you should be able to avoid the 
problem by using 'make touch' before building.  It should not be necessary to 
have a running python to build python; all the build artifacts are checked in.  
Specifically, the release tarballs should build without an existing python, and 
if they don't, that's a release packaging problem.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue28135] assertRaises should return the exception in its simple form

2016-09-14 Thread Raymond Hettinger

Raymond Hettinger added the comment:

-0 This doesn't feel Pythonic to me.

--
nosy: +rhettinger

___
Python tracker 

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



[issue28145] Fix whitespace in C source code

2016-09-14 Thread R. David Murray

R. David Murray added the comment:

A while ago Antoine fixed the leading tabs throughout the C source, after 
considerable debate about it.  So we've been down this road before.  Since I 
don't touch the C code often, I don't really have an opinion on this one way or 
the other :)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue28147] Unbounded memory growth resizing split-table dicts

2016-09-14 Thread Min RK

Min RK added the comment:

I pulled just now and saw changes in dictobject.c, and just wanted to confirm 
the memory growth bug is still in changeset 56294e03ad89 (I think I used the 
right hash, this time).

--

___
Python tracker 

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



[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread Eryk Sun

Eryk Sun added the comment:

Thanks for the spawn test framework, Victor. I've added a use_bytes argument to 
encode the args and env using os.fsencode. It's encoding args as well because 
parse_arglist calls fsconvert_strdup, which was assuming Unicode strings on 
Windows instead of first calling PyUnicode_FSDecoder. test_spawnve_bytes passes 
for me on Linux and Windows.

--
Added file: http://bugs.python.org/file44661/issue_28114_02.patch

___
Python tracker 

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



[issue28135] assertRaises should return the exception in its simple form

2016-09-14 Thread R. David Murray

R. David Murray added the comment:

This has been proposed and rejected several times before.

IMO, a strong reason to reject it is that no other assert methods return 
values.  Consistency is important.

Also note that cm survives the context manager, so you don't need that 
assignment statement.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> unittest.assertRaises() return the raised exception

___
Python tracker 

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



[issue28153] [Patch] selectmodule: Make kqueue()'s event filters optional

2016-09-14 Thread Ed Schouten

New submission from Ed Schouten:

Just like the BSDs and Mac OS X, CloudABI 
(https://mail.python.org/pipermail/python-dev/2016-July/145708.html) provides 
support for kqueue(). Its implementation, however, is far more limited. It can 
only be used for polling on descriptors (EVFILT_READ/EVFILT_WRITE) and waiting 
on timers (EVFILT_TIMER).

The existing selectmodule already allows some filters to be present optionally 
(e.g., EVFILT_NETDEV). The attached patch extends this work by only defining 
the filter and corresponding filter flags when available.

I've also added guards around EV_SYSFLAGS and EV_FLAG1. EV_SYSFLAGS is a flag 
that's typically only used by the kernel to trim off flags that are only used 
internally. EV_FLAG1 is an example of such a flag, which seems to be used by 
FreeBSD to mark incoming AIO events as validated. I would even go as far as to 
remove these two flags from the module entirely, but let's not take the risk.

--
components: Extension Modules
files: patch-kqueue-EVFILT
messages: 276459
nosy: EdSchouten
priority: normal
severity: normal
status: open
title: [Patch] selectmodule: Make kqueue()'s event filters optional
versions: Python 3.6
Added file: http://bugs.python.org/file44662/patch-kqueue-EVFILT

___
Python tracker 

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



[issue28154] Core dump after importing lxml in Python3.6b

2016-09-14 Thread Filip Stefanov

New submission from Filip Stefanov:

fstefanov@lin-0360: ~/bin/python/vm/python3.6b/bin 
$ python

Python 3.6.0b1 (default, Sep 14 2016, 11:15:36) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxml as xxl
*** Error in `python': free(): invalid pointer: 0x7f65d052b258 ***
Aborted (core dumped)
(python3.6b) 

$ pip list | grep lxml
lxml (3.6.4)

--
components: Interpreter Core
messages: 276460
nosy: philip.stefanov
priority: normal
severity: normal
status: open
title: Core dump after importing lxml in Python3.6b
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



[issue28154] Core dump after importing lxml in Python3.6b

2016-09-14 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue28154] Core dump after importing lxml in Python3.6b

2016-09-14 Thread Christian Heimes

Christian Heimes added the comment:

I can't reproduce the problem with the latest checkout of Python 3.6. The crash 
might have been caused by #28120. Can you try again with a refresh checkout 
from hg.python.org?

--

___
Python tracker 

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



[issue28153] [Patch] selectmodule: Make kqueue()'s event filters optional

2016-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 57ff729e923f by Berker Peksag in branch '3.6':
Issue #28153: Make kqueue()'s event filters optional
https://hg.python.org/cpython/rev/57ff729e923f

New changeset 6c5f9c6c25ea by Berker Peksag in branch 'default':
Issue #28153: Merge from 3.6
https://hg.python.org/cpython/rev/6c5f9c6c25ea

--
nosy: +python-dev

___
Python tracker 

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



[issue28153] [Patch] selectmodule: Make kqueue()'s event filters optional

2016-09-14 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
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



[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread Eryk Sun

Changes by Eryk Sun :


Added file: http://bugs.python.org/file44663/issue_28114_03.patch

___
Python tracker 

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



[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-14 Thread Steve Dower

Steve Dower added the comment:

> They might get a tiny bit faster on Windows, if they have used Py_MEMCPY() 
> for up to 16 bytes

Even that's unlikely as the loop in the macro would have been unrolled in 
practically every case.

This is about removing an unnecessary macro. Certainly no API change unless we 
delete it entirely (which I'm okay with), and IMHO if it has an issue number it 
should go in NEWS. Maybe build is the right section?

--

___
Python tracker 

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



[issue28114] parse_envlist(): os.execve(), os.spawnve(), etc. crash in Python 3.6.0 when env contains byte strings

2016-09-14 Thread Berker Peksag

Berker Peksag added the comment:

Eryk's patch looks good to me, thanks! I will wait for others to review the 
patch.

--

___
Python tracker 

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



[issue28154] Core dump after importing lxml in Python3.6b

2016-09-14 Thread Filip Stefanov

Filip Stefanov added the comment:

My source was out of date... You are right now is working fine 
Sorry for the time wasted. :)

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue28155] Small typo in Json docs

2016-09-14 Thread Андрей Морозько

New submission from Андрей Морозько:

In Json module, example titled "Using json.tool from the shell to validate and 
pretty-print:"
5th line reads:
echo '{1.2:3.4}' | python -mjson.tool
should
echo '{1.2:3.4}' | python -m json.tool

--
assignee: docs@python
components: Documentation
messages: 276467
nosy: docs@python, Андрей Морозько
priority: normal
severity: normal
status: open
title: Small typo in Json docs
type: enhancement
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue28155] Small typo in Json docs

2016-09-14 Thread SilentGhost

SilentGhost added the comment:

The space between -m switch and module name is not mandatory as you should be 
able to see if you run those examples.

--
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> resolved

___
Python tracker 

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



[issue28155] Small typo in Json docs

2016-09-14 Thread SilentGhost

Changes by SilentGhost :


--
status: open -> closed

___
Python tracker 

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



[issue28155] Small typo in Json docs

2016-09-14 Thread Zachary Ware

Zachary Ware added the comment:

See 05e8b25379a3, though; it may be worth a backport.  Not to 3.3, though; it's 
docs are not being updated anymore.

--
nosy: +zach.ware
versions:  -Python 3.3

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Ed Schouten

Changes by Ed Schouten :


--
title: Also stop using localtime() in timemodule -> [Patch] Also stop using 
localtime() in timemodule

___
Python tracker 

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



[issue28156] [Patch] posixmodule: Make the presence of os.getpid() optional

2016-09-14 Thread Ed Schouten

New submission from Ed Schouten:

CloudABI (https://mail.python.org/pipermail/python-dev/2016-July/145708.html) 
does not provide getpid(). Though this may sound quite silly at first, there is 
quite a good reason for this. One of the things that CloudABI wants to achieve 
is making large scale (cluster/cloud) computing easier. In such an environment 
there is rarely a need for having machine-local unique process identifiers. 
They have to be globally unique and preferably not recycled.

POSIX requires that pid_t is a signed integer that must have a positive value. 
Most C compilers only provide full support for integers up to 64 bits in size. 
This means that CloudABI could only provide 63-bit process identifiers, which 
is far smaller than, say, a UUID. For this reason we've decided to omit 
getpid() altogether.

Attached is a patch that makes use of the already existing HAVE_GETPID 
definition in pyconfig.h to disable the os.getpid() function that is part of 
the posixmodule.

--
components: Extension Modules
files: patch-no-getpid
messages: 276470
nosy: EdSchouten
priority: normal
severity: normal
status: open
title: [Patch] posixmodule: Make the presence of os.getpid() optional
versions: Python 3.6
Added file: http://bugs.python.org/file44664/patch-no-getpid

___
Python tracker 

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



[issue28148] [Patch] Also stop using localtime() in timemodule

2016-09-14 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> What would be the right location for [the Windows wrappers]?

I would say Include/pytime.h:

/**
Symbols and macros to supply platform-independent interfaces to time related
functions and constants
**/

--

___
Python tracker 

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



  1   2   >