[issue21069] test_fileno of test_urllibnet intermittently fails when using www.example.com

2014-04-16 Thread Ned Deily

Ned Deily added the comment:

Senthil, thanks for looking into this.  Since it is turning out to be more of a 
urllib design issue, I'm going to deassign myself from it.

--
assignee: ned.deily - 

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



[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-16 Thread STINNER Victor

STINNER Victor added the comment:

 On Windows, the type of the size parameter of read() is an unsigned int, not 
 long nor size_t (...)

Oh, I read the wrong function. In fact, file_read() of Python 2.7 calls fread() 
and fread() uses size_t types, even on Windows.

To make sure that we are talking about the same thing, I wrote the attached 
file_read_size_t.patch file which replaces l with n in file_read().

Note: os.read() uses int types, even on Python 3.5, whereas read() uses a 
size_t type for the number of bytes on Linux.

--
keywords: +patch
Added file: http://bugs.python.org/file34906/file_read_size_t.patch

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



[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-16 Thread STINNER Victor

STINNER Victor added the comment:

If you want to announce that Python 2.7.x supports large objects on Windows 64 
bits, be prepared to have to fix Python in various different places.

You can compare which modules define PY_SSIZE_T_CLEAN in Python 2.7 and 3.x. 
For example, it looks like bz2 and zlib modules handle correctly 64-bit lengths 
in Python 3, but don't in Python 2.

By the way, BZ2File_read() in Python 2.7 uses also the l format to parse the 
input length. It looks like the code was copied from fileobject.c.

--

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



[issue21220] Enhance obmalloc allocation strategy

2014-04-16 Thread STINNER Victor

STINNER Victor added the comment:

It was also discussed to replace pymalloc with Windows Low Fragementation Heap 
(LFH) allocator on Windows:
http://bugs.python.org/issue13483#msg148605

--
nosy: +haypo

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



[issue21220] Enhance obmalloc allocation strategy

2014-04-16 Thread STINNER Victor

STINNER Victor added the comment:

It would also be interesting to compare fragmentation and performances of 
Python with and without pymalloc, maybe with other heap allocators like FreeBSD 
jemalloc and Google TCMalloc.

--

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



[issue21075] fileinput should use stdin.buffer for rb mode

2014-04-16 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo

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



[issue1191964] asynchronous Subprocess

2014-04-16 Thread STINNER Victor

STINNER Victor added the comment:

I suggest to change the title of the issue to: subprocess: add non-blocking 
read and write methods to avoid the confusion with asyncio subprocess module 
which runs read and write in the background for you.

--
nosy: +haypo

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



[issue21220] Enhance obmalloc allocation strategy

2014-04-16 Thread Charles-François Natali

Charles-François Natali added the comment:

 In Python 3, arenas are allocated using mmap(), so wherever the arena ends up 
 in the address space shouldn't matter, should it?

Indeed, although the effect on cache locality isn't clear.
Also, I don't think this solves the problem of having a single object
allocated inside a high address arena preventing the heap from
shrinking (which was the original reason for having the arenas
allocated by mmap).

Anyway, we can only go that far with reference counting (I mean that
you'd need a proper moving garbage collector for this).

--

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



[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-16 Thread Charles-François Natali

Charles-François Natali added the comment:

 So what is the point of _PyObject_GC_Calloc ?

 It calls calloc(size) instead of malloc(size), calloc() which can be faster 
 than malloc()+memset(), see:
 https://mail.python.org/pipermail/python-dev/2014-April/133985.html

It will only make a difference if the allocated region is large enough
to be allocated by mmap (so not for 90% of objects).

--

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



[issue1191964] asynchronous Subprocess

2014-04-16 Thread STINNER Victor

STINNER Victor added the comment:

I started to review the patch 5:
http://bugs.python.org/review/1191964/#ps11598

When I read unit tests, I realized that I don't like write_nonblocking name. 
It's too generic. A process has many files (more than just stdin, stdout, 
stderr: see pass_fds parameter of Popen). I would like an explicit 
write_stdin_nonblocking and read_stdout_nonblocking.

--

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



[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-16 Thread STINNER Victor

STINNER Victor added the comment:

 I agree in part, but it's quite common to close fd's in some cases like in a 
 child process after using os.fork()

Which project or Python module does that? Can you show me the code?

--
nosy: +haypo

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



[issue21111] Add a new PyLong_AsUnsignedLongAndOverflow function

2014-04-16 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
title: PyLong_AsUnsignedLongAndOverflow does not exist - Add a new 
PyLong_AsUnsignedLongAndOverflow function

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




[issue20434] Fix error handler of _PyString_Resize() on allocation failure

2014-04-16 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
title: Process crashes if not enough memory to import module - Fix error 
handler of _PyString_Resize() on allocation failure

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



[issue21180] Efficiently create empty array.array, consistent with bytearray

2014-04-16 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo

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



[issue21216] getaddrinfo is wrongly considered thread safe on linux

2014-04-16 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo

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



[issue21216] getaddrinfo is wrongly considered thread safe on linux

2014-04-16 Thread STINNER Victor

STINNER Victor added the comment:

 It may only be reproductible when your getaddrinfo use a NETLINK to get 
 informations about your interfaces before doing the DNS query.

What is your operation system? Name and version. What is your version of the C 
library? What is your Python version? Can you provide an example to reproduce 
the issue?

--

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



[issue21250] sqlite3 doesn't have unit tests for 'insert or [algorithm]' functionality.

2014-04-16 Thread Alex Lord

New submission from Alex Lord:

In Lib/sqlite3/tests/dbapi.py there are no unit tests which test out sqlite3's 
'insert or [algorithm].' These algorithms are also referred to as SQL 'insert 
on conflict.'

More details at,
https://www.sqlite.org/lang_conflict.html

Not having unit tests for these features, especially 'insert or rollback,' 
seems like an easy way for timing and threading bugs to get lost in the 
database api.

--
components: Tests
messages: 216448
nosy: Alex.Lord
priority: normal
severity: normal
status: open
title: sqlite3 doesn't have unit tests for 'insert or [algorithm]' 
functionality.
type: enhancement
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue21216] getaddrinfo is wrongly considered thread safe on linux

2014-04-16 Thread STINNER Victor

STINNER Victor added the comment:

test_getaddrinfo.c: C program to run getaddrinfo() concurrently in different 
threads, it comes from the Debian issue.

I ran this program with 10 threads, I stopped it after between 3000 and 5000 
tries (depending on the thread). I'm running Fedora 20: Linux kernel 
3.13.9-200.fc20.x86_64 and glibc 2.18.

--
Added file: http://bugs.python.org/file34907/test_getaddrinfo.c

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



[issue21216] getaddrinfo is wrongly considered thread safe on linux

2014-04-16 Thread STINNER Victor

STINNER Victor added the comment:

Can you provide the C and Python backtrace of all threads of your program?

--

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



[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-16 Thread STINNER Victor

STINNER Victor added the comment:

 So what is the point of _PyObject_GC_Calloc ?

 It calls calloc(size) instead of malloc(size)

 No, the question is why you didn't simply change _PyObject_GC_Malloc
 (which is a private function).

Oh ok, I didn't understand. I don't like changing the behaviour of
functions, but it's maybe fine if the function is private.

--

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



[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-16 Thread STINNER Victor

STINNER Victor added the comment:

2014-04-16 3:18 GMT-04:00 Charles-François Natali rep...@bugs.python.org:
 It calls calloc(size) instead of malloc(size), calloc() which can be faster 
 than malloc()+memset(), see:
 https://mail.python.org/pipermail/python-dev/2014-April/133985.html

 It will only make a difference if the allocated region is large enough
 to be allocated by mmap (so not for 90% of objects).

Even if there are only 10% of cases where it may be faster, I think
that it's interesting to use calloc() to allocate Python objects. You
may create large Python objects ;-)

I didn't check which objects use (indirectly) _PyObject_GC_Calloc().

--

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



[issue21234] __contains__ and friends should check is for all elements first

2014-04-16 Thread Wolfgang Maier

Wolfgang Maier added the comment:



I don't even know where to start with this.

a) this recipe is not working
b) it's hardly readable
c) it is pointless

Why are you complicating things by testing for != ?
What advantage does this offer over == ?

You do not need class methods at all to achieve what you want (in fact the 
__ne__ as a method of the container is just wrong), instead use the one-liner:

any(element == value for element in container)

to find out if any element of your container equals value without doing the 
identity check, but then:
the identity check is anyway the fast part compared to the equality check (at 
least you assumed that in your first post).

and in fact with:
 l=list(range(2000))

 2000 in l
False

is much faster than:

 any(e == 2000 for e in l)
False

despite checking identity AND equality, simply because it isn't doing things in 
Python.

So while the current docs say this about the in operator:


For container types such as list, tuple, set, frozenset, dict, or 
collections.deque, the expression x in y is equivalent to any(x is e or x == e 
for e in y).


I guess, that doesn't mean it is actually implemented like that, but only that 
the result is equivalent.

--

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



[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-16 Thread Hrvoje Nikšić

Hrvoje Nikšić added the comment:

Using -fp-model strict (or other appropriate icc flag) seems like a reasonable 
resolution.

It should likely also be applied to Python 3.x, despite the version field of 
this issue. (Even if float('nan') happens to work in current 3.x, internal code 
that returns Py_NAN can and will break.)

--

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



[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-16 Thread Stefan Krah

Stefan Krah added the comment:

I left a Rietveld comment, which probably did not get mailed.

--

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



[issue21015] support SSL_CTX_set_ecdh_auto on newer OpenSSLs

2014-04-16 Thread Stefan Krah

Stefan Krah added the comment:

In case anyone wonders why the FreeBSD bot works again: I've
installed OpenSSL from source.

--

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



[issue21234] __contains__ and friends should check is for all elements first

2014-04-16 Thread Jurjen N.E. Bos

Jurjen N.E. Bos added the comment:

Oops. That was a hard lesson: 1) don't haste when posting 2) always run what 
you post.

The point was the trick to define a custom __ne__ and not an __eq__ for an 
object (not for the container it is in!) so you can use in at full speed. Then
not all(map(ne, repeat(obj), container))
or
not all(map(obj.__ne__, container))
can be used if you really what to check for equality. This does make a 
difference in my case, where I only sometimes check for a non-identical object 
in the container, and I know when I do that.

--

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



[issue20752] Difflib should provide the option of overriding the SequenceMatcher

2014-04-16 Thread Chris Rose

Changes by Chris Rose off...@offby1.net:


--
nosy: +r.david.murray

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



[issue21237] Update Python 2/3 porting HOWTO's suggestion for dealing with map()

2014-04-16 Thread Josh Rosenberg

Josh Rosenberg added the comment:

I think the suggestion is intended for how do I keep Python 2 semantics in 
Python 3?, not how can I write my Python 2 code so it will run equivalently 
in Python 3?

It wouldn't be a bad idea to point out that you can adopt Py3 semantics 
initially so as to avoid surprises later on; sadly, unlike a __future__ import, 
if you want cross compatible code you have to do stupid stuff like:

try:
from future_builtins import *
except ImportError:
# Py3 is already the future
pass

--
nosy: +josh.rosenberg

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



[issue21235] importlib's spec module create algorithm is not exposed

2014-04-16 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe tshep...@gmail.com:


--
nosy: +tshepang

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



[issue21251] Standard library trace module crashes with exception

2014-04-16 Thread Martin Kolman

New submission from Martin Kolman:

We are currently working on adding tracing support to Anaconda, the Fedora/Red 
Hat Enterprise Linux installer and we have encountered some pretty strange 
behavior of the trace module. Anaconda (or to be concrete the Blivet storage 
library used by Anaconda) uses the pyblock module, but just importing it 
crashes the trace module with a strange exception.

It can be reproduced like this:
0. install pyblock (on Fedora is is provided by the python-pyblock package)

1. write some python code that imports the block module provided by pyblock

echo import block  pyblock_trace.py

2. try to trace the code

python -m trace -t pyblock_trace.py

The trace module starts tracing but after a few seconds it crashes with the 
following traceback:


Traceback (most recent call last):
  File /usr/lib64/python2.7/runpy.py, line 162, in _run_module_as_main
__main__, fname, loader, pkg_name)
  File /usr/lib64/python2.7/runpy.py, line 72, in _run_code
exec code in run_globals
  File /usr/lib64/python2.7/trace.py, line 830, in module
main()
  File /usr/lib64/python2.7/trace.py, line 818, in main
t.runctx(code, globs, globs)
  File /usr/lib64/python2.7/trace.py, line 513, in runctx
exec cmd in globals, locals
  File pyblock_trace.py, line 1, in module
import block
  File /usr/lib64/python2.7/site-packages/block/__init__.py, line 47, in 
module
import dmraid
  File string, line 1, in module
  File /usr/lib64/python2.7/trace.py, line 609, in globaltrace_lt
filename = frame.f_globals.get('__file__', None)
AttributeError: 'module' object has no attribute 'get'


The dmraid module is written in C and we have looked though its source[1] code 
but have found nothing extraordinary. Most importantly there is no code 
touching the globals, but it still fails.

When looking what actually is in frame.f_globals we found that in all 
successful calls it has the globals dictionary but for the dmraid module it for 
some reason contains the module instance instead. Module instance is not a 
dictionary, so it doesn't have the get method and this leads to the exception 
above.

This is not the only C module we use, but this is the only one that triggers 
the crash in trace.


Additional information
Python version: 2.7.5
architecture: X86_64
OS: Fedora 20


[1] https://git.fedorahosted.org/cgit/pyblock.git/tree/dmraid.c

--
components: Library (Lib)
files: trace.log
messages: 216459
nosy: mkolman
priority: normal
severity: normal
status: open
title: Standard library trace module crashes with exception
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file34908/trace.log

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



[issue21211] pkgutil.find_loader() raises ImportError instead of returning None

2014-04-16 Thread Eric Snow

Eric Snow added the comment:

Ah, it's ValueError rather than ImportError that causes the problem.  
Regardless, handling it would be necessary.

--

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



[issue6490] os.popen documentation is probably wrong

2014-04-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3417a95df7e2 by Andrew Kuchling in branch 'default':
#6490: Expand documentation for os.popen().
http://hg.python.org/cpython/rev/3417a95df7e2

--
nosy: +python-dev

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



[issue6490] os.popen documentation is probably wrong

2014-04-16 Thread A.M. Kuchling

A.M. Kuchling added the comment:

Thanks for your patch!

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed
title: os.popen documentation  is probably wrong - os.popen documentation is 
probably wrong

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



[issue21234] __contains__ and friends should check is for all elements first

2014-04-16 Thread Wolfgang Maier

Wolfgang Maier added the comment:

that clarifies things, thanks.

I would still not usually go that way though as it means defining __ne__ with 
no accompanying __eq__, which means that, in a simple case, you can't use == on 
instances of your class and, in the case that your class inherits __eq__ from a 
parent, that == and != give inconsistent answers.

A much simpler solution is to not use the x in y idiom if you know it is slowed 
down by expensive equality checks in the elements of y and you're only 
interested in the identity check.
Simply replace it with

any(element is x for element in y)

, which will run at decent speed.

A quick illustration:

class myObj(object):
def __eq__(self, other):
for i in range(1): pass # simulate an expensive check
return False

l=[myObj() for x in range(1)]

now compare:

 1 in m # slowed down by myObj.__eq__
False

 any(e is 1 for e in m) # identity checks only
False

= no class-level hacking required, but still a good performance gain.
Of course, if you really need bets performance with identity *and* equality 
checks, then your solution may make sense, but that looks like a pretty special 
requirement.
(and even then I would replace the ugly

not all(map(ne, repeat(obj), container)) # requires 2 imports to be so hard to 
read

with:

not all(element != obj for element in container)
)

--

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



[issue21234] __contains__ and friends should check is for all elements first

2014-04-16 Thread Wolfgang Maier

Wolfgang Maier added the comment:

 l=[myObj() for x in range(1)]
 
 now compare:
 
  1 in m # slowed down by myObj.__eq__
 False
 
  any(e is 1 for e in m) # identity checks only
 False

oops, sorry for the inconsistency here.

the first line should read:

m = [myObj() for x in range(1)]

for this to work, of course.

--

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



[issue15002] urllib2 does not download 4 MB file completely using ftp

2014-04-16 Thread Christian Theune

Christian Theune added the comment:

Looking into this. 

It seems that it doesn't happen for all servers, I can download large files 
reliably from other sources.

I'll make another wireshark recording to get more details for me to analyze.

--
nosy: +ctheune

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



[issue15002] urllib2 does not download 4 MB file completely using ftp

2014-04-16 Thread Senthil Kumaran

Senthil Kumaran added the comment:

 I'll make another wireshark recording to get more details for me to analyze.

Thank you! That will be useful. Please test it against 3.x version as it has 
seen cleanups recently.

--

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



[issue21121] -Werror=declaration-after-statement is added even for extension modules through setup.py

2014-04-16 Thread Stefan Krah

Stefan Krah added the comment:

Here is a patch.  I do not see a really nice way to deal with the problem.
The cleanest way I found was to introduce a new Makefile variable CFLAGS_NODIST
and use that in the interpreter and stdlib build.

--
keywords: +patch
nosy: +skrah
Added file: http://bugs.python.org/file34909/issue21121.diff

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



[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-16 Thread Stefan Krah

Stefan Krah added the comment:

Mark, if you agree that fp-model strict should not show up in
the distutils CFLAGS once Python is installed, the issue now depends
on #21121.

--
dependencies: +-Werror=declaration-after-statement is added even for extension 
modules through setup.py

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



[issue12916] Add inspect.splitdoc

2014-04-16 Thread R. David Murray

R. David Murray added the comment:

Well, perhaps inspect needs a get_doc_synopsis method :)

Actually, I'm not sure that should be a smiley.

I don't really have a strong opinion on this myself (say I'm +0 for inspect), 
so I asked a couple other core devs here at the sprint (Eric Smith and Eric 
Snow), and they both thought it should be in inspect rather than pydoc.  
(Eric's Snow reason is that pydoc is not really a user facing library (actually 
what he said is it's a mess), and both thought it was more appropriate for 
inspect anyway).

