[issue23703] urljoin() with no directory segments duplicates filename

2015-03-19 Thread Martin Panter

New submission from Martin Panter:

This is a regression caused by revision 901e4e52b20a. Before (e.g. Python 3.4):

>>> urljoin('a', 'b')
'b'

After:

>>> urljoin('a', 'b')
'b/b'

This was identified in  but is 
actually caused by the revision committed for Issue 22278.

--
components: Library (Lib)
messages: 238493
nosy: demian.brecht, vadmium
priority: normal
severity: normal
status: open
title: urljoin() with no directory segments duplicates filename
type: behavior
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



[issue23704] Make deques a full MutableSequence by adding index(), insert(), and copy()

2015-03-19 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
components: Library (Lib)
files: deque_insert_index_copy3.diff
keywords: patch
nosy: rhettinger
priority: normal
severity: normal
stage: patch review
status: open
title: Make deques a full MutableSequence by adding index(), insert(), and 
copy()
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file38552/deque_insert_index_copy3.diff

___
Python tracker 

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



[issue22278] urljoin duplicate slashes

2015-03-19 Thread Martin Panter

Martin Panter added the comment:

I opened Issue 23703 for a regression caused by this commit.

--
nosy: +vadmium

___
Python tracker 

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



[issue23325] Turn SIG_DFL and SIG_IGN into functions

2015-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Currently the action parameter of signal.signal() can be SIG_DFL, SIG_IGN, or a 
callable Python object. Would be just a callable Python object. This is simpler.

The main benefit is that they will be better look in pydoc output.

--

___
Python tracker 

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



[issue18828] urljoin behaves differently with custom and standard schemas

2015-03-19 Thread Martin Panter

Martin Panter added the comment:

I opened Issue 23703 about the funny doubled bar.com result. After backing out 
revision 901e4e52b20a, but with my patch here applied:

>>> urljoin('mailto:foo@', 'bar.com')
'mailto:bar.com'

which seems fairly sensible to me. A more awkward question is if this behaviour 
of my patch is reasonable:

>>> urljoin('mailto:person-foo/b...@example.net', 'bar.com')
'mailto:person-foo/bar.com'

Yet another option, similar to my “any_scheme=True” flag, might be to change 
from the “uses_relative” white-list to a “not_relative” black-list of URL 
schemes, so that urljoin() works for arbitrary schemes except for ones like 
“mailto:” that are in the hard-coded list.

--

___
Python tracker 

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



[issue23705] Speed-up deque.__contains__

2015-03-19 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Help deques match the performance of lists for a __contains__ check.  
Comparative timings are attached.

--
assignee: rhettinger
components: Library (Lib)
files: deque_contains0.diff
keywords: patch
messages: 238496
nosy: rhettinger
priority: normal
severity: normal
stage: patch review
status: open
title: Speed-up deque.__contains__
type: performance
versions: Python 3.5
Added file: http://bugs.python.org/file38553/deque_contains0.diff

___
Python tracker 

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



[issue23705] Speed-up deque.__contains__

2015-03-19 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Added file: http://bugs.python.org/file38554/deque_contains_timings.txt

___
Python tracker 

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



[issue20204] pydocs fails for some C implemented classes

2015-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue23704] Make deques a full MutableSequence by adding index(), insert(), and copy()

2015-03-19 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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-19 Thread Wolfgang Maier

Changes by Wolfgang Maier :


--
nosy: +wolma

___
Python tracker 

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



[issue23703] urljoin() with no directory segments duplicates filename

2015-03-19 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +orsenthil

___
Python tracker 

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



[issue8027] distutils fail to determine c++ linker with unixcompiler if using ccache

2015-03-19 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



[issue23706] pathlib.Path.write_text should include a newline argument

2015-03-19 Thread Ugra Dániel

New submission from Ugra Dániel:

The new pathlib.Path [read|write]_[binary|text] methods will be very useful, 
one thing I miss badly is the newline argument for write_text.

In some cases text files need a specific line ending (independent from the 
platform the code is being executed on.) In my mind this is analogous to 
passing an explicit encoding argument.

Of course, one can always use built-in open for this scenario. It would be a 
nice addition anyway :)

--
components: Library (Lib)
messages: 238498
nosy: daniel.ugra
priority: normal
severity: normal
status: open
title: pathlib.Path.write_text should include a newline argument
type: enhancement
versions: Python 3.5

___
Python tracker 

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



[issue23419] Faster default __reduce__ for classes without __init__

2015-03-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

But isn't the result different?
NEWOBJ calls cls.__new__() and __init__ is skipped.
REDUCE calls cls(): both __new__ and __init__ are used.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue23419] Faster default __reduce__ for classes without __init__

2015-03-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Sorry, I missed the important point:
"for classes without __init__"

--

___
Python tracker 

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



[issue23681] Have -b warn when directly comparing ints and bytes

2015-03-19 Thread Paul Moore

Paul Moore added the comment:

LGTM, just one minor comment in review.

--
nosy: +paul.moore

___
Python tracker 

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



[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall

2015-03-19 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
stage: needs patch -> resolved

___
Python tracker 

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



[issue23001] Accept mutable bytes-like objects

2015-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added versionchanged directives and fixed other documentation.

--
Added file: http://bugs.python.org/file38555/accept_mutable_buffers_2.patch

___
Python tracker 

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



[issue4395] Document auto __ne__ generation; provide a use case for non-trivial __ne__

2015-03-19 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue23707] PEP 475: os.urandom() doesn't handle EINTR correctly

2015-03-19 Thread STINNER Victor

New submission from STINNER Victor:

dev_urandom_python() retries read() if it fails with EINTR, but Python signal 
handlers are not called: PyErr_CheckSignals() is not called. It's important be 
able to interrupt a function by a signal, especially if it's blocking.

