[issue16394] Reducing tee() memory footprint

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f09306f9fa6f by Raymond Hettinger in branch 'default':
Issue #16394:  Note the tee() pure python equivalent is only a rough 
approximation.
https://hg.python.org/cpython/rev/f09306f9fa6f

--
nosy: +python-dev

___
Python tracker 

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



[issue16394] Reducing tee() memory footprint

2016-04-26 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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



[issue23275] Can assign [] = (), but not () = []

2016-04-26 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Martin, do you want to take it from here?

--
assignee: rhettinger -> martin.panter

___
Python tracker 

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



[issue26512] Vocabulary: Using "integral" in library/stdtypes.html

2016-04-26 Thread Martin Panter

Martin Panter added the comment:

Here is a v3 patch for Python 3, addressing everyone’s comments:

Fix the leftover table markup
Link math.trunc(x) etc syntax to the main documentation
Hide numbers module prefix from Integral class name
Change “integral float” → ~numbers.Integral
Add emphasis for *n* parameter
Change int → Integral in doc strings

--
stage: needs patch -> patch review
Added file: http://bugs.python.org/file42593/stdtypes-integral.v3.py3.patch

___
Python tracker 

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



[issue26842] Python Tutorial 4.7.1: Need to explain default parameter lifetime

2016-04-26 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Sorry but I'm going to reject this one.  I tried out the text on a Python class 
that I'm currently teaching and the learners found the text to be clear enough 
(though some were jarred by the choice of *L* as the variable name) and they 
all got the essential points (the default variable is evaluated once and what 
they should do if you don't want the default value to be shared between 
subsequent calls).

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue26512] Vocabulary: Using "integral" in library/stdtypes.html

2016-04-26 Thread Martin Panter

Changes by Martin Panter :


Removed file: http://bugs.python.org/file42593/stdtypes-integral.v3.py3.patch

___
Python tracker 

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



[issue26512] Vocabulary: Using "integral" in library/stdtypes.html

2016-04-26 Thread Martin Panter

Changes by Martin Panter :


Added file: http://bugs.python.org/file42594/stdtypes-integral.v3.py3.patch

___
Python tracker 

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



[issue23275] Can assign [] = (), but not () = []

2016-04-26 Thread Berker Peksag

Berker Peksag added the comment:

I missed Martin's comment about the documentation. I will update my patch.

--

___
Python tracker 

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



[issue25420] "import random" blocks on entropy collection on Linux with low entropy

2016-04-26 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, the random.patch from matejcik makes me uncomfortable.  It feels like a 
hack that obscures the code, would confound linters and type checkers, and 
would create more problems than it would solve.

--
assignee: rhettinger -> 

___
Python tracker 

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



[issue26846] Workaround for non-standard stdlib.h on Android

2016-04-26 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Thanks.
Cross-compilation for android is fine now.
Tested with a run of test_decimal on android emulator.
Maybe issue #26723 can be closed now as well ?

--

___
Python tracker 

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



[issue20306] Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail

2016-04-26 Thread Xavier de Gaye

Xavier de Gaye added the comment:

With changeset 0d74d4937ab9, test_pwd fails on android API level 21 at 
test_values with:
  Traceback (most recent call last):
File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_pwd.py", line 27, 
in test_values
  self.assertIsInstance(e.pw_passwd, str)
  AssertionError: None is not an instance of 

On android API 21 HAVE_STRUCT_PASSWD_PW_PASSWD is defined but p->pw_passwd is 
set to NULL.

--
nosy: +xdegaye

___
Python tracker 

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



[issue23986] Inaccuracy about "in" keyword for list and tuple

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset aba647a34ed4 by Raymond Hettinger in branch '2.7':
Issue #23986:  Note that the in-operator for lists and tuples check identity 
before equality.
https://hg.python.org/cpython/rev/aba647a34ed4

--
nosy: +python-dev

___
Python tracker 

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



[issue16927] Separate built-in types from functions and group similar functions in functions.rst

2016-04-26 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: rhettinger -> 

___
Python tracker 

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



[issue23986] Inaccuracy about "in" keyword for list and tuple

2016-04-26 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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



[issue24715] Sorting HOW TO: bad example for reverse sort stability

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ba87f7f246e0 by Raymond Hettinger in branch '2.7':
Issue #24715: Improve sort stability example
https://hg.python.org/cpython/rev/ba87f7f246e0

--
nosy: +python-dev

___
Python tracker 

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



[issue24715] Sorting HOW TO: bad example for reverse sort stability

2016-04-26 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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



[issue24715] Sorting HOW TO: bad example for reverse sort stability

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ae1e55102449 by Raymond Hettinger in branch '3.5':
Issue #24715: Improve sort stability example
https://hg.python.org/cpython/rev/ae1e55102449

--

___
Python tracker 

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



[issue24434] ItemsView.__contains__ does not mimic dict_items

2016-04-26 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: rhettinger -> 

___
Python tracker 

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