--

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



[issue12916] Add inspect.splitdoc

2014-04-16 Thread Eric Snow

Eric Snow added the comment:

I agree with Éric that exposing splidoc publicly in the inspect module is the 
right thing.  inspect already has other similar functions.  If it doesn't land 
in inspect then the only other place that makes real sense to me would be a new 
module (docstring?).  However, that seems like overkill to me.

Furthermore, pydoc doesn't seem like a good place to expose the function (or 
perhaps any function wink).  It isn't a module relating explicitly to 
docstrings so much as to exposing API documentation.  The use of splitdoc there 
is an implementation detail while splitdoc itself is generally useful.  That 
said, I would still expect splitdoc to be exposed in pydoc for backward 
compatibility (via from inspect import splitdoc).

--
nosy: +eric.snow

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



[issue12523] 'str' object has no attribute 'more' [/usr/lib/python3.2/asynchat.py|initiate_send|245]

2014-04-16 Thread Caelyn McAulay

Caelyn McAulay added the comment:

Here is a small script that runs fine under 2.7 but demonstrates the error when 
run at 3.5.

If, at all the points annotated with '#not bytes :-(', the unicode strings are 
replaced with bytes objects, the example then successfully runs at 3.5.

--
nosy: +math_foo
Added file: http://bugs.python.org/file34910/asynchat_example.py

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