We need maybe a new _Py_read() function which would retry on EINTR. The code 
can be based on posix_read(). For open(), there is already _Py_open() which 
retries on EINTR (since the changeset ed25e945cdc2, issue #23694). It can be 
useful for FileIO.read().

dev_urandom_noraise() retries on EINTR without calling PyErr_CheckSignals(). It 
may be acceptable since this function is only called by _PyRandom_Init() at an 
early stage of Python initialization. Or maybe EINTR should call 
Py_FatalError()?

On Linux 3.18 (Fedora 21 with kernel 3.18.7-200.fc21.x86_64), reading 1 GB from 
/dev/urandom or getrandom() returns 0x1ff bytes (32 MB). It's not an issue, 
os.urandom() continues to read until it gets enough data.

I tried to interrupt os.urandom() on Python 3.4 (read) and Python 3.5 
(getrandom): reading from /dev/urandom using a file descriptor or getrandom() 
have the same behaviour, none fail with EINTR. I checked syscalls using strace.

It looks like getrandom() only fails with EINTR when flags=GRND_RANDOM. So this 
issue is maybe more theoric.

--
messages: 238503
nosy: haypo
priority: normal
severity: normal
status: open
title: PEP 475: os.urandom() doesn't handle EINTR correctly
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



[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall

2015-03-19 Thread STINNER Victor

STINNER Victor added the comment:

Oh, test_os now fails on Linux because os.urandom() doesn't use a file 
descriptor anymore. The test should be skipped when getrandom() is used. The 
test is already skipped when getentropy() is used.

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

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-19 Thread Bohuslav "Slavek" Kabrda

Bohuslav "Slavek" Kabrda added the comment:

I'm attaching second version of the patch. It now contains link to this bug and 
a more real test case according to suggestion from the review.

One of the reviews of first patch version mentioned that there should be a 
better explanation of how this issue can be provoked. I think that the test 
shows it nice and there's no need to explain it in greater detail. Also, the 
comment references this bug, where anyone can find the explanation. (Fix for 
#18879 fixes pretty much the same in a different method and has very similar 
comment, so I think this should be fine.)

--
Added file: http://bugs.python.org/file38556/python-3.4-tempfile-iter-v2.patch

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
assignee:  -> serhiy.storchaka
stage: patch review -> commit review

___
Python tracker 

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



[issue23042] ctypes module doesn't build on FreeBSD x86

2015-03-19 Thread Davin Potts

Davin Potts added the comment:

Reading issue22634 suggests that perhaps this issue is not limited to FreeBSD 
-- issue22634 appears to suffer the same behavior on RHEL 6.4 and 5.5 when 
compiling to 32-bit (the -m32 compiler flag is being used there).

--

___
Python tracker 

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



[issue22634] importing _ctypes failed: undefined symbol: ffi_call_win32

2015-03-19 Thread Davin Potts

Davin Potts added the comment:

Comparing this to issue23042, this same behavior appears on i386 releases of 
FreeBSD 8.3 and 10.1 (the i386-RELEASE means it's 32-bit as opposed to 64-bit 
build).  Given that this issue is being triggered here with -m32 (triggers 
building of 32-bit binaries) and yet we don't appear to be having this issue on 
64-bit builds, that could be a useful clue.

--
nosy: +davin

___
Python tracker 

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



[issue22634] importing _ctypes failed: undefined symbol: ffi_call_win32

2015-03-19 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

This is likely also related to issue23042.

The precompiler #ifdefs were mixed up, causing Win32 code to be compiled in on 
other platforms as well.

--
nosy: +lemburg

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-19 Thread Paul Moore

Paul Moore added the comment:

Agreed, the test is sufficient documentation. However, I can't make the test 
fail here (Windows 7, Python 3.4.3):

>py ti.py
b'spam\n' b'spam\n'
b'eggs\n' b'eggs\n'
b'beans\n' b'beans\n'
>cat ti.py
import tempfile

def test_iter():
# getting iterator from a temporary file should keep it alive
# as long as it's being iterated over
lines = [b'spam\n', b'eggs\n', b'beans\n']
def make_file():
f = tempfile.NamedTemporaryFile(mode='w+b')
f.write(b''.join(lines))
f.seek(0)
return iter(f)
for i, l in enumerate(make_file()):
print(l, lines[i])

test_iter()

Is it somehow OS-specific?

Regardless, the patch seems fine and I have no problem with it being applied.

--
nosy: +paul.moore

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7fa741fe9425 by Serhiy Storchaka in branch '3.4':
Issue #23700: Iterator of NamedTemporaryFile now keeps a reference to
https://hg.python.org/cpython/rev/7fa741fe9425

New changeset c84a0b35999a by Serhiy Storchaka in branch 'default':
Issue #23700: Iterator of NamedTemporaryFile now keeps a reference to
https://hg.python.org/cpython/rev/c84a0b35999a

--
nosy: +python-dev

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your contribution Bohuslav.

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-19 Thread Bohuslav "Slavek" Kabrda

Bohuslav "Slavek" Kabrda added the comment:

Thank you!
To answer Paul's question: I honestly have no idea why this can't be reproduced 
on Windows. I managed to reproduce this in 100 % cases on various RPM-flavour 
Linux distros (Fedora, CentOS, RHEL) as well as on Debian and Ubuntu.

--

___
Python tracker 

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



[issue23708] PEP 475: Add _Py_read() and _Py_write() functions

2015-03-19 Thread STINNER Victor

New submission from STINNER Victor:

To factorize code handling EINTR, I propose add 2 new functions to fileutils.h: 
_Py_read() and _Py_write().

Attached patch adds these functions and use them in the os and _io modules.

The code of the functions is based on the code from the os and _io modules. The 
main change is that the functions now truncate code if greater than 
PY_SSIZE_T_MAX. Other changes are just refactoring.

--
files: py_read_write.patch
keywords: patch
messages: 238514
nosy: haypo
priority: normal
severity: normal
status: open
title: PEP 475: Add _Py_read() and _Py_write() functions
versions: Python 3.5
Added file: http://bugs.python.org/file38557/py_read_write.patch

___
Python tracker 

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



[issue23708] PEP 475: Add _Py_read() and _Py_write() functions

2015-03-19 Thread STINNER Victor

STINNER Victor added the comment:

select_write.patch: use _Py_write() in the select module.

--
Added file: http://bugs.python.org/file38558/select_write.patch

___
Python tracker 

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



[issue23709] Refactor ossaudiodev: use _Py_read and _Py_write with the Py_buffer

2015-03-19 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch enhances ossaudiodev to support buffer larger than 2 GB (replace 
the C int type with C Py_ssize_t). It uses the new _Py_read() and _Py_write() 
functions added in the issue #23708 with the Py_buffer API.

By the way, I don't understand the purpose of the input and output counters 
(icount and ocount fields of the oss_audio_t structure), they don't look to be 
used?!

--
files: ossaudiodev.patch
keywords: patch
messages: 238516
nosy: haypo
priority: normal
severity: normal
status: open
title: Refactor ossaudiodev: use _Py_read and _Py_write with the Py_buffer
versions: Python 3.5
Added file: http://bugs.python.org/file38559/ossaudiodev.patch

___
Python tracker 

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



[issue23709] Refactor ossaudiodev: use _Py_read and _Py_write with the Py_buffer

2015-03-19 Thread STINNER Victor

Changes by STINNER Victor :


--
dependencies: +PEP 475: Add _Py_read() and _Py_write() functions

___
Python tracker 

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



[issue23708] PEP 475: Add _Py_read() and _Py_write() functions

2015-03-19 Thread STINNER Victor

STINNER Victor added the comment:

I created the issue #23709 for the ossaudiodev module: "Refactor ossaudiodev: 
use _Py_read and _Py_write with the Py_buffer".

--

___
Python tracker 

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



[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

2015-03-19 Thread Paul Moore

Paul Moore added the comment:

Cool, no problem.

--

___
Python tracker 

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



[issue23707] PEP 475: os.urandom() doesn't handle EINTR correctly

2015-03-19 Thread STINNER Victor

STINNER Victor added the comment:

random.patch: fix the issue with the new _Py_read() function added by the issue 
#23708.

--
dependencies: +PEP 475: Add _Py_read() and _Py_write() functions
keywords: +patch
Added file: http://bugs.python.org/file38560/random.patch

___
Python tracker 

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



[issue23709] Refactor ossaudiodev: use _Py_read and _Py_write with the Py_buffer

2015-03-19 Thread STINNER Victor

STINNER Victor added the comment:

Oh, I forgot to mention the advantage of using _Py_read() and _Py_write(): they 
retry read/write when interrupted by a signal, to support the PEP 475.

--

___
Python tracker 

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



[issue23648] PEP 475 meta issue

2015-03-19 Thread STINNER Victor

STINNER Victor added the comment:

More issues:

- Issue #23707: os.urandom() doesn't handle EINTR correctly
- Issue #23708: Add _Py_read() and _Py_write() functions
- Issue #23709: Refactor ossaudiodev: use _Py_read and _Py_write with the 
Py_buffer

--
dependencies: +PEP 475: Add _Py_read() and _Py_write() functions, PEP 475: 
os.urandom() doesn't handle EINTR correctly, Refactor ossaudiodev: use _Py_read 
and _Py_write with the Py_buffer

___
Python tracker 

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



[issue23042] ctypes module doesn't build on FreeBSD x86

2015-03-19 Thread Davin Potts

Davin Potts added the comment:

Attaching a patch which enabled successful compilation of ctypes on FreeBSD 
10.1 i386-RELEASE in each of default/3.5, 3.4, and 2.7 branches.

This patch attempts to fix the incomplete logic regarding Windows target 
platforms in the ifdef's inside Modules/_ctypes/libffi/src/x86/ffi.c which at 
times tested for X86_WIN64 but not X86_WIN32 inside corresponding #else clauses 
(and vice versa).

This especially needs to be tested on a 32-bit Windows system -- I do not have 
one handy so help testing it there (and elsewhere) would be much appreciated.

--
keywords: +patch
Added file: 
http://bugs.python.org/file38561/issue_23042_fix_windows_ifdefs_py35_and_py34_and_py27.patch

___
Python tracker 

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



[issue23042] ctypes module doesn't build on FreeBSD x86

2015-03-19 Thread Davin Potts

Changes by Davin Potts :


--
stage:  -> patch review

___
Python tracker 

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



[issue22634] importing _ctypes failed: undefined symbol: ffi_call_win32

2015-03-19 Thread Davin Potts

Davin Potts added the comment:

There is now a proposed patch on issue23042 which, having gone through those 
changes, may well address this issue too.

Testing that patch on multiple platforms (including the RHEL variants relevant 
here) would be much appreciated.

Thanks goes to @lemburg for doing the investigative work and providing the 
diffs that occurred to the Modules/_ctypes/libffi/src/x86/ffi.c file in the 
past -- that work made the patch possible to sort out.

--

___
Python tracker 

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



[issue23698] Fix documentation for multiprocessing.Manager

2015-03-19 Thread Anand B Pillai

Anand B Pillai added the comment:

Is your patch uploaded anywhere ?

Anyway, before thinking whether this should be a patch or doc fix, one needs 
multiprocessing module author to possibly comment on the right behaviour 
expected here.

--

___
Python tracker 

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



[issue23698] Fix inconsistencies in behaviour and document it correctly for multiprocessing.Manager facade

2015-03-19 Thread Anand B Pillai

Changes by Anand B Pillai :


--
title: Fix documentation for multiprocessing.Manager -> Fix inconsistencies in 
behaviour and document it correctly for multiprocessing.Manager facade

___
Python tracker 

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



[issue23698] Fix inconsistencies in behaviour and document it correctly for multiprocessing.Manager facade

2015-03-19 Thread Davin Potts

Davin Potts added the comment:

No, it's premature to share the start of my patch.

Very much agreed on getting that input/insight -- sbt (multiprocessing module 
maintainer and original author) was added to the nosy list yesterday too.

--

___
Python tracker 

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



[issue23708] PEP 475: Add _Py_read() and _Py_write() functions

2015-03-19 Thread STINNER Victor

STINNER Victor added the comment:

With py_read_write.patch in debug mode, test_threading crash with an assertion 
error because of the issue #15751. Currently, it's not possible to call 
assert(PyGILState_Check()); inside Py_NewInterpreter(), while creating a 
subinterpreter (ex: _testcapi.run_in_subinterp()).

The workaround is to comment the assertion in _Py_read() and Py_write() until 
the issue #15751 is fixed.

--

___
Python tracker 

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



[issue16314] Support xz compression in distutils

2015-03-19 Thread Éric Araujo

Éric Araujo added the comment:

Code and doc changes look good.  Will you add tests?

--

___
Python tracker 

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



[issue22634] importing _ctypes failed: undefined symbol: ffi_call_win32

2015-03-19 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



[issue23708] PEP 475: Add _Py_read() and _Py_write() functions

2015-03-19 Thread STINNER Victor

STINNER Victor added the comment:

Oops, there was a bug in FileIO.readall(), fixed in the new patch 
py_read_write-2.patch.

I also commented assert(PyGILState_Check()); to workaround the issue #15751.

--
Added file: http://bugs.python.org/file38562/py_read_write-2.patch

___
Python tracker 

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



[issue23648] PEP 475 meta issue

2015-03-19 Thread STINNER Victor

STINNER Victor added the comment:

signal.sigwaitinfo() raises InterruptedError if the wait was interrupted by a 
signal  handler (this handler was for a signal other than one of those in set).

IMO we should also retry sigwaitinfo() if it fails with EINTR.

--

___
Python tracker 

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



[issue23710] C API doc for PyObject_HEAD is outdated

2015-03-19 Thread Tomi Pieviläinen

New submission from Tomi Pieviläinen:

https://docs.python.org/3/c-api/structures.html#c.PyObject_HEAD says that the 
macro should be used for creating new types and that it has ob_type. 
Unfortunately at some point (@61466 perhaps) that definition in object.h was 
changed. This affects other pages too (at least 
https://docs.python.org/3/extending/newtypes.html).

I encountered this while checking if a C extension (imposm.parser) could be 
trivially ported for Python 3. Unfortunately not. I suppose

  self->ob_type

should be replaced with

  Py_TYPE(self)

but that isn't really clear from the docs.

--
assignee: docs@python
components: Documentation
messages: 238530
nosy: docs@python, tpievila
priority: normal
severity: normal
status: open
title: C API doc for PyObject_HEAD is outdated

___
Python tracker 

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



[issue23703] urljoin() with no directory segments duplicates filename

2015-03-19 Thread Demian Brecht

Demian Brecht added the comment:

Nice work tracking down the commit, thanks for that. I've attached a fix.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file38563/issue23703.patch

___
Python tracker 

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



[issue22634] importing _ctypes failed: undefined symbol: ffi_call_win32

2015-03-19 Thread Siming Yuan

Siming Yuan added the comment:

@davin @lemburg
just tested with the provided patch in http://bugs.python.org/issue23042, the 
partch works.

dupe the bug?

--

___
Python tracker 

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



[issue22634] importing _ctypes failed: undefined symbol: ffi_call_win32

2015-03-19 Thread Davin Potts

Davin Potts added the comment:

@siyuan:  Duping it -- thanks for trying that patch out so quickly!

--
superseder:  -> ctypes module doesn't build on FreeBSD x86

___
Python tracker 

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



[issue18828] urljoin behaves differently with custom and standard schemas

2015-03-19 Thread Demian Brecht

Demian Brecht added the comment:

 urljoin('mailto:foo@', 'bar.com')
> 'mailto:bar.com'
> 
> which seems fairly sensible to me.

This is where joining arbitrary protocols gets tricky. Does it make sense to 
merge non-hierarchical protocols such as mailto? My initial reaction is "no" 
and what should actually happen here is one of two things:

1. The result is a simple concatenation: "mailto:f...@bar.com";.
2. An exception is raised indicating that urljoin cannot determine how to 
handle merging base and url.

The above could happen in cases where either scheme is None for both base and 
url or the scheme to be used is any of urllib.parse.non_hierarchical.

> A more awkward question is if this behaviour of my patch is reasonable:
> 
 urljoin('mailto:person-foo/b...@example.net', 'bar.com')
> 'mailto:person-foo/bar.com'

A couple thoughts on this: If urllib.parse.non_hierarchical is used to 
determine merge vs. simple concat (or exception), this specific case won't be 
an issue. Also, according to 6068, "mailto:person-foo/b...@example.net' is 
invalid (the "/" should be percent-encoded), but I don't think it should be the 
job of urljoin to understand the URI structures of each protocol, outside of 
logically join base and url.

> Yet another option, similar to my “any_scheme=True” flag, might be to change 
> from the “uses_relative” white-list to a “not_relative” black-list of URL 
> schemes, so that urljoin() works for arbitrary schemes except for ones like 
> “mailto:” that are in the hard-coded list.

This list may already be present in urllib.parse.non_hierarchical. I also think 
it's worthwhile to do some further research against 
http://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml to ensure the 
list is up to date.

If this path is chosen, I would suggest getting sign off from a couple core 
devs prior to investing time in this as all changes discussed so far are 
backwards incompatible.

--

___
Python tracker 

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



[issue8027] distutils fail to determine c++ linker with unixcompiler if using ccache

2015-03-19 Thread Joshua J Cogliati

Joshua J Cogliati added the comment:

Looking at the patch (3078fdb7cf3d for Issue1488098) it has:
 if target_lang == "c++" and self.compiler_cxx:
-linker[0] = self.compiler_cxx[0]

One possibility is that that the problem was:
 linker[0] = self.compiler_cxx[0]
which would also cause a compiler_cxx like:
export CXX="env BAR=FOO g++"
to fail.  Possibly the code:
 linker[i] = self.compiler_cxx[i]
managed to hit on an index value that worked better for the CXX that Ronald had 
on his system.

I think the root cause is the special casing of

if target_lang == "c++" and self.compiler_cxx:

and I think that few enough people use a c++ for extensions and of those, most 
use CXX="g++" or something similar where the complicated but incorrect version 
that is in Python works.

Basically, if you have something like CXX="g++" then both the version before 
3078fdb7cf3d and after 3078fdb7cf3d work.
If you have something like CXX="env BAR=FOO g++"
then the version before 3078fdb7cf3d would not have worked.

I think it is likely that if 3078fdb7cf3d had completely eliminated:
-if target_lang == "c++" and self.compiler_cxx:
-linker[0] = self.compiler_cxx[0]
instead of adding new code to try and work around the problem it also would 
have fixed the problem that Issue1488098 encountered.

I am guessing this problem really started with changeset 771b6f521b95 in 2002.  
This codes purpose is:
 (UnixCCompiler.link): Included target_lang parameter, and made linker command 
use compiler_cxx, if target_lang is 'c++'. 
and that change is the one that added:
 linker[0] = self.compiler_cxx[0]

--

___
Python tracker 

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



[issue23711] ConfigParser module blames on section less ini file

2015-03-19 Thread Maxim Kot

New submission from Maxim Kot:

Wikipedia (http://en.wikipedia.org/wiki/INI_file#Sections) says:
>Keys may (but need not) be grouped into arbitrarily named sections

But when it's trying to parse file without section header - 
"MissingSectionHeaderError: File contains no section headers" raised.

Can such check be made optional and switched on for default for example?

--
components: Library (Lib)
messages: 238537
nosy: Maxim Kot, lukasz.langa
priority: normal
severity: normal
status: open
title: ConfigParser module blames on section less ini file
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



[issue18828] urljoin behaves differently with custom and standard schemas

2015-03-19 Thread Demian Brecht

Demian Brecht added the comment:

Also, I would suggest still including the doc changes proposed by Madison in 
all versions prior to 3.5.

--

___
Python tracker 

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



[issue23325] Turn SIG_DFL and SIG_IGN into functions

2015-03-19 Thread Ethan Furman

Ethan Furman added the comment:

Thanks for the explanation, point taken.

However, it seems to me that changing the type of the constants from 'int' to 
'function' is backwards incompatible, will break code, and is probably not 
worth it (and would require a deprecation period if it was worth it).

I still think the better answer is to delve into Modules/signalmodule.c and fix 
the comparisons.

--

___
Python tracker 

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



[issue16314] Support xz compression in distutils

2015-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added tests for gztar, bztar and xztar. Added more asserts in other tests.

--
Added file: http://bugs.python.org/file38564/distutils-lzma_2.patch

___
Python tracker 

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



[issue23136] BUG in how _strptime() handles week 0

2015-03-19 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Serhiy,

Your latest patch LGTM.

--
stage: patch review -> commit review
type:  -> behavior

___
Python tracker 

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



[issue23648] PEP 475 meta issue

2015-03-19 Thread STINNER Victor

STINNER Victor added the comment:

I searched for "EINTR" in all manual pages of my Fedora 21. I found a long list 
of functions (filename of manual pages). But I didn't check each manual page.

There are false positive. For example, "stat" is listed, but in fact EINTR is 
only mentionned in commented text (not visible using the "man" command): "SVr4 
documents additional stat() error conditions EINTR, ...".

Another example of false positive with system:
"""
Early  drafts  required, or allowed, system() to return with errno set to
[EINTR] if it was interrupted with a signal. This error return was removed, and
a requirement that system() not return until the child has terminated was
added. This  means  that  if  a waitpid()  call  in  system() exits with errno
set to [EINTR], system() must reissue the waitpid().
"""

Shell command to search for all EINTR:
find /usr/share/man -name "*.gz"|xargs zgrep -H EINTR > EINTR.txt

Shell command to extract file names from the output:

sed 's!.*/!!g' EINTR.txt|sed 's!\.[0-9][a-z]\?m\?\.gz:.*!!g'|sort -u > 
EINTR_files.txt

Filename of manual pages:

accept
aio_suspend
catclose
catgets
chmod
chown
chroot
clock_nanosleep
close
closedir
connect
curs_getch
dup
endgrent
epoll_wait
exec
execve
fallocate
fchdir
fchmod
fchown
fclose
fcntl
fflush
fgetc
fgetwc
flock
fopen
fork
fprintf
fputc
fputwc
freopen
fseek
fsetpos
fstatvfs
fsync
ftruncate
futex
getch
getgrent
getgrgid
getgrnam
getmsg
getpwent
getpwnam
getpwuid
has_key
inotify
ioctl
io_getevents
lchown
lio_listio
lockf
mknod
mq_open
mq_receive
mq_send
msgop
msgrcv
msgsnd
mvgetch
mvwgetch
nanosleep
open
pause
pclose
poll
posix_fallocate
posix_mem_offset
posix_trace_close
posix_trace_create
posix_trace_get_filter
posix_trace_getnext_event
posix_trace_start
posix_typed_mem_get_info
posix_typed_mem_open
pselect
pthread_atfork
pthread_attr_destroy
pthread_attr_getdetachstate
pthread_attr_getguardsize
pthread_attr_getinheritsched
pthread_attr_getschedparam
pthread_attr_getschedpolicy
pthread_attr_getscope
pthread_attr_getstack
pthread_attr_getstacksize
pthread_barrierattr_destroy
pthread_barrierattr_getpshared
pthread_barrier_destroy
pthread_barrier_wait
pthread_cancel
pthread_cleanup_pop
pthread_condattr_destroy
pthread_condattr_getclock
pthread_condattr_getpshared
pthread_cond_broadcast
pthread_cond_destroy
pthread_cond_init
pthread_cond_timedwait
pthread_create
pthread_detach
pthread_equal
pthread_getconcurrency
pthread_getschedparam
pthread_getspecific
pthread_join
pthread_key_create
pthread_key_delete
pthread_kill
pthread_mutexattr_destroy
pthread_mutexattr_getprioceiling
pthread_mutexattr_getprotocol
pthread_mutexattr_getpshared
pthread_mutexattr_getrobust
pthread_mutexattr_gettype
pthread_mutex_consistent
pthread_mutex_destroy
pthread_mutex_getprioceiling
pthread_mutex_lock
pthread_mutex_timedlock
pthread_once
pthread_rwlockattr_destroy
pthread_rwlockattr_getpshared
pthread_rwlock_destroy
pthread_rwlock_rdlock
pthread_rwlock_timedrdlock
pthread_rwlock_timedwrlock
pthread_rwlock_trywrlock
pthread_rwlock_unlock
pthreads
pthread_setcancelstate
pthread_setschedprio
pthread_sigmask
pthread_spin_destroy
pthread_spin_lock
pthread_spin_unlock
pthread_tryjoin_np
ptrace
putmsg
read
recv
recvfrom
recvmsg
request_key
restart_syscall
scanf
select
select_tut
semop
sem_open
sem_timedwait
sem_trywait
sem_wait
send
sendmsg
sendto
shm_open
sigaction
sighold
siginterrupt
signal
sigpause
sigsuspend
sigtimedwait
sigvec
sigwaitinfo
spu_run
stat
statfs
statvfs
strace
system
tcdrain
tcsetattr
tmpfile
truncate
ualarm
ungetch
unlink
usleep
ustat
wait
wait4
waitid
wgetch
write

Not interesting for Python:

Expect
HTTP::Tiny
Net::HTTP
POSIX
Tcl_AppendAllObjTypes
Tcl_ConvertToType
Tcl_GetObjType
Tcl_RegisterObjType
nfs
perlapio
perlfunc
perlipc
zmq_ctx_destroy
zmq_getsockopt
zmq_msg_recv
zmq_msg_send
zmq_poll
zmq_recv
zmq_recvmsg
zmq_send
zmq_sendmsg
zmq_setsockopt
zmq_term
zshmodules

--

___
Python tracker 

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



[issue23136] BUG in how _strptime() handles week 0

2015-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 350ea309953e by Serhiy Storchaka in branch '2.7':
Issue #23136: _strptime now uniformly handles all days in week 0, including
https://hg.python.org/cpython/rev/350ea309953e

New changeset 93e1da502338 by Serhiy Storchaka in branch '3.4':
Issue #23136: _strptime now uniformly handles all days in week 0, including
https://hg.python.org/cpython/rev/93e1da502338

New changeset 750c6d53890a by Serhiy Storchaka in branch 'default':
Issue #23136: _strptime now uniformly handles all days in week 0, including
https://hg.python.org/cpython/rev/750c6d53890a

--
nosy: +python-dev

___
Python tracker 

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



[issue23136] BUG in how _strptime() handles week 0

2015-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for the review Alexander. Thank you for your contribution Jim.

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



[issue23136] BUG in how _strptime() handles week 0

2015-03-19 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

"including Jan 30" - did you mean Dec 31?

--

___
Python tracker 

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



[issue23136] BUG in how _strptime() handles week 0

2015-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, I meant Dec 30.

--

___
Python tracker 

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



[issue23136] BUG in how _strptime() handles week 0

2015-03-19 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I don't think it is worth the effort to try to fix the commit message, but it 
would be nice to have the NEWS text corrected.

--

___
Python tracker 

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



[issue23136] BUG in how _strptime() handles week 0

2015-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d9f3dd1d6b48 by Serhiy Storchaka in branch '2.7':
Fixed Misc/NEWS entry for issue #23136.
https://hg.python.org/cpython/rev/d9f3dd1d6b48

New changeset afca9867e1bb by Serhiy Storchaka in branch '3.4':
Fixed Misc/NEWS entry for issue #23136.
https://hg.python.org/cpython/rev/afca9867e1bb

New changeset 18bc81ce6090 by Serhiy Storchaka in branch 'default':
Fixed Misc/NEWS entry for issue #23136.
https://hg.python.org/cpython/rev/18bc81ce6090

--

___
Python tracker 

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



[issue23136] BUG in how _strptime() handles week 0

2015-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Is it possible to fix the commit message without breaking any of cloned 
repositories that already have pulled it?

--

___
Python tracker 

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



[issue12006] strptime should implement %G, %V and %u directives

2015-03-19 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

It would be nice to get this in for 3.5.  Does anyone have time/interest to 
address the last two comments?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue23136] BUG in how _strptime() handles week 0

2015-03-19 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Probably not.

--

___
Python tracker 

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



[issue23136] BUG in how _strptime() handles week 0

2015-03-19 Thread Jim Carroll

Jim Carroll added the comment:

Thanks for all your work !

--

___
Python tracker 

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



[issue23712] Experiment: Assume that exact unicode hashes are perfect discriminators

2015-03-19 Thread Raymond Hettinger

New submission from Raymond Hettinger:

This tracker item is for a thought experiment I'm running where I can collect 
the thoughts and discussions in one place.  It is not an active proposal for 
inclusion in Python.

The idea is to greatly speed-up the language for set/dict lookups of unicode 
value by skipping the exact comparison when the unicode type is exact and the 
64-bit hash values are known to match.

Given the siphash and hash randomization, we get a 1 in 2**64 chance of a false 
positive (which is better than the error rate for non-ECC DRAM itself).  

However, since the siphash isn't cryptographically secure, presumably a 
malicious chooser of keys could generate a false positive on-purpose.

This technique is currently used by git and mercurial which use hash values for 
file and version graphs without checking for an exact match (because the chance 
of a false positive is vanishingly rare).

The Python test suite passes as does the test suites for a number of packages I 
have installed.

--
assignee: rhettinger
components: Interpreter Core
files: assume_perf_uni_hash.diff
keywords: patch
messages: 238552
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Experiment:  Assume that exact unicode hashes are perfect discriminators
type: performance
versions: Python 3.5
Added file: http://bugs.python.org/file38565/assume_perf_uni_hash.diff

___
Python tracker 

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



[issue23713] intermittent failure of multiprocessing unit test test_imap_unordered_handle_iterable_exception

2015-03-19 Thread Davin Potts

New submission from Davin Potts:

test_imap_unordered_handle_iterable_exception fails intermittently on some 
platforms due to the test being too rigid (fragile) about the order of the 
items being iterated over which, as the name would imply, is not guaranteed.

Of the multiprocessing module's test modules, test_multiprocessing_fork, 
test_multiprocessing_forkserver, and test_multiprocessing_spawn all leverage 
the unit test test_imap_unordered_handle_iterable_exception in multiple 
different contexts.  There are thus multiple opportunities for 
test_imap_unordered_handle_iterable_exception to fail due to this fragility -- 
it's maybe a little bit surprising the test doesn't fail more often than it 
does.

A patch is forthcoming.

--
assignee: davin
components: Tests
messages: 238553
nosy: davin, jnoller, sbt
priority: normal
severity: normal
status: open
title: intermittent failure of multiprocessing unit test 
test_imap_unordered_handle_iterable_exception
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue23712] Experiment: Assume that exact unicode hashes are perfect discriminators

2015-03-19 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Added file: http://bugs.python.org/file38566/assume_perf_uni_hash1.diff

___
Python tracker 

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



[issue23712] Experiment: Assume that exact unicode hashes are perfect discriminators

2015-03-19 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Removed file: http://bugs.python.org/file38565/assume_perf_uni_hash.diff

___
Python tracker 

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



[issue23713] intermittent failure of multiprocessing unit test test_imap_unordered_handle_iterable_exception

2015-03-19 Thread Davin Potts

Davin Potts added the comment:

Attaching patch for this fragile test for default/3.5 and 3.4 branches.

Blame for implementing the fragile test falls to @davin.  In my own defense, 
@davin also discovered it in testing on FreeBSD 10.1 i386-RELEASE.

--
keywords: +patch
Added file: 
http://bugs.python.org/file38567/issue_23713_fix_fragile_imap_unordered_test_py35_and_py34.patch

___
Python tracker 

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



[issue23706] pathlib.Path.write_text should include a newline argument

2015-03-19 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +pitrou

___
Python tracker 

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



[issue23707] PEP 475: os.urandom() doesn't handle EINTR correctly

2015-03-19 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +neologix

___
Python tracker 

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



[issue23713] intermittent failure of multiprocessing unit test test_imap_unordered_handle_iterable_exception

2015-03-19 Thread Davin Potts

Davin Potts added the comment:

Attaching patch for this fragile test for 2.7 branch.

Patches have been put through test.regrtest on OS X 10.10 (64-bit), FreeBSD 
10.1 i386 (32-bit), and Raspbian Debian (ARMv6) thus far.

--
stage:  -> patch review
Added file: 
http://bugs.python.org/file38568/issue_23713_fix_fragile_imap_unordered_test_py27.patch

___
Python tracker 

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



[issue23550] Add to unicodedata a function to query the "Quick_Check" property for a character

2015-03-19 Thread Hammerite

Hammerite added the comment:

Berker, I had not seen your or Ezio's review comments. The user interface here 
is new to me and I did not know to seek them out separately from the issue 
page. Thank you for pointing them out to me. I shall go through and look at the 
suggestions that were made.

--

___
Python tracker 

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



[issue23646] PEP 475: handle EINTR in the time module, retry sleep()

2015-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b1abd06465fc by Victor Stinner in branch 'default':
Issue #23646: If time.sleep() is interrupted by a signal, the sleep is now
https://hg.python.org/cpython/rev/b1abd06465fc

--

___
Python tracker 

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



[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-19 Thread Mark Mikofski

Mark Mikofski added the comment:

I know this issue is closed, but as there is no voting or plus 1, I'll add my 
support for allowing local installation of not just Python-3, but also 
Python-2.7. I'm not sure what is gained by adding this restriction, or how 
difficult it would be to allow users without admin rights to install official 
python.org locally? Where is the source that needs to be patched?

IMO forcing Windows users with restricted rights to go to Anaconda, Enthought, 
or WinPython causes a fracture in the Python community, that decreases 
credibility for Windows users. Quoting Tim Peters from import this, "There 
should be one-- and preferably only one --obvious way to do it." not 3 or more 
ways. Having most new users installing Anaconda has many disadvantages:

1. Developement of an open source optimized version of NumPy (eg: using 
OpenBLAS) has a lower value proposition because users can just install 
Anaconda, which uses an unoptimized version of Intel MKL. Of course users can 
continue to get Christoph Gohlke's optimized MKL NumPy until he decides he 
doesn't want to anymore.

2. There will be two (or more) Python package indexes: PyPI, conda:binstar, 
binstar and pythonwheels. Do we really want Python packagers to have to upload 
to all of these repos? Which is the most current? etc. = less credibility for 
Python

3. There are/will be more than one python package installer and virtualenv 
tool: conda vs. pip/virtualev

Are there any repeats of this issue/feature request?

--
nosy: +bwanamarko

___
Python tracker 

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



[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall

2015-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4491bdb6527b by Victor Stinner in branch 'default':
Issue #22181: The availability of the getrandom() is now checked in configure,
https://hg.python.org/cpython/rev/4491bdb6527b

--

___
Python tracker 

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



[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-19 Thread Mark Mikofski

Mark Mikofski added the comment:

one more note, NaCl (J. Morton), you can install from the msi to any directory 
you want by using the following from a command line opened to the folder where 
you have the installer:

C:\path\to\msi\download> msiexec /a python-2.7.9.amd64.msi TARGETDIR=C:\Python27

or

C:\path\to\msi\download> msiexec /a python-3.4.3.amd64.msi TARGETDIR=C:\Python34

--

___
Python tracker 

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



[issue23714] Comprehension + eval doesn't work inside function definition

2015-03-19 Thread Ariel Bruner

New submission from Ariel Bruner:

The following code gives a NameError:

>>> def foo(bar):
print {eval(x) for x in ['bar']}


>>> foo(2)

Traceback (most recent call last):
  File "", line 1, in 
foo(2)
  File "", line 2, in foo
print {eval(x) for x in ['bar']}
  File "", line 2, in 
print {eval(x) for x in ['bar']}
  File "", line 1, in 
NameError: name 'bar' is not defined

I've seen this kind of bug reported for Python 3.X (e.g. Issue5242), and the 
behavior seems to be identical (e.g. can be fixed with {eval(x) for x in 
['bar'] if True or bar}), but the previously reported bug reports mention 
comprehension is implemented differently on 2.X and that it should not happen 
there, so I thought that might be of interest.

--
components: Windows
messages: 238561
nosy: Ariel Bruner, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Comprehension + eval doesn't work inside function definition
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



[issue23714] Set comprehension + eval doesn't work inside function definition

2015-03-19 Thread Ned Deily

Ned Deily added the comment:

Thanks for the report.  Your example is of a set comprehension.  Set and 
dictionary comprehensions were Python 3.2 features backported to Python 2.7 for 
compatibility and thus had no existing Python 2 compatibility concerns.  If you 
try a similar example using list comprehensions, which have been around in 
Python 2 for a long time, you'll see there is a difference in behavior between 
Python 2 and 3, which is what under discussion in Issue5242.

--
components:  -Windows
nosy: +ned.deily -steve.dower, tim.golden, zach.ware
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
title: Comprehension + eval doesn't work inside function definition -> Set 
comprehension + eval doesn't work inside function definition

___
Python tracker 

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



[issue23714] Set comprehension + eval doesn't work inside function definition

2015-03-19 Thread Ned Deily

Changes by Ned Deily :


--
Removed message: http://bugs.python.org/msg238562

___
Python tracker 

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



[issue23714] Set comprehension + eval doesn't work inside function definition

2015-03-19 Thread Ned Deily

Ned Deily added the comment:

Thanks for the report.  Your example is of a set comprehension.  Set and 
dictionary comprehensions were Python 3.1 features backported to Python 2.7 for 
compatibility and thus had no existing Python 2 compatibility concerns.  If you 
try a similar example using list comprehensions, which have been around in 
Python 2 for a long time, you'll see there is a difference in behavior between 
Python 2 and 3, which is what under discussion in Issue5242.

https://docs.python.org/2/whatsnew/2.7.html#python-3-1-features

--

___
Python tracker 

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



[issue11344] Add os.path.splitpath(path) function

2015-03-19 Thread Éric Araujo

Éric Araujo added the comment:

pathlib is in the stdlib now (see previous comments), maybe this should be 
closed as obsolete.

--

___
Python tracker 

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



[issue2211] Cookie.Morsel interface needs update

2015-03-19 Thread R. David Murray

R. David Murray added the comment:

The change to the signature of set is backward incompatible and should have a 
deprecation warning instead (yes, I know it isn't documented).  I'd even be OK 
with the value being ignored, but the signature shouldn't change.

There are a number of API/behavior changes noted in the NEWS which IMO need a 
versionchanged in the docs and an entry in whatsnew.

--
status: closed -> open

___
Python tracker 

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



[issue23703] urljoin() with no directory segments duplicates filename

2015-03-19 Thread Martin Panter

Martin Panter added the comment:

Patch looks good enough.

BTW I was thinking of something like this, which is a bit simpler, but I never 
tested it:

segments[1:-1] = filter(None, segments[1:-1])

--

___
Python tracker 

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



[issue23171] csv.writer.writerow() does not accept generator (must be coerced to list)

2015-03-19 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue22516] Windows Installer won't - even when using "just for me"option

2015-03-19 Thread Steve Dower

Steve Dower added the comment:

Supporting proper per-user installs of Python 2.7 or 3.4 would require a second 
MSI that is configured to not ask for administrative privileges. The code is in 
Tools/msi/msi.py if you want to look at it (it's not my code and I have no 
intention of touching it), but the bigger concern is you're asking python.org 
to host twice as many files.

I'm planning to discuss installers at PyCon in a few weeks with the other core 
developers, so there may be a change of approach after that. Currently, we view 
Continuum and Enthought as the equivalent of any of the Linux distributors - 
either you live within their walled gardens, or you brave the outside world 
yourself. Linux distributions have shown that it's not a fatal split in the 
community, though it can lead to some obscure issues when people don't 
understand how they got/get Python.

--

___
Python tracker 

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



[issue22634] importing _ctypes failed: undefined symbol: ffi_call_win32

2015-03-19 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue23708] PEP 475: Add _Py_read() and _Py_write() functions

2015-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c3c47ea32f72 by Victor Stinner in branch 'default':
Issue #23708: Add _Py_read() and _Py_write() functions to factorize code handle
https://hg.python.org/cpython/rev/c3c47ea32f72

--
nosy: +python-dev

___
Python tracker 

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



[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall

2015-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8c73af0b3cd9 by Victor Stinner in branch 'default':
Issue #22181: Fix dev_urandom_noraise(), try calling py_getrandom() before
https://hg.python.org/cpython/rev/8c73af0b3cd9

--

___
Python tracker 

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



[issue23539] Content-length not set for HTTP methods expecting body when body is None

2015-03-19 Thread James Rutherford

James Rutherford added the comment:

Python 3 patch attached. The documentation has changed structure a little so 
I've adapted (simplified) this from the original. Otherwise, it's pretty much 
the same, except with python3 fixes, and incorporated feedback. I'll upload an 
updated 2.7 patch as well in a few minutes.

--
Added file: http://bugs.python.org/file38569/issue23539-py3.patch

___
Python tracker 

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



[issue12006] strptime should implement %G, %V and %u directives

2015-03-19 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue23708] PEP 475: Add _Py_read() and _Py_write() functions

2015-03-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e232b57ee784 by Victor Stinner in branch 'default':
Issue #23708: select.devpoll now retries its internal write() when interrupted
https://hg.python.org/cpython/rev/e232b57ee784

--

___
Python tracker 

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



  1   2   >