[issue26822] itemgetter/attrgetter/methodcaller objects ignore keyword arguments

2016-04-26 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The patch looks good and is ready to apply.  The macro also is a fine idea.

--

___
Python tracker 

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



[issue26512] Vocabulary: Using "integral" in library/stdtypes.html

2016-04-26 Thread Martin Panter

Martin Panter added the comment:

Here is the Python 2 version. The difference is that floor() and ceil() return 
an “integer as a float”, and I didn’t touch the doc strings.

--
Added file: http://bugs.python.org/file42595/stdtypes-integral.v3.py2.patch

___
Python tracker 

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



[issue24296] Queue documentation note needed

2016-04-26 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue26020] set_display evaluation order doesn't match documented behaviour

2016-04-26 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
priority: normal -> high

___
Python tracker 

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



[issue25981] Intern namedtuple field names

2016-04-26 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> I think it would be better to change the compiler to always 
> intern short string literals. And patching namedtuple will 
> be not needed.

Can we close this entry?   If you do patch the compiler, a separate tracker 
item can be opened.

--
assignee: rhettinger -> serhiy.storchaka

___
Python tracker 

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



[issue20663] Introduce exception argument to iter

2016-04-26 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I really don't think this is worth it.  In my programming career, I may have 
had an occasion to use this only once every few years.

--
assignee: rhettinger -> 
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue26807] mock_open()().readline() fails at EOF

2016-04-26 Thread Yolanda

Yolanda added the comment:

I tried patching the readline_side_effect call. But i cannot trap StopIteration 
there, and i don't see any clear way to detect that the generator has reached 
its end at that level.

--

___
Python tracker 

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



[issue25981] Intern namedtuple field names

2016-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I already opened separate issue26148. Since I sure this is the correct way, I'm 
closing this issue. I'll reopen it in case of issue26148 will be rejected.

--
superseder:  -> String literals are not interned if in a tuple

___
Python tracker 

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



[issue25981] Intern namedtuple field names

2016-04-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue26723] Add an option to skip _decimal module

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

After #26846 _decimal builds on Android.

--
resolution: rejected -> fixed
superseder:  -> Workaround for non-standard stdlib.h on Android

___
Python tracker 

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



[issue26846] Workaround for non-standard stdlib.h on Android

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

> Maybe issue #26723 can be closed now as well ?

I think it was already closed, but I added a link to this issue now.

--

___
Python tracker 

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



[issue26849] android does not support versioning in SONAME

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

When python is cross-compiled for android with --enable-shared, the following 
error occurs:

# python -c "import socket"
Fatal Python error: PyThreadState_Get: no current thread

This also occurs when importing subprocess, asyncore or asyncio but not when 
importing posix (not a shared library).  This is fixed by building python 
without soname versioning, although I have no idea why a problem with the 
android loader would cause this error.
Patch attached.

Some references to the android loader and soname versioning:
https://code.google.com/p/android/issues/detail?id=55868
https://groups.google.com/forum/#!msg/android-ndk/_UhNpRJlA1k/hbryqzEgN94J

--
components: Cross-Build
files: soname_versioning.patch
keywords: patch
messages: 264241
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: android does not support versioning in SONAME
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42596/soname_versioning.patch

___
Python tracker 

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



[issue26512] Vocabulary: Using "integral" in library/stdtypes.html

2016-04-26 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue26039] More flexibility in zipfile write interface

2016-04-26 Thread Thomas Kluyver

Thomas Kluyver added the comment:

zipfile-open-w7 adds a test that Martin requested

--
Added file: http://bugs.python.org/file42597/zipfile-open-w7.patch

___
Python tracker 

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



[issue20306] Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f0f519aca558 by Stefan Krah in branch 'default':
Issue #20306:  Android is the only system that returns NULL for the pw_passwd
https://hg.python.org/cpython/rev/f0f519aca558

--

___
Python tracker 

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



[issue20306] Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

Okay, for the record: I think that returning "None" would probably be
more correct than the empty string, but I don't think users actually
care to the point that they will introduce a case split in their
applications.

Realistically, probably no one cares about pw_passwd at all.

--

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use pymalloc allocator

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 090502a0c69c by Victor Stinner in branch 'default':
Issue #25349, #26249: Fix memleak in formatfloat()
https://hg.python.org/cpython/rev/090502a0c69c

--

___
Python tracker 

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



[issue25349] Use _PyBytesWriter for bytes%args

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 090502a0c69c by Victor Stinner in branch 'default':
Issue #25349, #26249: Fix memleak in formatfloat()
https://hg.python.org/cpython/rev/090502a0c69c

--

___
Python tracker 

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



[issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux

2016-04-26 Thread Martin Panter

Martin Panter added the comment:

Thanks Pau, for some reason I didn’t pick up the dylib OS X problem last time I 
looked at that link. This is a quick summary of the library names searched on 
different platforms:

Windows: {name} and {name}.dll, via %PATH%
OS X: lib{name}.dylib, {name}.dylib and {name}.framework/{name}, via dyld_find()
BSD: lib{name}.* via ldconfig (choose highest ABI version) and cc
Solaris: lib{name}.so via crle, and lib{name}.* via cc
Gnu: lib{name}.* via ldconfig and cc

Already, these cases seem to be half emulating the run-time linker and half the 
build-time linker. I don’t have a good answer about which is “better” (it would 
depend on the use case). But since we already have a mix, maybe changing 
towards run-time would not be such a problem as I first thought.

A half-cooked idea of mine is a simpler function that just accounts for common 
library naming conventions on various platforms, but does not extract sonames 
or spawn compilers. I think this could work with what seems to be a common use 
case of passing the result directly to CDLL(), which will do the real search. 
For the Windows and OS X cases, a loop might be required to attempt CDLL() with 
the different possibilities.

But I agree this is straying from the topic of this bug report. Perhaps I 
should accept that people want to find libraries by just the build-time name, 
but that are accessible at runtime.

More related reports about find_library() vs CDLL():
Issue 19317: Search Python’s RPATH
Issue 21622: Work without DT_SONAME

--

___
Python tracker 

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



[issue26039] More flexibility in zipfile write interface

2016-04-26 Thread Thomas Kluyver

Thomas Kluyver added the comment:

zipfile-open-w8 removes the concurrent read-write check for non-seekable files. 
As Martin points out, reading currently requires seeking, and a streaming read 
API would look very different from the current API.

--
Added file: http://bugs.python.org/file42598/zipfile-open-w8.patch

___
Python tracker 

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



[issue23275] Can assign [] = (), but not () = []

2016-04-26 Thread Martin Panter

Martin Panter added the comment:

Okay I’ll let Berker update his patch, but I’m happy to try my hand at updating 
the documentation if needed.

I reviewed the current patch. I can’t say whether the ast.c change is good or 
not. But IMO the test would be better off in somewhere like 
/Lib/test/test_unpack.py. It is only a superficial relationship with tuples 
because the syntax looks the same. Also may be worth testing that [] = [] etc 
work as well.

--

___
Python tracker 

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



[issue26850] PyMem_RawMalloc(): update also sys.getallocatedblocks() in debug mode

2016-04-26 Thread STINNER Victor

New submission from STINNER Victor:

I modified PyMem_Malloc() to use the pymalloc allocator in the issue #26249. 
This change helped to find a memory leak in test_format that I introduced in 
Python 3.6:
http://bugs.python.org/issue26249#msg264174

This memory leak gave me an idea: PyMem_RawMalloc() should also update 
sys.getallocatedblocks() (number of currently allocated blocks). It would help 
to find memory leaks using "python -m test -R 3:3" in extension modules using 
PyMem_RawMalloc() (and not PyMem_Malloc() or PyObject_Malloc()).

Attached patch uses an atomic variable _Py_AllocatedBlocks, but only in debug 
mode. I chose to only change the variable in debug mode to:

* not impact performances
* I don't know if atomic variables are well supported (especially the "var++" 
operation)
* I don't know yet the impact of this change (how sys.getallocatedblocks() is 
used).

(The patch would be simpler if the release mode would also be impacted.)

The patch changes _PyObject_Alloc() and _PyObject_Free() in debug mode to only 
account allocations directly made by pymalloc, to let PyMem_RawMalloc() and 
PyMem_RawFree() update the _Py_AllocatedBlocks variable. In release mode, 
_PyObject_Alloc() and _PyObject_Free() are responsible to update the 
_Py_AllocatedBlocks variable for allocations delegated to PyMem_RawMalloc() and 
PyMem_RawFree().

--
files: pymem_rawmalloc_blocks.patch
keywords: patch
messages: 264250
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: PyMem_RawMalloc(): update also sys.getallocatedblocks() in debug mode
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42599/pymem_rawmalloc_blocks.patch

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use pymalloc allocator

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

> 68b2a43d8653 introduced memory leak.

I was very surprised to see a regression in test_format since I didn't change 
any change related to bytes, bytearray or str formatting in this issue.

In fact, it's much better than that! With PyMem_Malloc() using pymalloc, we 
benefit for free of the cheap "_Py_AllocatedBlocks" memory leak detector. I 
introduced the memory leak in the issue #25349 when I optimimzed bytes%args and 
bytearray%args using the new _PyBytesWriter API.

This memory leak gave me an idea, I opened the issue #26850: 
"PyMem_RawMalloc(): update also sys.getallocatedblocks() in debug mode".

--

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use pymalloc allocator

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

There are no more know bugs related to this change, I close the issue. Thanks 
for the test_format report Serhiy, I missed it.

--
status: open -> closed

___
Python tracker 

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



[issue16662] load_tests not invoked in package/__init__.py

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

> ImportError: No module named 'pytest'

It looks like you must install pytest dependency. If you consider that it's 
really a bug in Python, please open an issue: this issue is now closed.

--

___
Python tracker 

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