[issue15002] urllib2 does not download 4 MB file completely using ftp

2014-04-16 Thread Christian Theune

Christian Theune added the comment:

This is actually the same problem as #18879.

Changing the sample to keep a reference to the addinfourl object avoids this 
issue.

This is even worse than #18879 in the sense that the error goes undetected and 
just leaves you with partial data.

Looking at the solution in #18879 I think we can reuse that, maybe even better 
by refactoring that to a common file proxy object.

--

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



[issue21015] support SSL_CTX_set_ecdh_auto on newer OpenSSLs

2014-04-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 In case anyone wonders why the FreeBSD bot works again: I've
 installed OpenSSL from source.

Did you install the same version?

--

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



[issue21015] support SSL_CTX_set_ecdh_auto on newer OpenSSLs

2014-04-16 Thread Stefan Krah

Stefan Krah added the comment:

Antoine Pitrou rep...@bugs.python.org wrote:
 Did you install the same version?

No, I used the latest version + FIPS. Since FreeBSD 9.0 is EOL, I did not
feel like investigating too much. :)

--

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



[issue21246] test_ssl handshake failure

2014-04-16 Thread ddve...@ucar.edu

ddve...@ucar.edu added the comment:

Despite this being Red Hat, this is not at all the case!

OpenSSL 1.0.1f has been released on Jan 6th, 2014 at 15:39:19 -- see 
https://www.openssl.org/source/