[issue25823] Speed-up oparg decoding on little-endian machines

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

I dislike the usage of union to use fetch 16-bit but only in little endian. I 
would prefer to modify the PyCodeObject to ensure that co_code is aligned to 
16-bit and use an uint16_t* pointer in ceval.c. It would be simpler no? In the 
worst case, we should overallocate 1 null byte in PyCodeObject to align 
bytecode to 16-bit.

--

___
Python tracker 

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



[issue25823] Speed-up oparg decoding on little-endian machines

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

"I there are no objections I'm inclined to push the patch in hope that this 
will make the Wordcode patch (issue26647) simpler and more efficient (yes, this 
will add more work for Demur for synchronization)."

I would prefer to be kind with Demur and wait until his patch is merged (to not 
introduce conflicts). Wordcode change is quite big, whereas this one is short. 
Raymond already approved his patch on the python-dev mailing list, I waiting 
for the feedback of Yury and Serhiy until Sunday to push the wordcode change.

IMHO it will be simpler to optimize the (oparg, opvalue) fetch in ceval.c after 
wordcode will be merged.

What do you think?

--

___
Python tracker 

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



[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

@Serhiy and Yury: I'm waiting for your review on this change. I would like to 
push the wordcode change, I propose to push it sunday. Tell me if you need more 
time to review it.

--

___
Python tracker 

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



[issue26839] python always calls getrandom() at start, causing long hang after boot

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

See also the issue #25420 which is similar but specific to "import random".

--

___
Python tracker 

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



[issue25420] "import random" blocks on entropy collection on Linux with low entropy

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

The issue is more general than just "import random", Python reads entropy at 
startup to initialize a random seed for its randomized hash function: see the 
issue #26839.

--

___
Python tracker 

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



[issue20598] argparse docs: '7'.split() is confusing magic

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 44f888e47ab0 by Martin Panter in branch '2.7':
Issue #20598: Replace trivial split() calls with lists in argparse docs
https://hg.python.org/cpython/rev/44f888e47ab0

New changeset 49561532504c by Martin Panter in branch '3.5':
Issue #20598: Replace trivial split() calls with lists in argparse docs
https://hg.python.org/cpython/rev/49561532504c

New changeset 14cb17682831 by Martin Panter in branch 'default':
Issue #20598: Merge argparse docs from 3.5
https://hg.python.org/cpython/rev/14cb17682831

--
nosy: +python-dev

___
Python tracker 

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



[issue25420] "import random" blocks on entropy collection on Linux with low entropy

2016-04-26 Thread jan matejek

jan matejek added the comment:

unlike #26839, however, there is no workaround for "import random".
so i maintain that this issue is in fact very specific to the random module

--

___
Python tracker 

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch that deprecates empty non-str and non-decodable arguments for 
urlparse, urlsplit, urlunparse, urlunsplit, urldefrag, and parse_qsl.

--
Added file: 
http://bugs.python.org/file42600/urlparse_empty_bad_arg_deprecation.patch

___
Python tracker 

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



[issue25420] "import random" blocks on entropy collection on Linux with low entropy

2016-04-26 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

I still believe the underlying system API use should be fixed rather than all 
the different instances where it gets used.

getrandom() should not block. If it does on a platform, that's a bug on that 
platform and Python should revert to the alternative of using /dev/urandom 
directly (or whatever other source of randomness is available).

Disabling hash randomization is not a good workaround for the issue, since it 
will definitely pop up in other areas as well.

--

___
Python tracker 

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



[issue25823] Speed-up oparg decoding on little-endian machines

2016-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I agree that implementing fast fetch 16-bit is simpler with wordcodes.

--
dependencies: +ceval: use Wordcode, 16-bit bytecode

___
Python tracker 

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



[issue25420] "import random" blocks on entropy collection on Linux with low entropy

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

> so i maintain that this issue is in fact very specific to the random module

I think that you misunderstood the issue. I'm now closing it as a duplicate of 
the issue #26839.

--

Marc-Andre Lemburg: Please continue the discussion on the issue #26839. I 
copied your latest message.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> python always calls getrandom() at start, causing long hang 
after boot

___
Python tracker 

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



[issue26839] python always calls getrandom() at start, causing long hang after boot

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

The issue #25420 has been closed as a duplicate of this issue.

Copy of the latest message:

msg264262 - (view)  Author: Marc-Andre Lemburg (lemburg) * (Python 
committer)   Date: 2016-04-26 12:05

I still believe the underlying system API use should be fixed rather than all 
the different instances where it gets used.

getrandom() should not block. If it does on a platform, that's a bug on that 
platform and Python should revert to the alternative of using /dev/urandom 
directly (or whatever other source of randomness is available).

Disabling hash randomization is not a good workaround for the issue, since it 
will definitely pop up in other areas as well.

--

___
Python tracker 

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



[issue26839] python always calls getrandom() at start, causing long hang after boot

2016-04-26 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +lemburg, matejcik, mmarkk, rhettinger, thomas-petazzoni

___
Python tracker 

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



[issue26851] android compilation and link flags

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

The attached patch:

  * Sets the recommended android compilation flags, see: 
http://developer.android.com/ndk/guides/standalone_toolchain.html#abi.  Note 
that the android toolchains already set the -fpic flag, as shown with:

arm-linux-androideabi-gcc -v -S main.c 2>&1 | grep main.c

  * Sets the Position independent executables (PIE) flag which is mandatory 
starting at API level 21 and supported starting with API level 16.

--
components: Cross-Build
files: build-flags.patch
keywords: patch
messages: 264266
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: android compilation and link flags
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42601/build-flags.patch

___
Python tracker 

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



[issue26839] python always calls getrandom() at start, causing long hang after boot

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

Hmm. Why does os.urandom(), which should explicitly not block, use a blocking 
getrandom() function?

This is quite unexpected on Linux.

--
nosy: +skrah

___
Python tracker 

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



[issue26850] PyMem_RawMalloc(): update also sys.getallocatedblocks() in debug mode

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

The expected side effect of this change is that hunting memory leaks in 
regrtest (python -m test) may get more noise.

I ran the Python test suite using "./python -m test -R 3:3": test_nntplib, 
test_tools and test_unittest failed.

Run alone, test_tools still fails:
-
$ ./python -m test -R 3:3 test_tools
0:00:00 [1/1] test_tools
beginning 6 repetitions
123456
..
test_tools leaked [0, 5, 20] references, sum=25
test_tools leaked [0, 1, 4] memory blocks, sum=5
test_tools took 44 sec
1 test failed:
test_tools
Total duration: 0:00:45
-

But if I run test_tools one more time, it doesn't fail anymore...

Example of two sequential runs using two processes:
-
$ ./python -m test -R 3:3 test_tools
Run tests sequentially
0:00:00 [1/1] test_tools
beginning 6 repetitions
123456
..
test_tools took 44 sec
1 test OK.
Total duration: 0:00:44

$ ./python -m test -R 3:3 test_tools
Run tests sequentially
0:00:00 [1/1] test_tools
beginning 6 repetitions
123456
..
test_tools leaked [2, 0, 10] references, sum=12
test_tools leaked [0, 0, 3] memory blocks, sum=3
test_tools took 43 sec
1 test failed:
test_tools
Total duration: 0:00:44
-

test_nntplib doesn't fail anymore when run alone.

Oh, and test_unittest failure doesn't seem related to my change: "./python -m 
test -R 3:3 test_unittest" already fails without my change.

--

___
Python tracker 

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And here is simpler patch that just disallows bad arguments without deprecation.

--
Added file: 
http://bugs.python.org/file42602/urlparse_empty_bad_arg_disallow.patch

___
Python tracker 

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



[issue26839] python always calls getrandom() at start, causing long hang after boot

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

Wow, it's by design:

" os.urandom(n)

Return a string of n random bytes suitable for cryptographic use."


``man urandom'':

"A read from the /dev/urandom device will not block waiting for more entropy.  
As a result,  if  there  is
   not sufficient entropy in the entropy pool, the returned values are 
theoretically vulnerable to a crypto-
   graphic attack on the algorithms used by the driver."

--

___
Python tracker 

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



[issue26839] python always calls getrandom() at start, causing long hang after boot

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

"Hmm. Why does os.urandom(), which should explicitly not block, use a blocking 
getrandom() function? This is quite unexpected on Linux."

I modified os.getrandom() in the issue #22181 to use the new getrandom() 
syscall of Linux 3.17. The syscall blocks until the Linux kernel entropy pool 
is *initialized* with enough entropy. In a healthy system, it must never occur.

To be clear: you get read 10 MB (or 1 GB or more) of random data using 
os.urandom() even if the entropy pool is empty. You can test:

* In a terminal 1, run "dd if=/dev/random of=random" to ensure that the entropy 
pool is empty
* In a terminal 2, run "while true; do cat 
/proc/sys/kernel/random/entropy_avail; sleep 1; done" to see that entropy pool 
is empty (or very low, like less 100 bytes)
* In a terminal 3, get a lot of random data using os.urandom(): ./python -c 
'import os; x=os.urandom(1024*1024*10)'

=> it works, you *can* get 10 MB of random data even if the kernel entropy pool 
is empty.

Reminder: getrandom() is used to avoid a file descriptor which caused various 
issues (see issue #22181 for more information).

Ok, now this issue. The lack of entropy is a known problem in virtual machine. 
It's common that SSH, HTTPS, or other operations block because because of the 
lack of entropy. On bare metal, the Linux entropy pool is feeded by physical 
events like interruptions, keyboard strokes, mouse moves, etc. On a virtual 
machine, there is *no* source of entropy.

The problem is not only known but also solved, at least for qemu: you must 
attach a virtio-rng device to your virtual machine. See for example 
https://fedoraproject.org/wiki/Features/Virtio_RNG The VM can now reads fresh 
and good quality entropy from the host.

To come back to Python: getrandom() syscall only blocks until the entropy pool 
is *initialized* with enough entropy.

The getrandom() syscall has a GRND_NONBLOCK to fail with EAGAIN if reading from 
/dev/random (not /dev/urandom) would block because the entropy pool has not 
enough entropy:
http://man7.org/linux/man-pages/man2/getrandom.2.html

IMHO it's a deliberate choice to block in getrandom() when reading /dev/urandom 
while the entropy pool is not initialized with enough entropy yet.

Ok, now the question is: should python do nothing to support VM badly 
configured (with no real source of entropy)?

It looks like the obvious change is to not use getrandom() but revert code to 
use a file descriptor and read from /dev/urandom. We will get bad entropy, but 
Python will be able to start.

I am not excited by this idea. The os.urandom() private file descriptor caused 
other kinds of issues and bad quality entropy is also an issue.

--

___
Python tracker 

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



[issue26839] Python 3.5 running in a virtual machine blocks at startup or on importing the random module

2016-04-26 Thread STINNER Victor

Changes by STINNER Victor :


--
title: python always calls getrandom() at start, causing long hang after boot 
-> Python 3.5 running in a virtual machine blocks at startup or on importing 
the random module

___
Python tracker 

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



[issue26839] Python 3.5 running in a virtual machine with Linux kernel 3.17+ can block at startup or on importing the random module

2016-04-26 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Python 3.5 running in a virtual machine blocks at startup or on 
importing the random module -> Python 3.5 running in a virtual machine with 
Linux kernel 3.17+ can block at startup or on importing the random module

___
Python tracker 

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



[issue26839] Python 3.5 running in a virtual machine with Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-04-26 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Python 3.5 running in a virtual machine with Linux kernel 3.17+ can 
block at startup or on importing the random module -> Python 3.5 running in a 
virtual machine with Linux kernel 3.17+ can block at startup or on importing 
the random module on getrandom()

___
Python tracker 

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



[issue26852] add a COMPILEALL_FLAGS Makefile variable

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

Add a COMPILEALL_FLAGS Makefile variable to allow setting this flag to have 
legacy locations for byte-code files and save space on mobile devices.

Patch attached.
The '-E' python command line option added to $(PYTHON_FOR_BUILD) in the patch 
is fixing a problem that should actually be entered in another issue.  When 
cross-compiling, the PYTHON_FOR_BUILD command sets PYTHONPATH to the location 
of the cross-compiled shared libraries of the extension modules.  So the 
compilation of modules that import extension modules fail without '-E'.

--
components: Cross-Build
files: compileall-flags.patch
keywords: patch
messages: 264272
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: add a COMPILEALL_FLAGS Makefile variable
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42603/compileall-flags.patch

___
Python tracker 

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



[issue20598] argparse docs: '7'.split() is confusing magic

2016-04-26 Thread Martin Panter

Martin Panter added the comment:

I committed my simpler patch. I hope that is okay :)

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-26 Thread Anish Shah

Changes by Anish Shah :


--
nosy:  -anish.shah

___
Python tracker 

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



[issue26853] missing symbols in curses and readline modules on android

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

The android loader complains when shared libraries are not linked against their 
needed libraries (see also issue #21668).  When ncurses is cross-compiled as a 
shared library, the curses and readline modules must be linked with 
libtinfow.so.

The attached patch is a quick hack: setup.py spawns readelf to get the list of 
needed libraries, but this fails as the readelf path name is wrong (it is not 
the absolute path) and so cannot be used as is for a correct patch.

--
components: Cross-Build
files: curses_readline.patch
keywords: patch
messages: 264274
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: missing symbols in curses and readline modules on android
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42604/curses_readline.patch

___
Python tracker 

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



[issue26847] filter docs unclear wording

2016-04-26 Thread Luke

Luke added the comment:

For shame! ... I deserved that callout. :S

My examples should have included the cast to bool, which is indeed not the same 
as the values' being "equal to False" in themselves...

I didn't realize that "is false" was conventional shorthand for that cast and 
comparison. Thanks!

--

___
Python tracker 

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



[issue26854] missing header on android for the ossaudiodev module

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

On linux /usr/include/sys/soundcard.h includes /usr/include/linux/soundcard.h 
while on android (also a linux) there is only /usr/include/linux/soundcard.h

Patch attached.

--
components: Cross-Build
files: ossaudiodev.patch
keywords: patch
messages: 264276
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: missing header on android for the ossaudiodev module
type: compile error
versions: Python 3.6
Added file: http://bugs.python.org/file42605/ossaudiodev.patch

___
Python tracker 

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



[issue26855] add platform.android_ver() for android

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

The attached patch misses a test case.

Also how can we be sure that the '/system/build.prop' file may be guaranteed to 
exist on all android devices ?
It is difficult to get a reliable information on the android infrastructure 
when the information does not relate to the java libraries.

--
components: Cross-Build
files: platform.patch
keywords: patch
messages: 264277
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: add platform.android_ver() for android
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42606/platform.patch

___
Python tracker 

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch addresses Martin's comment.

--
Added file: 
http://bugs.python.org/file42607/urlparse_empty_bad_arg_deprecation2.patch

___
Python tracker 

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




[issue26856] android does not have pwd.getpwall()

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

User ids on android are the ids of the applications and they are used to 
enforce the applications access rights.  See the 'User IDs and File Access' 
section at http://developer.android.com/guide/topics/security/permissions.html.

Most integers are existing user ids on android. This may explain why getpwall() 
is missing.
Patch attached.

--
components: Library (Lib)
files: pwd.patch
keywords: patch
messages: 264279
nosy: xdegaye
priority: normal
severity: normal
status: open
title: android does not have pwd.getpwall()
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42608/pwd.patch

___
Python tracker 

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



[issue26857] gethostbyname_r() is broken on android

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

HAVE_GETHOSTBYNAME_R is defined on android API 21, but importing the _socket 
module fails with:

ImportError: dlopen failed: cannot locate symbol "gethostbyaddr_r" 
referenced by "_socket.cpython-36m-i386-linux-gnu.so"

Patch attached.
The patch does not take into account the fact that this may be fixed in future 
versions of android.

--
components: Cross-Build
files: socketmodule.patch
keywords: patch
messages: 264280
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: gethostbyname_r() is broken on android
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42609/socketmodule.patch

___
Python tracker 

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



[issue26858] setting SO_REUSEPORT fails on android

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

Android defines SO_REUSEPORT on android API 21 but setting this option in the 
asyncio tests raises OSError: [Errno 92] Protocol not available.

The attached patch assumes there is a platform.android_ver() function to detect 
that this is the android platform.  The patch does not take into account the 
fact that this may be fixed in future versions of android.

--
components: Cross-Build
files: test.asyncio.patch
keywords: patch
messages: 264281
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: setting SO_REUSEPORT fails on android
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42610/test.asyncio.patch

___
Python tracker 

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



[issue20598] argparse docs: '7'.split() is confusing magic

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

Thanks. The doc looks better like that.

--

___
Python tracker 

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



[issue26859] unittest fails with "Start directory is not importable"

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

unittest fails to load tests when the tests are in a package that has an 
__init__.pyc file and no __init__.py file.

Patch attached.

--
components: Library (Lib)
files: unittest.patch
keywords: patch
messages: 264283
nosy: xdegaye
priority: normal
severity: normal
status: open
title: unittest fails with "Start directory is not importable"
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42611/unittest.patch

___
Python tracker 

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



[issue26839] Python 3.5 running in a virtual machine with Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

It is clear how /dev/urandom works. I just think that securing enough
entropy on startup should be done by the init scripts (if systemd still
allows that :) and not by an application.

[Unless the application is gpg or similar.]

--

___
Python tracker 

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



[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-26 Thread Aviv Palivoda

New submission from Aviv Palivoda:

I am suggesting that os.walk and os.fwalk will yield a namedtuple instead of 
the regular tuple they currently yield.
The use case for this change can be seen in the next example:

def walk_wrapper(walk_it):
for dir_entry in walk_it:
if dir_entry[0] == "aaa":
   yield dir_entry

Because walk_it can be either os.walk or os.fwalk I need to access dir_entry 
via index.

My change will allow me to change this function to:

def walk_wrapper(walk_it):
for dir_entry in walk_it:
if dir_entry.dirpath == "aaa":
   yield dir_entry

Witch is more clear and readable.

--
components: Library (Lib)
files: os-walk-result-namedtuple.patch
keywords: patch
messages: 264285
nosy: loewis, palaviv
priority: normal
severity: normal
status: open
title: os.walk and os.fwalk yield namedtuple instead of tuple
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42612/os-walk-result-namedtuple.patch

___
Python tracker 

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



[issue26861] shutil.copyfile() doesn't close the opened files

2016-04-26 Thread Vukasin Felbab

New submission from Vukasin Felbab:

shutil.copyfile() doesn't close the opened files, so it is vulnerable to IO 
Error 24: too many files open

actually, the src and dst files should be closed after copy

--
components: IO
messages: 264286
nosy: vocdetnojz
priority: normal
severity: normal
status: open
title: shutil.copyfile() doesn't close the opened files
type: behavior
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



[issue26862] SYS_getdents64 does not need to be defined on android API 21

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

Revert the changeset commited at issue #20307 as the compilation does not fail 
anymore on android API level 21.

Patch attached.

--
components: Cross-Build
files: posixmodule.patch
keywords: patch
messages: 264287
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: SYS_getdents64 does not need to be defined on android API 21
type: compile error
versions: Python 3.6
Added file: http://bugs.python.org/file42613/posixmodule.patch

___
Python tracker 

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



[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-26 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-26 Thread Ethan Furman

Ethan Furman added the comment:

Quick review of patch looks good.  I'll try to look it over more closely later.

--

___
Python tracker 

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



[issue20598] argparse docs: '7'.split() is confusing magic

2016-04-26 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: patch review -> resolved

___
Python tracker 

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



[issue26862] SYS_getdents64 does not need to be defined on android API 21

2016-04-26 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue26839] Python 3.5 running in a virtual machine with Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-04-26 Thread STINNER Victor

STINNER Victor added the comment:

Since many years, Linux systems store entropy on disk to quickly feed the
entropy pool at startup.

It doesn't create magically entropy on VM where you start with zero entropy
at the first boot.

--

___
Python tracker 

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



[issue26863] android lacks some declarations for the posix module

2016-04-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

'AT_EACCESS' is not declared although HAVE_FACCESSAT is defined
'I_PUSH' is not declared

Patch attached.
The patch does not take into account the fact that this may be fixed in future 
versions of android.

--
components: Cross-Build
files: posixmodule.patch
keywords: patch
messages: 264291
nosy: Alex.Willmer, xdegaye
priority: normal
severity: normal
status: open
title: android lacks some declarations for the posix module
type: compile error
versions: Python 3.6
Added file: http://bugs.python.org/file42614/posixmodule.patch

___
Python tracker 

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



[issue26857] gethostbyname_r() is broken on android

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eb19ad1918cd by Stefan Krah in branch 'default':
Issue #26857: Workaround for missing symbol "gethostbyaddr_r" on Android.
https://hg.python.org/cpython/rev/eb19ad1918cd

--
nosy: +python-dev

___
Python tracker 

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



[issue26839] Python 3.5 running in a virtual machine with Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

I did not claim that it magically creates entropy. -- Many VMs are throwaway 
test beds. It would be annoying to setup some entropy
gathering mechanism just so that Python starts.

--

___
Python tracker 

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



[issue26863] android lacks some declarations for the posix module

2016-04-26 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Fixing a comment in previous patch.

--
Added file: http://bugs.python.org/file42615/posixmodule.patch

___
Python tracker 

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



[issue26861] shutil.copyfile() doesn't close the opened files

2016-04-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you provide an example?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26846] Workaround for non-standard stdlib.h on Android

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 287996ff241f by Stefan Krah in branch 'default':
Issue #26846: Post commit cleanup.
https://hg.python.org/cpython/rev/287996ff241f

--

___
Python tracker 

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



[issue26857] gethostbyname_r() is broken on android

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

Thanks, fixed.

--
assignee:  -> skrah
nosy: +skrah
resolution:  -> fixed
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



[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Daniel Morrison

New submission from Daniel Morrison:

The no_proxy environment variable works in python as a case
sensitive suffix check.

Curl handles this variable as a case insensitive hostname check.

Case sensitivity appears to be in conflict with the DNS Case
Insensitivity RFC (https://tools.ietf.org/html/rfc4343).

While the suffix check is documented
(https://docs.python.org/3/library/urllib.request.html), this
seems to be problematic and inconsistent with other tools on the
system.

I believe the ideal solution would be to have proxy_bypass be a
method of ProxyHandler so that it can be overridden without
dependence on undocumented methods. This would also allow
for the requested behavior to be added without breaking backwards
compatibility.

--
components: Library (Lib)
messages: 264297
nosy: Daniel Morrison
priority: normal
severity: normal
status: open
title: urllib.request no_proxy check differs from curl
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue26854] missing header on android for the ossaudiodev module

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d943e6f7c9f3 by Stefan Krah in branch 'default':
Issue #26854: Android has a different include path for soundcard.h.
https://hg.python.org/cpython/rev/d943e6f7c9f3

--
nosy: +python-dev

___
Python tracker 

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



[issue26854] missing header on android for the ossaudiodev module

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

Thanks!

--
assignee:  -> skrah
nosy: +skrah
resolution:  -> fixed
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



[issue26863] android lacks some declarations for the posix module

2016-04-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f4c6dab59cd8 by Stefan Krah in branch 'default':
Issue #26863: HAVE_FACCESSAT should (currently) not be defined on Android.
https://hg.python.org/cpython/rev/f4c6dab59cd8

--
nosy: +python-dev

___
Python tracker 

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



[issue26863] android lacks some declarations for the posix module

2016-04-26 Thread Stefan Krah

Stefan Krah added the comment:

Thanks again!

--
assignee:  -> skrah
nosy: +skrah
resolution:  -> fixed
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



[issue26839] Python 3.5 running in a virtual machine with Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-04-26 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

As mentioned on the other issue #25420, this is a regression and a change in 
documented behavior of os.urandom(), which is expected to be non-blocking, 
regardless of whether entropy is available or not.

The fix should be easy (from reading the man page 
http://man7.org/linux/man-pages/man2/getrandom.2.html): set the GRND_NONBLOCK 
flag on getrandom(); then, if the function returns -1 and sets EAGAIN, fallback 
to reading from /dev/urandom directly.

--

___
Python tracker 

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



  1   2   >