--

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



[issue21121] -Werror=declaration-after-statement is added even for extension modules through setup.py

2014-04-16 Thread Wolfgang Maier

Wolfgang Maier added the comment:

I ran into this issue right after 3.4 got released.

I solved it by adding

extra_compile_args=[-Wno-error=declaration-after-statement]

as an argument to the Extension() call in the package's setup.py .

--
nosy: +wolma

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



[issue21246] test_ssl handshake failure

2014-04-16 Thread ddve...@ucar.edu

ddve...@ucar.edu added the comment:

Just to make sure I'm using the right version:

Python 2.7.6 (default, Apr 14 2014, 15:12:21)
[GCC 4.8.2] on linux2
Type help, copyright, credits or license for more information.
  import ssl
  ssl.OPENSSL_VERSION
'OpenSSL 1.0.1f 6 Jan 2014'
 

On 04/16/2014 08:49 AM, Davide Del Vento wrote:

 ddve...@ucar.edu added the comment:

 Despite this being Red Hat, this is not at all the case!

 OpenSSL 1.0.1f has been released on Jan 6th, 2014 at 15:39:19 -- see
 https://www.openssl.org/source/

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue21246
 ___


--

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



[issue15414] os.path.join behavior on Windows (ntpath.join) is unexpected and not well documented

2014-04-16 Thread Martin Dengler

Changes by Martin Dengler mar...@martindengler.com:


--
nosy: +mdengler

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



[issue1669539] Improve Windows os.path.join (ntpath.join) smart joining

2014-04-16 Thread Martin Dengler

Changes by Martin Dengler mar...@martindengler.com:


--
nosy: +mdengler

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



[issue21252] Lib/asyncio/events.py has tons of docstrings which are just XXX

2014-04-16 Thread Alex Gaynor

New submission from Alex Gaynor:

It would be nice if these said something useful. 
(http://hg.python.org/cpython/file/default/Lib/asyncio/events.py)

--
components: Library (Lib)
messages: 216478
nosy: alex
priority: normal
severity: normal
status: open
title: Lib/asyncio/events.py has tons of docstrings which are just XXX
versions: Python 3.4, Python 3.5

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



[issue21253] Difflib

2014-04-16 Thread Nina Zakharenko

New submission from Nina Zakharenko:

When difflib.compare() is used on two moderately large sequences with little or 
no common elements, a RuntimeError: maximum recursion depth exceeded occurs. 

This error became apparent when testing another bug (see: issue 19217) in the 
AssertEquals() method of the unit test library.

A sample program to reproduce this issue in 3.4 is attached. To repo in 2.7 
remove the list() wrapper from the range call.

--
components: Library (Lib)
files: diff_bug34.py
messages: 216479
nosy: gregory.p.smith, nnja, r.david.murray
priority: normal
severity: normal
status: open
title: Difflib
type: crash
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file34911/diff_bug34.py

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



[issue21253] Difflib.compare() crashes when sequences contain little or no common elements

2014-04-16 Thread Nina Zakharenko

Changes by Nina Zakharenko nzakhare...@gmail.com:


--
title: Difflib - Difflib.compare() crashes when sequences contain little or no 
common elements

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



[issue19217] Calling assertEquals for moderately long list takes too long

2014-04-16 Thread Nina Zakharenko

Nina Zakharenko added the comment:

The cause of this has been identified as a bug in libdiff.compare(). See issue 
21253 for more information.

--
nosy: +nnja

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



[issue21238] unittest.mock.Mock should not allow you to use non-existent assert methods

2014-04-16 Thread Kushal Das

Kushal Das added the comment:

Patch with docs and test changes.

--
keywords: +patch
Added file: http://bugs.python.org/file34912/issue21238.patch

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



[issue21252] Lib/asyncio/events.py has tons of docstrings which are just XXX

2014-04-16 Thread Yury Selivanov

Yury Selivanov added the comment:

I had plans to copy some documentation from python docs to asyncio docstrings. 
I'll try to do this sometime this week. Thanks for reminding us about the issue!

--
assignee:  - yselivanov
nosy: +gvanrossum, haypo, yselivanov

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



[issue21252] Lib/asyncio/events.py has tons of docstrings which are just XXX

2014-04-16 Thread Guido van Rossum

Guido van Rossum added the comment:

My bad. But I think docstrings should NOT be just copies of the separate
docs.
On Apr 16, 2014 9:01 AM, Yury Selivanov rep...@bugs.python.org wrote:


 Yury Selivanov added the comment:

 I had plans to copy some documentation from python docs to asyncio
 docstrings. I'll try to do this sometime this week. Thanks for reminding us
 about the issue!

 --
 assignee:  - yselivanov
 nosy: +gvanrossum, haypo, yselivanov

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue21252
 ___


--

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



[issue21252] Lib/asyncio/events.py has tons of docstrings which are just XXX

2014-04-16 Thread Yury Selivanov

Yury Selivanov added the comment:

 My bad. But I think docstrings should NOT be just copies of the separate
docs.

I agree. I didn't want to blindly copy them, but rather use existing 
documentation as guidance  baseline.

--

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



[issue12523] 'str' object has no attribute 'more' [/usr/lib/python3.2/asynchat.py|initiate_send|245]

2014-04-16 Thread Caelyn McAulay

Caelyn McAulay added the comment:

I was unable to locate a point in the code where we could be certain that the 
error was ultimately caused by trying to use (unicode) strings instead of bytes 
object.

The patch adds a logging statement suggesting what the trouble is when the 
error is (probably) encountered.

Someone with more experience than me will need to make the call about whether 
this is a useful addition or not.

--
keywords: +patch
Added file: http://bugs.python.org/file34913/issue12523.patch

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



[issue12916] Add inspect.splitdoc

2014-04-16 Thread Yury Selivanov

Yury Selivanov added the comment:

OK, since it's two-and-a-half votes against one, let's do this. I'll do the 
final review of the patch and commit it.

--

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



[issue21254] PropertyMock refuses to raise AttributeErrror as a side effect

2014-04-16 Thread Michael Foord

New submission from Michael Foord:

What steps will reproduce the problem?

 import mock
 a_mock = mock.MagicMock()
 no_attribute = mock.PropertyMock(side_effect=AttributeError)
 type(a_mock).property = no_attribute



What is the expected output? What do you see instead?

I would expect the above to raise an AttributeError. Instead it returns a 
MagicMock instance.

 a_mock.property
MagicMock name='mock.property' id='140165240345424'

I would expect it to have the same effect as calling a PropertyMock with any 
other exception as a side effect:

 mock_value_error = mock.PropertyMock(side_effect=ValueError)
 type(a_mock).other_property = mock_value_error
 a_mock.other_property
Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/ahammel/bin/python/mock-1.0.1-py2.6.egg/mock.py, line 2365, in 
__get__
return self()
  File /home/ahammel/bin/python/mock-1.0.1-py2.6.egg/mock.py, line 955, in 
__call__
return _mock_self._mock_call(*args, **kwargs)
  File /home/ahammel/bin/python/mock-1.0.1-py2.6.egg/mock.py, line 1010, in 
_mock_call
raise effect
ValueError



What version of the product are you using? On what operating system?

Using version mock-1.0.1-py2.6 on CentOS 6.4



Please provide any additional information below.

PropertyMock objects apparently won't raise sublcasses of AttributeError either:

 class MockAttributeError(AttributeError): pass
... 
 no_attr = mock.PropertyMock(side_effect=MockAttributeError)
 type(a_mock).property = no_attr
 a_mock.property
MagicMock name='mock.property' id='140165240345424'

Works fine for subclasses of other Exceptions:

 class MockKeyError(KeyError): pass
... 
 no_key = mock.PropertyMock(side_effect=MockKeyError)
 type(a_mock).property = no_key
 a_mock.property
Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/ahammel/bin/python/mock-1.0.1-py2.6.egg/mock.py, line 2365, in 
__get__
return self()
  File /home/ahammel/bin/python/mock-1.0.1-py2.6.egg/mock.py, line 955, in 
__call__
return _mock_self._mock_call(*args, **kwargs)
  File /home/ahammel/bin/python/mock-1.0.1-py2.6.egg/mock.py, line 1010, in 
_mock_call
raise effect
__main__.MockKeyError

--
assignee: michael.foord
keywords: easy
messages: 216487
nosy: kushal.das, michael.foord
priority: normal
severity: normal
stage: needs patch
status: open
title: PropertyMock refuses to raise AttributeErrror as a side effect
type: behavior
versions: Python 3.4, Python 3.5

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



[issue21255] Attaching a PropertyMock records calls

2014-04-16 Thread Michael Foord

New submission from Michael Foord:

What steps will reproduce the problem?

 foo = Mock(name='foo')
 prop = PropertyMock(name='prop')
 type(foo).prop = prop
 foo.attach_mock(prop, 'prop')
 foo.mock_calls
[call.prop(PropertyMock name='foo.prop' id='4300017296')]

Expected:

 foo.mock_calls
[]

What version of the product are you using? On what operating system?

% pip freeze | grep mock
mock==1.0.1

OS X 10.8.4

Please provide any additional information below.

It would be even cooler if attaching a property mock made calls to the 
property appear in the mock_calls for the hosting mock without having to attach 
it, the way it does with a non-property method :)

I use mock every day now and am firmly of the opinion it is far, far more 
awesome than sliced bread. Thanks for making it available to the Python 
community :)

--
assignee: michael.foord
components: Library (Lib)
messages: 216488
nosy: kushal.das, michael.foord
priority: normal
severity: normal
stage: needs patch
status: open
title: Attaching a PropertyMock records calls
type: behavior
versions: Python 3.4, Python 3.5

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



[issue5420] Queue deprecation warning patch

2014-04-16 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Martin von Löwis successfully lobbied to keep these methods.

--
resolution:  - rejected
status: open - closed

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



[issue21015] support SSL_CTX_set_ecdh_auto on newer OpenSSLs

2014-04-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d6501421b86b by Antoine Pitrou in branch '3.4':
Try to fix buildbot failures on old OpenSSLs ( 1.0.0) - followup to issue 
#21015
http://hg.python.org/cpython/rev/d6501421b86b

New changeset 1305410bff2d by Antoine Pitrou in branch 'default':
Try to fix buildbot failures on old OpenSSLs ( 1.0.0) - followup to issue 
#21015
http://hg.python.org/cpython/rev/1305410bff2d

--

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



[issue21234] __contains__ and friends should check is for all elements first

2014-04-16 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee:  - rhettinger
nosy: +rhettinger

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



[issue21256] Sort keyword arguments in mock _format_call_signature

2014-04-16 Thread Michael Foord

New submission from Michael Foord:

Printing call args produces non-deterministic results, making them more or less 
useless in doctests.

kwargs_string = ', '.join([
'%s=%r' % (key, value) for key, value in kwargs.items()
])

should be:

kwargs_string = ', '.join([
'%s=%r' % (key, value) for key, value in sorted(kwargs.items())
])

--
assignee: michael.foord
keywords: easy
messages: 216491
nosy: kushal.das, michael.foord
priority: normal
severity: normal
stage: needs patch
status: open
title: Sort keyword arguments in mock _format_call_signature
type: behavior
versions: Python 3.5

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



[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread Stefan Krah

Stefan Krah added the comment:

It is hard to get fine grained error messages in _decimal, since
the errors come from libmpdec.  A clean solution would require
changes to libmpdec, and I'm reluctant to do that right now.

It is certainly possible to document DivisionImpossible etc.

--

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



[issue21015] support SSL_CTX_set_ecdh_auto on newer OpenSSLs

2014-04-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

So, I think I've found the issue. On OpenSSL  1.0.0, the ECDH ciphers exist 
but the ECDH cipher alias doesn't. I've committed a patch which should fix 
the issue, although the set_ciphers() call may be entirely useless given our 
current default cipher list.

--

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



[issue21257] Document parse_headers function of http.client

2014-04-16 Thread Senthil Kumaran

New submission from Senthil Kumaran:

It is undocumented. While fixing a doc issue issue18229 for http.server I 
noticed that I referenced that function and when I looked up for the 
documentation, it was lacking.

--
assignee: orsenthil
messages: 216494
nosy: orsenthil
priority: normal
severity: normal
status: open
title: Document parse_headers function of http.client
type: behavior
versions: Python 3.3, Python 3.4

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



[issue21015] support SSL_CTX_set_ecdh_auto on newer OpenSSLs

2014-04-16 Thread Ned Deily

Ned Deily added the comment:

That does indeed make the test now pass on OS X 10.9:

test_default_ecdh_curve (test.test_ssl.ThreadedTests) ...  server:  new 
connection from ('127.0.0.1', 60758)
 server: connection cipher is now ('AECDH-AES256-SHA', 'TLSv1/SSLv3', 256)
 server: selected protocol is now None
ok

Thsnks, Antoine!

--

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



[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread Stefan Krah

Stefan Krah added the comment:

Meanwhile, the pure Python decimal versions prior to Python 3.2
have better error messages.

Right now in Python 3.3+ it is hard to import the Python version
without going into contortions, but that may be fixed in #19232.

--
dependencies: +Speed up _decimal import

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



[issue21192] Idle: Print filename when running a file from editor

2014-04-16 Thread Adnan Umer

Adnan Umer added the comment:

I tried to replace RESTART by doing these little changing

# PyShell.Py
class ModifiedInterpreter(InteractiveInterpreter):
def restart_subprocess(self, with_cwd=False, with_msg=True):
...
if with_msg:
halfbar = ((int(console.width) - 16) // 2) * '='
console.write(halfbar + ' RESTART ' + halfbar)

def runcode(self, code):
with_msg = True
if code.co_filename[0] != '':
self.tkconsole.write('Executing ' + code.co_filename + '\n')
with_msg = False

if self.tkconsole.executing:
self.interp.restart_subprocess(with_msg)

# ScriptBinding.Py
class ScriptBinding:
def _run_module_event(self, event):
filename = self.getfilename()
if not filename:
return 'break'
code = self.checksyntax(filename)
if not code:
return 'break'
if not self.tabnanny(filename):
return 'break'
interp = self.shell.interp
if PyShell.use_subprocess:
interp.restart_subprocess(with_cwd=False, with_msg=False)

This works fine and replaces RESTART with Execute filename when file is 
executed in Python Shell.

Also instead of this

halfbar = ((int(console.width) - 16) // 2) * '='
console.write(halfbar + ' RESTART ' + halfbar)

my recomemdation is:
console.write('[SHELL RESTART]')

--

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



[issue21246] test_ssl handshake failure

2014-04-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This was fixed in #20896 by a certain Benjamin Peterson.

--
nosy: +pitrou
resolution:  - duplicate
status: open - closed
superseder:  - test_ssl.test_get_server_certificate() should use 
PROTOCOL_SSLv23, not PROTOCOL_SSLv3

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



[issue21015] support SSL_CTX_set_ecdh_auto on newer OpenSSLs

2014-04-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The buildbots seem happy as well, so I'm closing this.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue21247] test_asyncio: test_subprocess_send_signal hangs on Fedora builders

2014-04-16 Thread Orion Poplawski

Orion Poplawski added the comment:

We have determined that the koji builder is indeed setting the SIGHUP sigaction 
to SIG_IGN, which the python test is inheriting, and are working on trying to 
get that fixed.  However, it may be worth considering something like 
https://github.com/pexpect/pexpect/commit/1fbfddf33d196fd1f211fb95efdaa810b8b5dad3
 in the python tests to ensure that the test run properly in situations like 
this (I can imagine someone running them under nohup).

--

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



[issue21256] Sort keyword arguments in mock _format_call_signature

2014-04-16 Thread Eric Snow

Eric Snow added the comment:

Ordered kwargs anyone? :)

--
nosy: +eric.snow

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



[issue20896] test_ssl.test_get_server_certificate() should use PROTOCOL_SSLv23, not PROTOCOL_SSLv3

2014-04-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 55f62fa5bebc by Antoine Pitrou in branch 'default':
Issue #20896: ssl.get_server_certificate() now uses PROTOCOL_SSLv23, not 
PROTOCOL_SSLv3, for maximum compatibility.
http://hg.python.org/cpython/rev/55f62fa5bebc

--

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



[issue20896] test_ssl.test_get_server_certificate() should use PROTOCOL_SSLv23, not PROTOCOL_SSLv3

2014-04-16 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
resolution:  - fixed
status: open - closed

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



[issue21254] PropertyMock refuses to raise AttributeErrror as a side effect

2014-04-16 Thread Eric Snow

Eric Snow added the comment:

Perhaps related to #1615?

--
nosy: +eric.snow

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



[issue21256] Sort keyword arguments in mock _format_call_signature

2014-04-16 Thread Kushal Das

Kushal Das added the comment:

Patch uploaded for the same.

--
keywords: +patch
Added file: http://bugs.python.org/file34914/issue21256.patch

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



[issue15002] urllib2 does not download 4 MB file completely using ftp

2014-04-16 Thread Christian Theune

Changes by Christian Theune c...@gocept.com:


--
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3

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



[issue17218] support title and description in argparse add_mutually_exclusive_group

2014-04-16 Thread paul j3

paul j3 added the comment:

While mutually exclusive groups are a subclass of argument groups, they have 
very different uses.

Argument groups are used solely to organize the help section. Groups are not 
used at all during parsing.  'parse_args' doesn't even pay attention to those 2 
default groups (positionals and optionals).  'parse_args' just uses the master 
list of actions ('parser._actions'). 

Mutually exclusive groups are not used at all while formatting the help lines.  
They are used to format the usage line.  They also implement argument tests 
during parsing.

Groups are not set up for nesting.  However it is possible to define a mutually 
exclusive group within an argument group, and effectively give it a title and 
description.

p=argparse.ArgumentParser()
g=p.add_argument_group('title')
g1=g.add_mutually_exclusive_group()
g1.add_argument('--foo')
p.print_help()

producing:

usage: ipython [-h] [--foo FOO]
optional arguments:
  -h, --help  show this help message and exit
title:
  --foo FOO

Both kinds of groups are a superficial addition to argparse.  I argue in 
http://bugs.python.org/issue11588 that they aren't adequate for handling more 
complicated groupings (inclusive, nesting, etc).

While I'm not convinced the change proposed in this issue is necessary, if we 
are going implement it, I'd suggest a simple addition to 
'add_mutually_exclusive_group()'.  If there's a title argument, add this group 
to '_action_groups' as well as '_mutually_exclusive_groups'.

def add_mutually_exclusive_group(self, **kwargs):
group = _MutuallyExclusiveGroup(self, **kwargs)
self._mutually_exclusive_groups.append(group)
try:
kwargs.title
self._action_groups.append(group)
except AttributeError:
pass
return group

This should do the job without adding much complexity.

--

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



[issue18879] tempfile.NamedTemporaryFile can close the file too early, if not assigning to a variablwe

2014-04-16 Thread Christian Theune

Christian Theune added the comment:

#15002 uses this patch to fix a similar wrapping problem in urllib.

Also, this affects 2.7 as well and #15002 does report the problem for 2.7. I'd 
like to get this fix backported. Would that be OK?

--
nosy: +ctheune
title: tempfile.NamedTemporaryFile can close the file too early, if not 
assigning to a variable - tempfile.NamedTemporaryFile can close the file too 
early, if not assigning to a variablwe
versions: +Python 2.7, Python 3.5 -Python 3.3

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



[issue15002] urllib2 does not download 4 MB file completely using ftp

2014-04-16 Thread Christian Theune

Christian Theune added the comment:

I wasn't able to come up with a good testcase. :(

I tried similar approaches as in #18879 but I wasn't able to make them trigger 
the behaviour as it also seems to be an issue regarding actual network 
performance ... :/

Backport to 2.7 is currently missing as I'd need #18879 to be backported. If 
that is OK (I'd like to have this in 2.7) then I'd be happy to port both.

--

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



[issue15002] urllib2 does not download 4 MB file completely using ftp

2014-04-16 Thread Christian Theune

Changes by Christian Theune c...@gocept.com:


--
hgrepos: +237

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



[issue15002] urllib2 does not download 4 MB file completely using ftp

2014-04-16 Thread Thomas Wouters

Changes by Thomas Wouters tho...@python.org:


--
stage: needs patch - patch review

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



[issue15002] urllib2 does not download 4 MB file completely using ftp

2014-04-16 Thread Christian Theune

Christian Theune added the comment:

Antoine, I'm adding you here as I'm leveraging your patch from #18879. 

I'd need some feedback about the backport, but this patch should be OK for 3.4. 
Also, if you had an idea how to test this - I tried, but failed so far.

--

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



[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread leewz

leewz added the comment:

Fine grained? Do you mean that the error can't be distinguished from other such 
errors? Or that it's difficult to attach the message to DivisionError? I 
thought DivisionError was always about precision.

I looked up the error in libmpdec:
This occurs and signals invalid-operation if the integer result of a 
divide-integer or remainder operation had too many digits (would be longer than 
precision). The result is [0,qNaN]. 
(http://speleotrove.com/decimal/daexcep.html)

Now I'm more confused. Though it mentions precision, it is talking about the 
*result's* precision being too large (something which shouldn't happen with 
Python's unbounded ints, right?), rather than being unable to give a sane 
answer due to not having *enough* digits. That's also what the 2.7 error is:
decimal.InvalidOperation: quotient too large in //, % or divmod

I'm very much content with documenting it, but if possible, I'd like to 
understand whether this is an issue to take up with libmpdec.

P.S.: As a side-note to others, Python floats allows float%int even when 
precision isn't high enough, and seems to always returns 0.0 with no warning. 
So behavior is inconsistent, if that's important to anyone here.

--

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



[issue15002] urllib2 does not download 4 MB file completely using ftp

2014-04-16 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Christian , with respect to patch, I agree with the logic (using something 
similar to #18879). Does all current unittests succeed with this? (I suspect 
not) A unittest for coverage would be helpful.

--

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



[issue15002] urllib2 does not download 4 MB file completely using ftp

2014-04-16 Thread Christian Theune

Changes by Christian Theune c...@gocept.com:


--
keywords: +patch
Added file: http://bugs.python.org/file34915/d3c6ab639306.diff

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



[issue15002] urllib2 does not download 4 MB file completely using ftp

2014-04-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Well, this looks ok on the principle, but I haven't investigated the 
urllib-specific parts, so I'll let Senthil delve into this :)

--

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




[issue17752] many distutils tests fail when run from the installed location

2014-04-16 Thread Thomas Wouters

Thomas Wouters added the comment:

Matthias, I think this is already fixed for Python 3.3 and later (at least.) 
There may still be problems in 2.7, but I'm not sure if it's worth fixing them 
there. Can you see if you still have problems, and if so, show us how to 
reproduce them? (Is it just 'python -m test.regrtest'? Is it just 
test_distutils or also other tests?)

--
nosy: +twouters
versions: +Python 2.7 -Python 3.3, Python 3.4

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



[issue21256] Sort keyword arguments in mock _format_call_signature

2014-04-16 Thread Michael Foord

Michael Foord added the comment:

Yes to ordered kwargs! I would very much like to be able to order the keyword 
args in the order they were passed in, information which is currently lost.

--

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



[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

On mer., 2014-04-16 at 08:06 +, STINNER Victor wrote:
 I didn't check which objects use (indirectly) _PyObject_GC_Calloc().

I've checked: lists, tuples, dicts and sets at least seem to use it.
Obviously, objects which are not tracked by the GC (such as str and
bytes) won't use it.

--

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



[issue17449] dev guide appears not to cover the benchmarking suite

2014-04-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Jeff: yes it could :) Do you want to provide a patch?

--

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



[issue21068] Make ssl.PROTOCOL_* an enum

2014-04-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Anyone else has an opinion on this?

--

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



[issue2159] dbmmodule inquiry function is performance prohibitive

2014-04-16 Thread Eric Olson

Eric Olson added the comment:

New patch with Pep 7 fix - no c++ // style comments. -Thanks johansen.

--
Added file: http://bugs.python.org/file34916/dbm_bool_d.patch

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



[issue21238] unittest.mock.Mock should not allow you to use non-existent assert methods

2014-04-16 Thread Michael Foord

Michael Foord added the comment:

It needs a NEWS entry, but looks good to me.

--

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



[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-16 Thread Steven Hiscocks

Steven Hiscocks added the comment:

Issue where I hit this is in Fail2Ban: 
https://github.com/fail2ban/fail2ban/issues/687

Lines of code where this occurs: 
https://github.com/fail2ban/fail2ban/blob/1c65b946171c3bbc626ddcd9320ea2515018677b/fail2ban/server/server.py#L518-530

There are other examples of closing file descriptors in other packages which 
create daemon processes, as well as code snippets about, as it is typical 
behaviour to close files. 
(http://en.wikipedia.org/wiki/Daemon_%28computing%29#Creation)

--

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



[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread Stefan Krah

Stefan Krah added the comment:

My apologies if that wasn't clear: fine grained refers to the exception
messages.  A function can raise InvalidOperation for different reasons.

decimal.py gives a specific error message in each case. libmpdec just
signals the standard conforming InvalidOperation.

The relevant passage from the standard is here:

http://speleotrove.com/decimal/daops.html#refremain

  This operation will fail under the same conditions as integer division.

decimal.py, decNumber and libmpdec all do the same thing, so there is no
libmpdec issue other than that the error *messages* could be improved.

I fully understand if you find the behavior surprising (after all the remainder
fits in the precision), but as long as we follow the standard we can't change
that.

--

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



  1   2   3   >