[issue19772] str serialization of Message object may mutate the payload and CTE.

2014-02-08 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Actually, I am thinking of this approach (cloning the message just after 
entering the flatten method):

diff -r b541ecd32115 Lib/email/generator.py
--- a/Lib/email/generator.pyFri Feb 07 16:11:17 2014 -0800
+++ b/Lib/email/generator.pySat Feb 08 15:55:01 2014 +0800
@@ -67,7 +67,7 @@
 # Just delegate to the file object
 self._fp.write(s)
 
-def flatten(self, msg, unixfrom=False, linesep=None):
+def flatten(self, msg_obj, unixfrom=False, linesep=None):
 r"""Print the message object tree rooted at msg to the output file
 specified when the Generator instance was created.
 
@@ -86,6 +86,8 @@
 # from the msg, and _encoded_XXX constants for operating on data that
 # has already been converted (to bytes in the BytesGenerator) and
 # inserted into a temporary buffer.
+import copy
+msg = copy.copy(msg_obj)
 policy = msg.policy if self.policy is None else self.policy
 if linesep is not None:
 policy = policy.clone(linesep=linesep)

It works for this bug but apparently it fails one test.

==
FAIL: test_make_boundary (__main__.TestMessageAPI)
--
Traceback (most recent call last):
  File "Lib/test/test_email/test_email.py", line 199, in test_make_boundary
'multipart/form-data; boundary="==')
AssertionError: 'multipart/form-data' != 'multipart/form-data; boundary="=='
- multipart/form-data
+ multipart/form-data; boundary="==

So somehow, according to the ultimate design of email library, msg can not 
leave flatten method unscratched. :)

--

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-02-08 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the updated patch for gc module based on Zachary's review.

--
Added file: http://bugs.python.org/file33988/clinic_gc_v4.patch

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-02-08 Thread Vajrasky Kok

Changes by Vajrasky Kok :


Removed file: http://bugs.python.org/file33954/clinic_longobject_v2.patch

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-02-08 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the updated patch for long object based on Zachary's review.

--
Added file: http://bugs.python.org/file33989/clinic_longobject_v3.patch

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-02-08 Thread Vajrasky Kok

Changes by Vajrasky Kok :


Removed file: http://bugs.python.org/file33951/clinic_gc_v3.patch

___
Python tracker 

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



[issue20546] Use specific asserts in int tests

2014-02-08 Thread Mark Dickinson

Mark Dickinson added the comment:

Looks fine to me.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue14130] memoryview: add multi-dimensional indexing and slicing

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

memoryview supports slicing - it just doesn't support NumPy style 
*multi-dimensional* slicing (and buffer doesn't support that either).

--

___
Python tracker 

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



[issue14130] memoryview: add multi-dimensional indexing and slicing

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

(However, if you're on Python 3.2, then you'll likely need to upgrade to Python 
3.3 - memoryview *does* have a lot of additional limitations in Python 3.2)

--

___
Python tracker 

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



[issue20538] Segfault in UTF-7 incremental decoder

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Patches look good to me.

--

___
Python tracker 

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



[issue20167] Exception on IDLE closing

2014-02-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I checked that -m idlelib acts the same as -m idlelib.idle, and that there is 
still a problem after opening a second editor window after the original. So the 
messages seem tied to not opening a shell window. In testing the patch, I 
noticed that exceptions are now occurring in all three .__del__ methods. With 
the candidate release imminent, I decided to only fix what is broken and only 
apply to 3.4 and not worry now about possible merge problems in the future.

--
assignee:  -> terry.reedy

___
Python tracker 

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



[issue20478] Avoid inadvertently special casing Counter in statistics module

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 78d0b7472697 by Nick Coghlan in branch 'default':
Issue #20478: avoid special casing Counter in statistics
http://hg.python.org/cpython/rev/78d0b7472697

--
nosy: +python-dev

___
Python tracker 

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



[issue20167] Exception on IDLE closing

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f9f2c57f7d00 by Terry Jan Reedy in branch 'default':
Issue #20167: Suppress 3.4 specific 'Exception ignored' messages.
http://hg.python.org/cpython/rev/f9f2c57f7d00

--
nosy: +python-dev

___
Python tracker 

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



[issue20478] Avoid inadvertently special casing Counter in statistics module

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Committed on your behalf Steven, since I'm still not sure if your SSH key has 
been registered yet.

--
resolution:  -> fixed
stage: test needed -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20481] Clarify type coercion rules in statistics module

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Claiming to commit before 3.4rc1 (as I believe Steven's SSH key still needs to 
be added)

--
assignee: stevenjd -> ncoghlan

___
Python tracker 

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



[issue20389] clarify meaning of xbar and mu in pvariance/variance of statistics module

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Steven included some draft docs updates in a separate patch for issue 20481 - I 
have split those out and uploaded them here (since this discussion refers to 
the docstrings as well).

--
keywords: +patch
nosy: +ncoghlan
Added file: http://bugs.python.org/file33990/issue20389_statistics_docs.diff

___
Python tracker 

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



[issue19145] Inconsistent behaviour in itertools.repeat when using negative times

2014-02-08 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the ultimate patch for this bug. The doc fix is based on Larry's 
writing: https://mail.python.org/pipermail/python-dev/2014-January/132156.html

I made sure the patch could be compiled by Sphinx and displayed nicely. I added 
test and comment in the code.

--
Added file: 
http://bugs.python.org/file33991/ultimate_solution_for_negative_times_via_keyword_behaviours.patch

___
Python tracker 

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



[issue20481] Clarify type coercion rules in statistics module

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5db74cd953ab by Nick Coghlan in branch 'default':
Close #20481: Disallow mixed type input in statistics
http://hg.python.org/cpython/rev/5db74cd953ab

--
nosy: +python-dev
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20560] tkFileFilter.c: ostypeCount not initialized?

2014-02-08 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Fresh Win7 VC express debug build (F7), 2.7 only: fairly recent (last 3 
months?) regression.

In debug console, import idlelib.idle. Try to Open a file. Get message that 
ostypeCount is used before initialized. If open python_d with F5 in VC, [break] 
takes me to VS debugger, which points to line 341 in tkFileFilter.c (where is 
that in the directory tree?).
if (ostypeCount > 0 && ostypeList != NULL) {
I am slightly puzzled because it appears that line 234
for (i=0; i

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



[issue20560] tkFileFilter.c: ostypeCount not initialized?

2014-02-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

If I start the 2.7 console directly instead of under the debugger, I can ignore 
the message and open a file and everything *seems* normal. Most users would be 
less comfortable doing that, but I presume the message would not appear in a 
release build.

--

___
Python tracker 

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



[issue20558] ECONNRESET value in logging.config is valid with Linux [distros]; not valid with *BSD

2014-02-08 Thread Vinay Sajip

Vinay Sajip added the comment:

There's a small possibility that someone could be relying on 
logging.config.RESET_ERROR being present, so I think it makes more sense to:

1. Leave RESET_ERROR as a module attribute, but set it unconditionally to
   errno.ECONNRESET.

2. Use e.errno rather than e.args[0], and compare it against RESET_ERROR
   since that's available, in the exception suite.

--

___
Python tracker 

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



[issue20481] Clarify type coercion rules in statistics module

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

OK, I committed a slight variant of Steven's patch:

- I moved the issue 20389 doc changes to a separate patch that I uploaded over 
there

- Steven had marked one of the tests as potentially obsolete, I just removed it 
entirely. If we decide we eventually want it back, it's still there in the VCS 
history :)

--

___
Python tracker 

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



[issue20538] Segfault in UTF-7 incremental decoder

2014-02-08 Thread STINNER Victor

STINNER Victor added the comment:

Maybe you can a new truncate operation to unicode writer? As you want.

The patch looks good to me.

--

___
Python tracker 

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



[issue20561] Decimal handling error in statistics module

2014-02-08 Thread Wolfgang Maier

New submission from Wolfgang Maier:

Can this still be fixed in 3.4 ??

I came across this bug in the statistics module today:

>>> import statistics
>>> data = [Decimal('1e4')]
>>> statistics.mean(data)
Traceback (most recent call last):
  File "", line 1, in 
statistics.mean(data)
  File "C:/Python33\statistics.py", line 316, in mean
return _sum(data)/n
  File "C:/Python33\statistics.py", line 167, in _sum
total += Fraction(n, d)
  File "C:\Python33\lib\fractions.py", line 163, in __new__
raise TypeError("both arguments should be "
TypeError: both arguments should be Rational instances

The reason for this is that the statistics module converts Decimals to exact 
ratios internally like this:

def _decimal_to_ratio(d):
"""Convert Decimal d to exact integer ratio (numerator, denominator).

>>> from decimal import Decimal
>>> _decimal_to_ratio(Decimal("2.6"))
(26, 10)

"""
sign, digits, exp = d.as_tuple()
if exp in ('F', 'n', 'N'):  # INF, NAN, sNAN
assert not d.is_finite()
raise ValueError
num = 0
for digit in digits:
num = num*10 + digit
if sign:
num = -num
den = 10**-exp
#if type(den) != int:
#print (d, sign, digits, exp, num, den)
return (num, den)

The important part here is the line:

den = 10**-exp

which makes den an int if - and **only** if - exp is negative.

However, the exponent in the namedtuple returned by Decimal.as_tuple() is not 
guaranteed to be negative and in fact:

>>>Decimal('1e4').as_tuple()
DecimalTuple(sign=0, digits=(1,), exponent=4)

With this den in the above function becomes a float, which raises an error 
subsequently in _sum, when it essentially tries to do:
Fraction(num, den)

IMPORTANT: I have been running this example on my laptop with Python3.3.0 and 
the statistics module imported from sys.path.
Thus, I cannot exclude that the decimal module has changed since 3.3.0 and is 
now always returning a negative exponent with
.as_tuple(). I'm abroad and cannot verify this against the Python3.4dev build.
Could somebody confirm this for 3.4 and reject this issue immediately if the 
error doesn't occur ?

If this is not version dependent though, then there is a very simple bug-fix 
for it, which I suggest should still be incorporated into 3.4:

if exp >= 0:
return int(x), 1

inserted right after the raise ValueError line is doing the job.
I cannot generate the diff for this myself, so could somebody do this.

Thanks a lot for your efforts!

--
messages: 210613
nosy: oscarbenjamin, python-dev, skrah, stevenjd, wolma
priority: normal
severity: normal
status: open
title: Decimal handling error in statistics module
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue18805] ipaddress netmask/hostmask parsing bugs

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

I've found the patch Peter mentions above (git diff HEAD^ on ipaddress-py), and 
will apply it to 3.3 and default.

--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue20561] Decimal handling error in statistics module

2014-02-08 Thread Wolfgang Maier

Wolfgang Maier added the comment:

#if type(den) != int:
#print (d, sign, digits, exp, num, den)

was inserted by me of course for debugging this. Forgot to take it out again.

--

___
Python tracker 

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



[issue18805] ipaddress netmask/hostmask parsing bugs

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Oh, that's annoying - it doesn't apply cleanly to the stdlib version, even 
after adjusting the filenames :P

--

___
Python tracker 

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



[issue20561] Decimal handling error in statistics module

2014-02-08 Thread Wolfgang Maier

Changes by Wolfgang Maier :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue20561] Decimal handling error in statistics module

2014-02-08 Thread Stefan Krah

Stefan Krah added the comment:

This looks like a duplicate of #20536.  Steven, do you think you
have a chance to fix this before rc1?

--
keywords: +3.4regression

___
Python tracker 

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



[issue20561] Decimal handling error in statistics module

2014-02-08 Thread Stefan Krah

Changes by Stefan Krah :


--
keywords:  -3.4regression

___
Python tracker 

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



[issue20516] Concurrent.futures base concurrency improvement (with patch)

2014-02-08 Thread Charles-François Natali

Charles-François Natali added the comment:

Just a quick comment on the patch: in as_completed(), if the future is 
cancelled or finished, control is yielded back to the caller with the 
condition's lock held.
As a general rule, libraries should not yield control to the caller with a lock 
held, because depending on what the client does, this can lead to a deadlock. 
For example, Future.__repr__() acquires the future's lock: since the current 
implementation uses a reentrant lock, it won't cause a deadlock if called from 
the same thread, but it could deadlock e.g. if another thread called a similar 
method which acquires this lock.
Also, more generally, when you hold an object's lock it's to make sure that 
it's always seen in a consistent state, and yielding control to the user means 
that it can potentially see it in an inconsistent state.

See e.g. the excellent "Java Concurrency in Practice", or "Effective Java" for 
more details.

--
nosy: +neologix

___
Python tracker 

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



[issue20538] Segfault in UTF-7 incremental decoder

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8d40d9cee409 by Serhiy Storchaka in branch '3.3':
Issue #20538: UTF-7 incremental decoder produced inconsistant string when
http://hg.python.org/cpython/rev/8d40d9cee409

New changeset e988661e458c by Serhiy Storchaka in branch 'default':
Issue #20538: UTF-7 incremental decoder produced inconsistant string when
http://hg.python.org/cpython/rev/e988661e458c

--
nosy: +python-dev

___
Python tracker 

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



[issue20538] Segfault in UTF-7 incremental decoder

2014-02-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Nick and Victor for your reviews.

As far as there is only one place where truncating unicode writer is needed, I 
don't think this is worth special function.

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

___
Python tracker 

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



[issue20516] Concurrent.futures base concurrency improvement (with patch)

2014-02-08 Thread Glenn Langford

Glenn Langford added the comment:

> if the future is cancelled or finished, control is yielded back to the caller 
> with the condition's lock held.

Hmmm...I don't agree. I assume you are looking at this code:

with f._condition: # Lock the Future; yield if completed or add our Waiter
if f._state in [CANCELLED_AND_NOTIFIED, FINISHED]:
yield f

Note that the context manager will be called in this case to release the lock 
before f is yielded to the caller.

class MiniContext():
def __init__(self):
pass

def __enter__(self):
print('Hello')

def __exit__(self, *args):
print('Goodbye')

def gen():
with MiniContext():
yield 1

print(next(gen()))

prints:

Hello
Goodbye
1

--

___
Python tracker 

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



[issue20562] sqlite3 returns result set with doubled first entry

2014-02-08 Thread Johnny Wezel

New submission from Johnny Wezel:

I could isolate a bug where sqlite3 returns a result set from a select where 
the first entry occurs twice.

>>> sys.version_info  
sys.version_info(major=2, minor=7, micro=5, releaselevel='final', serial=0)
>>> import sqlite3
>>> sqlite3.version_info
(2, 6, 0)

$ uname -a
Linux 3.10.25-gentoo #1 SMP PREEMPT Wed Jan 29 18:05:47 CET 2014 x86_64 
Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz GenuineIntel GNU/Linux

--
components: Extension Modules
files: t.py
messages: 210622
nosy: jwezel
priority: normal
severity: normal
status: open
title: sqlite3 returns result set with doubled first entry
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file33992/t.py

___
Python tracker 

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



[issue20534] Enum tests fail with pickle protocol 4

2014-02-08 Thread Ethan Furman

Ethan Furman added the comment:

The only thing I hate more than being wrong is being wrong because Python isn't 
acting the way I think it should.  :/

So, __qualname__ is not set properly when using the function API (although it 
has nothing to do with manually setting __module__ (I removed it, tested, no 
difference)).

And, if a subclass defines __reduce__, but an ancestor class defines 
__reduce_ex__, the ancestor class wins -- this seems to completely defeat the 
purpose of subclassing.

I'll add a 'qualname' parameter (mirroring the 'module' parameter) to the 
function API, and I'll use __reduce_ex__.

A little experimenting shows that if the base class implements any of 
__reduce__, __reduce_ex__, __getnewargs__, or __getnewargs_ex__ that pickling 
will work, so modified that portion of Enum as well.

--
nosy: +eli.bendersky
resolution: fixed -> 
Added file: http://bugs.python.org/file33993/issue20534.stoneleaf.03.patch

___
Python tracker 

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



[issue20561] Decimal handling error in statistics module

2014-02-08 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On Sat, Feb 08, 2014 at 11:29:29AM +, Stefan Krah wrote:
> This looks like a duplicate of #20536.  Steven, do you think you
> have a chance to fix this before rc1?

Working on it now. Should have a patch and regression tests in 15 
minutes, I'll post it on 20536.

--

___
Python tracker 

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



[issue18805] ipaddress netmask/hostmask parsing bugs

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

OK, what I have done is translated the new *tests* from the upstream patch to 
the standard library tests, and then used the upstream functional patch as a 
guide for fixing the standard library version.

I'll upload the final patch here, but I won't wait for review before committing 
it (I'd like to ensure it makes the 3.4rc1 tag tomorrow).

--

___
Python tracker 

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



[issue20546] Use specific asserts in int tests

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e47c46ede37e by Serhiy Storchaka in branch '2.7':
Issue #20546: Use specific asserts in int tests.
http://hg.python.org/cpython/rev/e47c46ede37e

New changeset 265446b8b48c by Serhiy Storchaka in branch '3.3':
Issue #20546: Use specific asserts in int tests.
http://hg.python.org/cpython/rev/265446b8b48c

New changeset 79ddfbea25d7 by Serhiy Storchaka in branch 'default':
Issue #20546: Use specific asserts in int tests.
http://hg.python.org/cpython/rev/79ddfbea25d7

--
nosy: +python-dev

___
Python tracker 

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



[issue20549] Use specific asserts in mailbox, smtplib and poplib tests

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1c3fcba31708 by Serhiy Storchaka in branch '2.7':
Issue #20549: Use specific asserts in mailbox, smtplib and poplib tests.
http://hg.python.org/cpython/rev/1c3fcba31708

New changeset bd1d6916b689 by Serhiy Storchaka in branch '3.3':
Issue #20549: Use specific asserts in mailbox, smtplib and poplib tests.
http://hg.python.org/cpython/rev/bd1d6916b689

New changeset 2e5e66f9e228 by Serhiy Storchaka in branch 'default':
Issue #20549: Use specific asserts in mailbox, smtplib and poplib tests.
http://hg.python.org/cpython/rev/2e5e66f9e228

--
nosy: +python-dev

___
Python tracker 

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



[issue20555] Use specific asserts in urllib related tests

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b21397ca58c7 by Serhiy Storchaka in branch '2.7':
Issue #20555: Use specific asserts in urllib, httplib, ftplib, cgi, wsgiref 
tests.
http://hg.python.org/cpython/rev/b21397ca58c7

New changeset b6f8d5148a05 by Serhiy Storchaka in branch '3.3':
Issue #20555: Use specific asserts in urllib, httplib, ftplib, cgi, wsgiref 
tests.
http://hg.python.org/cpython/rev/b6f8d5148a05

New changeset 868675190b34 by Serhiy Storchaka in branch 'default':
Issue #20555: Use specific asserts in urllib, httplib, ftplib, cgi, wsgiref 
tests.
http://hg.python.org/cpython/rev/868675190b34

--
nosy: +python-dev

___
Python tracker 

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



[issue20534] Enum tests fail with pickle protocol 4

2014-02-08 Thread Ethan Furman

Ethan Furman added the comment:

Serhiy commented:
-
> Actually they don't pickle due to wrong __module__. After adding
> 
>NEI.__module__ = NamedInt.__module__ = __name__
> 
> PicklingError no longer raised for enum class.

If you were to look at the `_make_class_unpicklable` function you would see it 
works by setting __module__ to .  So, in fact, it does not pickle 
precisely because it has the wrong module, and your change undoes what Enum was 
tryng to do: if an instance cannot be pickled, don't let the class be pickled 
either.

--

___
Python tracker 

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



[issue20516] Concurrent.futures base concurrency improvement (with patch)

2014-02-08 Thread Charles-François Natali

Charles-François Natali added the comment:

> Note that the context manager will be called in this case to release the
lock before f is yielded to the caller.
>
> class MiniContext():
> def __init__(self):
> pass
>
> def __enter__(self):
> print('Hello')
>
> def __exit__(self, *args):
> print('Goodbye')
>
> def gen():
> with MiniContext():
> yield 1
>
> print(next(gen()))
>
> prints:
>
> Hello
> Goodbye
> 1

Actually, I think what you're seeing here is the context manager being
garbage collected right after the call to next(), and therefore before the
call to print(), because no reference to it is kept. So __exit__() is
called right away.

But if you rewrite it like this:

"""
for e in gen():
print(e)
"""

You see:
"""
Hello
1
Goodbye
"""

It would be suprising if __exit__() got called before exit of the syntactic
block, just imagine what would happen with the following code:
"""
def read_file(path):
with open(path) as f:
for line in f:
yield line
"""

if the file was closed before yielding.

--

___
Python tracker 

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



[issue18805] ipaddress netmask/hostmask parsing bugs

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ca5ea7c24370 by Nick Coghlan in branch '3.3':
Issue #18805: better netmask validation in ipaddress
http://hg.python.org/cpython/rev/ca5ea7c24370

New changeset 90dfb26869a7 by Nick Coghlan in branch 'default':
Merge fix for #18805 from 3.3
http://hg.python.org/cpython/rev/90dfb26869a7

--
nosy: +python-dev

___
Python tracker 

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



[issue18805] ipaddress netmask/hostmask parsing bugs

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Attaching my patch for reference (although I just realised I need to tweak the 
NEWS entry slightly to indicate that valid prefixes that were previously 
rejected are now accepted).

Sorry we weren't able to make use of your patch Jon, but thanks for the 
detailed description of the parsing problems!

--
Added file: http://bugs.python.org/file33994/issue18805_standard_library.diff

___
Python tracker 

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



[issue20536] statistics._decimal_to_ratio() produces non-integer ratio

2014-02-08 Thread Steven D'Aprano

Steven D'Aprano added the comment:

See also issue 20561, which is a duplicate of this.

Fix and tests for this in the attached patch. Could somebody please commit it 
for me, my ssh key apparently hasn't been registered yet.

--
assignee:  -> stevenjd
keywords: +patch
nosy: +larry
priority: high -> release blocker
resolution:  -> fixed
Added file: http://bugs.python.org/file33995/decimal_to_ratio.patch

___
Python tracker 

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



[issue20534] Enum tests fail with pickle protocol 4

2014-02-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't know if this was discussed, but as far as enums will be used for 
platform depending constants (as ENOENT or AF_UNIX), I think that enums should 
be pickled by name, not by value. Here is the __reduce_ex__ implementation:

def __reduce_ex__(self, proto):
if proto < 4:
return getattr, (self.__class__, self._name_)
return self.__class__.__qualname__ + '.' + self._name_

--

___
Python tracker 

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



[issue20555] Use specific asserts in urllib related tests

2014-02-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Giampaolo.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20549] Use specific asserts in mailbox, smtplib and poplib tests

2014-02-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review David.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20546] Use specific asserts in int tests

2014-02-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Mark.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue18805] ipaddress netmask/hostmask parsing bugs

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 19ca11099f07 by Nick Coghlan in branch '3.3':
Fix #18805 NEWS entry
http://hg.python.org/cpython/rev/19ca11099f07

New changeset e0b1c937e57c by Nick Coghlan in branch 'default':
Merge #18805 NEWS fix from 3.3
http://hg.python.org/cpython/rev/e0b1c937e57c

--

___
Python tracker 

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



[issue19363] Python 2.7's future_builtins.map is not compatible with Python 3's map

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Switched to be a docs-only bug as Gareth suggested.

--
assignee: rhettinger -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python, ncoghlan
resolution: wont fix -> 
stage: committed/rejected -> needs patch

___
Python tracker 

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



[issue18805] ipaddress netmask/hostmask parsing bugs

2014-02-08 Thread Nick Coghlan

Changes by Nick Coghlan :


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

___
Python tracker 

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



[issue20563] Mark ipaddress as stable?

2014-02-08 Thread Nick Coghlan

New submission from Nick Coghlan:

Peter, with issue 18805 fixed, what do you think about removing the provisional 
status from the ipaddress API?

Aside from issue 19157 (where I'm not sure the behaviour even needs changing), 
the other open ipaddress issues appear to be docs related or RFEs.

At this point, making ipaddress subject to the usual backwards compatibility 
guarantees seems fairly low risk.

--
assignee: pmoody
messages: 210641
nosy: larry, ncoghlan, pmoody
priority: normal
severity: normal
stage: commit review
status: open
title: Mark ipaddress as stable?
type: enhancement
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue20516] Concurrent.futures base concurrency improvement (with patch)

2014-02-08 Thread Glenn Langford

Glenn Langford added the comment:

> Actually, I think what you're seeing here is the context manager being
garbage collected

Yes indeed, I am with you now. Thanks for identifying the problem, and for your 
explanation. The future should not be yielded while locked.

--

___
Python tracker 

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



[issue20536] statistics._decimal_to_ratio() produces non-integer ratio

2014-02-08 Thread Nick Coghlan

Changes by Nick Coghlan :


--
assignee: stevenjd -> ncoghlan
nosy: +ncoghlan

___
Python tracker 

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



[issue20545] Use specific asserts in unicode tests

2014-02-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Removed redundant information from error messages in multibyte codec tests.

--
Added file: http://bugs.python.org/file33996/test_unicode_asserts_2.patch

___
Python tracker 

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



[issue20536] statistics._decimal_to_ratio() produces non-integer ratio

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0f9309f8c755 by Nick Coghlan in branch 'default':
Close #20536: correctly handle Decimal exponents in statistics
http://hg.python.org/cpython/rev/0f9309f8c755

--
nosy: +python-dev
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20561] Decimal handling error in statistics module

2014-02-08 Thread Nick Coghlan

Changes by Nick Coghlan :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> statistics._decimal_to_ratio() produces non-integer ratio

___
Python tracker 

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



[issue20534] Enum tests fail with pickle protocol 4

2014-02-08 Thread Ethan Furman

Ethan Furman added the comment:

I do not recall if it was or not.  The main difference would be in how aliases 
were handled.  For example, if W and Z were the same value on system A, but 
different on system B, then going from A - B via pickle W and Z would still be 
the same using the current methods (pickling by value).

Considering that on system A, W and Z are two names for the exact same object, 
and that with SomeEnum(xx) the 'xx' is a value, how could we pickle just the 
name and be able to unpickle on sytem B?

--

___
Python tracker 

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



[issue20553] Use specific asserts in ipaddress tests

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Changes look fine to me - I did just check in some other updates to 
test_ipaddress, but I believe they're far enough away from these that the patch 
should still apply.

--

___
Python tracker 

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



[issue20406] Use application icon for IDLE

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bda1739215b4 by Terry Jan Reedy in branch '3.3':
Issue #20406: Use Python application icons for Idle window title bars.
http://hg.python.org/cpython/rev/bda1739215b4

New changeset 3aa6fd1dc2c9 by Terry Jan Reedy in branch 'default':
Issue #20406: Use Python application icons for Idle window title bars.
http://hg.python.org/cpython/rev/3aa6fd1dc2c9

--
nosy: +python-dev

___
Python tracker 

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



[issue19772] str serialization of Message object may mutate the payload and CTE.

2014-02-08 Thread R. David Murray

R. David Murray added the comment:

I'm guessing the problem is that copy is a shallow copy, and message objects 
can be deeply nested.  Doing a deepcopy might work, but as things are 
currently, that could cost a lot of memory, so I don't want to do that.

--

___
Python tracker 

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



[issue20406] Use application icon for IDLE

2014-02-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

For 2.7, this substitution
#root.wm_iconphoto(True, *icons)
root.tk.call('wm', 'iconphoto', str(root), "-default", *icons)
does not work on Windows. If I change the test string "Windows" to force 
execution to the tk.call above, the icon is a black square, which is worse than 
the Tk icon. Does it work right on linux?

--
assignee:  -> terry.reedy

___
Python tracker 

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




[issue3068] IDLE - Add an extension configuration dialog

2014-02-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I tried applying the patch and Hg say this:
abort: unable to strip away 1 of 1 dirs from Bindings.py
Since the patch just adds a line, I do not understand the message.
Do you have any ideas?

--

___
Python tracker 

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



[issue20406] Use application icon for IDLE

2014-02-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, it works right on Linux.

--

___
Python tracker 

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



[issue20553] Use specific asserts in ipaddress tests

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 58be80e7e653 by Serhiy Storchaka in branch '3.3':
Issue #20553. Use specific asserts in ipaddress tests.
http://hg.python.org/cpython/rev/58be80e7e653

New changeset 2bcb574d579f by Serhiy Storchaka in branch 'default':
Issue #20553. Use specific asserts in ipaddress tests.
http://hg.python.org/cpython/rev/2bcb574d579f

--
nosy: +python-dev

___
Python tracker 

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



[issue20553] Use specific asserts in ipaddress tests

2014-02-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Nick for your review.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20518] multiple inheritance + C extension = possibly unexpected __base__

2014-02-08 Thread Martin Teichmann

Martin Teichmann added the comment:

I've been working a bit on a solution to this issue, one proposal
is in the attached patch. The patch adds a new flag to tp_flags,
called Py_TPFLAGS_SOLID, which marks a class as being solid, i.e.
its memory layout is incompatible with its parent layout. C classes
can then set this flag, and cpython will assure that no incompatible
classes are in the same inheritance graph.

Other solutions are certainly thinkable: Eric proposed one should
use the MRO instead of __base__. This is a great idea, why is 
cpython itself not doing it? Instead of traversing the inheritance
graph trying to find the solid base, one could simply iterate over
the MRO.

In order to illustrate where the actual problem lies, here another
example:

=
rom PyQt4.QtCore import QObject, QTimer, QTimerEvent
# QObject is the parent of QTimer

class Mixin(QObject):
# this overwrites QObject.timerEvent
def timerEvent(self, e):
print('mixed in')
super().timerEvent(e)

class B(Mixin, QTimer):
pass

class C(QTimer, Mixin):
pass

event = QTimerEvent(0)

b = B()
try:
b.timerEvent(event)
except Exception as e:
print(e)
print('-')
c = C()
c.timerEvent(event)
=

I'm writing a mixin class, that overwrites a method from QObject.
In the end I am calling this method (normally that's done from
within PyQt4). For class B, this mixing in works properly, my
code is executed, but then I am getting an exception: PyQt4 had
made b and instance of QObject, not QTimer, since this is where
the __base__ is pointing to. For class C, my code is never called
because PyQt4 is not cooperating. Sure, I could write wrapper
classes for every Qt class that I want to mix into, but what
would be the point of a mixin class then?

I hope I made my problem a bit clearer.

--
Added file: http://bugs.python.org/file33997/patch

___
Python tracker 

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



[issue20406] Use application icon for IDLE

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d4f9efd4be7d by Terry Jan Reedy in branch '2.7':
Issue #20406: Use Python application icons for Idle window title bars.
http://hg.python.org/cpython/rev/d4f9efd4be7d

--

___
Python tracker 

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



[issue20551] Use specific asserts in decimal tests

2014-02-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> skrah

___
Python tracker 

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



[issue20406] Use application icon for IDLE

2014-02-08 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20562] sqlite3 returns result set with doubled first entry

2014-02-08 Thread R. David Murray

R. David Murray added the comment:

Here is an even more cut down example.  Note that removing the commit avoids 
the problem.

--
nosy: +r.david.murray
versions: +Python 3.3, Python 3.4
Added file: http://bugs.python.org/file33998/t.py

___
Python tracker 

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



[issue20462] Python IDLE auto closed when creating a new file or open existing file

2014-02-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Closing until there is evidence that there is a problem with the distribution 
that we can fix.

--
resolution:  -> later
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20496] function definition tutorial encourages bad practice

2014-02-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

There is a later example introduced by "It is simple to write a function that 
returns a list of the numbers of the Fibonacci series, instead of printing it:" 
that does exactly what you suggest.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue20497] Unclear word in socket document.

2014-02-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

'Single' that argument passing has changed, but I would have to know what it 
was previously (3.1) to know what the change is. Perhaps you can review the 3.1 
signature and suggest a better wording for the change note.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue20516] Concurrent.futures base concurrency improvement (with patch)

2014-02-08 Thread Glenn Langford

Glenn Langford added the comment:

Updated patch: Fixed bug where quick yield in as_completed() did not release 
lock on future.

--
Added file: http://bugs.python.org/file33999/futures-base-v2.patch

___
Python tracker 

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



[issue14130] memoryview: add multi-dimensional indexing and slicing

2014-02-08 Thread Stefan Krah

Stefan Krah added the comment:

Ian, could you please provide an example where multi-dimensional
indexing and slicing works in 2.x but not in 3.3?

--

___
Python tracker 

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



[issue19772] str serialization of Message object may mutate the payload and CTE.

2014-02-08 Thread R. David Murray

R. David Murray added the comment:

Ah, it is because the boundary computation intentionally modifies the message 
object.  Which is a questionable design decision overall, but is now set in 
stone :(.

--

___
Python tracker 

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



[issue20560] tkFileFilter.c: ostypeCount not initialized?

2014-02-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What Tk version do you use? This bug was fixed 5 years ago.

http://core.tcl.tk/tk/info/01ac8739ab148160b39d604439cdab1f4ebe4b0f

--

___
Python tracker 

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



[issue20481] Clarify type coercion rules in statistics module

2014-02-08 Thread Oscar Benjamin

Oscar Benjamin added the comment:

> Close #20481: Disallow mixed type input in statistics

If I understand correctly the reason for hastily pushing this patch
through is that it's the safe option: disallow mixing types as a quick
fix for soon to be released 3.4. If we want to allow mixing types then
that can be a new feature for 3.5.

Is that correct?

If so should the discussion about what to do in 3.5 take place in this
issue (i.e. reopen for 3.5) or should it be a new issue? issue20499
would benefit from clarity about the statistics module policy for
mixing types.

--

___
Python tracker 

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



[issue20563] Mark ipaddress as stable?

2014-02-08 Thread pmoody

pmoody added the comment:

Works for me.

I was going to say that there was still the issue with the mask parsing which 
turned out to be more difficult than simply applying the ipaddress-py patch but 
it looks like you've managed to get that applied. I spent a few hours banging 
my head on the keyboard before.

--

___
Python tracker 

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



[issue19772] str serialization of Message object may mutate the payload and CTE.

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 34fb36972f8d by R David Murray in branch '3.3':
#19772: Do not mutate message when downcoding to 7bit.
http://hg.python.org/cpython/rev/34fb36972f8d

New changeset 2e97d3500970 by R David Murray in branch 'default':
Merge #19772: Do not mutate message when downcoding to 7bit.
http://hg.python.org/cpython/rev/2e97d3500970

--
nosy: +python-dev

___
Python tracker 

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



[issue19772] str serialization of Message object may mutate the payload and CTE.

2014-02-08 Thread R. David Murray

Changes by R. David Murray :


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

___
Python tracker 

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



[issue19157] ipaddress.IPv6Network.hosts function omits network and broadcast addresses

2014-02-08 Thread pmoody

pmoody added the comment:

Since there's no broadcast address for ipv6, should calling .broadcast* on an 
ipv6 address raise an exception?

--

___
Python tracker 

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



[issue19772] str serialization of Message object may mutate the payload and CTE.

2014-02-08 Thread R. David Murray

R. David Murray added the comment:

Vajrasky: thanks for your work on this, it helped me find a reasonable (if 
ugly) solution.  However, the 'if' statement in your patch that checks 
specifically for the combination of old and new cte of 8bit and base64 puzzles 
me.  The same problem occurs here if the CTE we end up with is 
quoted-printable, which will be the case, for example, for latin-1.  The 
logical way to think abut the problem here (we don't want to modify the 
message) would be "if the CTE changed, we need to restore it".  So why check 
specifically for 8bit and base64?  The straightforward translation of "if the 
CTE changed, we need to restore it" would have been: 'if self.orig_cte != cte'.

In my solution I preferred to leave the original object unchanged, and re-copy 
it to re-change the headers when needed.  This is ugly, but it is more future 
proof against the down-coding code someday changing other headers or other 
characteristics of the message.  And I needed to use deepcopy, because copy 
would just copy a pointer to the _headers list, and therefore the original 
headers list would still get modified.  The deepcopy isn't that costly here, 
though, because we know that it is only called on a message that is not a 
multipart, since the copies are triggered only from _handle_text.  It's still 
not pretty, but I think it is the best we can do without completely 
restructuring the way the generator does its work.

--

___
Python tracker 

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



[issue19157] ipaddress.IPv6Network.hosts function omits network and broadcast addresses

2014-02-08 Thread pmoody

pmoody added the comment:

Hey Michiel, the patch looks good to me. Have you signed the contributor 
license agreement?

http://www.python.org/psf/contrib/contrib-form/

Nick, is there anyway for me to check if this has been signed?

--

___
Python tracker 

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



[issue20560] tkFileFilter.c: ostypeCount not initialized?

2014-02-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

As I may have mentioned before, I *now* use the 'standard' one for Windows for 
each version of Python, as fetched by Tools/buildbots/external.bat. For 2.7 
this is 8.5.2.  The reason I just noticed about a month ago is that I 
previously ran all repository builds with one version of tcl/tk, the latest -- 
and had no problems. When 3.4 switched to 8.6.0, I wanted to use that for the 
repository build also, but my impression is that 2.7 and 3.3 cannot run with 
8.6. So I put each Python branch clone in a separate directory instead of 
side-by-side in one directory as recommended in the developer guide. (This is a 
nuisance.) I do not really understand why Windows users of 2.7 as saddled with 
such an old release of tcl/tk.

If there is nothing to be done about this, we can close it.

--

___
Python tracker 

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



[issue13414] test_strftime failed on OpenBSD

2014-02-08 Thread Remi Pointel

Remi Pointel added the comment:

I close this bug because it's corrected by the commit (revision 1.2): 
http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/time/wcsftime.c

It was a bug in our wcsftime.

Thanks.

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue16983] header parsing could apply postel's law to encoded words inside quotes

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1dcb9d0d53a6 by R David Murray in branch '3.3':
#16983: Apply postel's law to encoded words inside quoted strings.
http://hg.python.org/cpython/rev/1dcb9d0d53a6

New changeset 5f7e626730df by R David Murray in branch 'default':
Merge: #16983: Apply postel's law to encoded words inside quoted strings.
http://hg.python.org/cpython/rev/5f7e626730df

--
nosy: +python-dev

___
Python tracker 

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



[issue20564] test_threadsignals.py "failed" on OpenBSD because too slow (> 3sec)

2014-02-08 Thread Remi Pointel

New submission from Remi Pointel:

Hi,

I have 2 tests which "failed" on OpenBSD (tested on i386, amd64 and sparc64) in:

- test_threadsignals.py/test_lock_acquire_interruption
- test_threadsignals.py/test_rlock_acquire_interruption


==
FAIL: test_lock_acquire_interruption (__main__.ThreadSignals)
--
Traceback (most recent call last):
  File "Lib/test/test_threadsignals.py", line 94, in 
test_lock_acquire_interruption
self.assertLess(dt, 3.0)
AssertionError: 5.020112991333008 not less than 3.0

==
FAIL: test_rlock_acquire_interruption (__main__.ThreadSignals)
--
Traceback (most recent call last):
  File "Lib/test/test_threadsignals.py", line 122, in 
test_rlock_acquire_interruption
self.assertLess(dt, 3.0)
AssertionError: 5.0101478099823 not less than 3.0

On the 3 machines it took ~ 5sec.
I'm asking why it's 3 seconds by default in the tests? Could we modify the 
value to 6 instead of 3, is it acceptable?

Thanks for your response,

Remi.

--
components: Tests
messages: 210672
nosy: rpointel
priority: normal
severity: normal
status: open
title: test_threadsignals.py "failed" on OpenBSD because too slow (> 3sec)
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue16983] header parsing could apply postel's law to encoded words inside quotes

2014-02-08 Thread R. David Murray

R. David Murray added the comment:

The old header parsing code already decodes these, although it gets the spacing 
wrong if you do the standard str(make_header(decode_header(x))) dance.  The fix 
for the new header parsing code only handles the specific case of only encoded 
words surrounded by double quotes.  That's the only variation I've seen in the 
wild so far, so I think that may be enough.  To extend it to handle mixed 
regular text and encoded words would require rewriting the qcontent and ptext 
functions.  Possible, but not worth it unless a real use case turns up.  
(Although, I think there might be a bug in quoted text parsing that may make 
that rewrite worthwhile later; but it is only a bug if you are actually walking 
the parse tree, it is not a functional bug.)

Oh, and I decided to treat this as a bug fix, not an enhancement, because the 
old parser code already did this decoding.

--
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
type: enhancement -> behavior
versions: +Python 3.3

___
Python tracker 

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



[issue20565] Update Tcl/Tk version for buildbots

2014-02-08 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Currently Windows buildbots use old versions of Tcl/Tk. These versions contain 
bugs (for example see issue20560).

Versions mentioned in Tools/buildbot/external-common.bat:
On 2.7: 8.5.2.1/8.5.2.0
On 3.3: 8.5.11.0
On 3.4: 8.6.1.0

Some buildbots even use beta version of 8.6 (I needed write workaround in 
testsuite for behavior differences).

Recent Tcl/Tk versions:

Tcl/Tk 8.6.1 Sep 20, 2013 
Tcl/Tk 8.5.15 Sep 18, 2013 
Tcl/Tk 8.4.20 Jun 1, 2013

Perhaps it is time to update Tcl/Tk to recent versions?

--
messages: 210674
nosy: pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Update Tcl/Tk version for buildbots
versions: Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue20560] tkFileFilter.c: ostypeCount not initialized?

2014-02-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

May be we should update Tcl/Tk on buildbots (issue20565).

--

___
Python tracker 

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



[issue20535] run_tests.py: Work around issues 20355 and 20361

2014-02-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +ezio.melotti, michael.foord, pitrou
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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



[issue20520] Readline test in test_codecs is broken

2014-02-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue20283] Wrong keyword parameter name in regex pattern methods

2014-02-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Larry, so what is your decision?

1. Apply the "hard" patch and then convert Modules/_sre.c to use Argument 
Clinic (issue20148).

2. Revert converted match() method, apply the "soft" patch, and delay applying 
of the "hard" patch and then converting to use Argument Clinic to 3.5. Applying 
the "soft" patch and then the "hard" patch will cause more source churn than 
just applying the "hard" patch.

3. Use show_in_signature hack. I don't like this, it looks ugly and adds too 
much source churn.

--

___
Python tracker 

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



[issue20148] Derby: Convert the _sre module to use Argument Clinic

2014-02-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Wrong keyword parameter name in regex pattern methods

___
Python tracker 

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



[issue20534] Enum tests fail with pickle protocol 4

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9f75f8a2cbb4 by Ethan Furman in branch 'default':
Close issue20534: all pickle protocols now supported.
http://hg.python.org/cpython/rev/9f75f8a2cbb4

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

___
Python tracker 

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



[issue20564] test_threadsignals.py "failed" on OpenBSD because too slow (> 3sec)

2014-02-08 Thread Charles-François Natali

Charles-François Natali added the comment:

> I'm asking why it's 3 seconds by default in the tests?
> Could we modify the value to 6 instead of 3, is it acceptable?

No, see this comment:
"""
  self.assertRaises(KeyboardInterrupt, lock.acquire, timeout=5)
  dt = time.time() - t1
  # Checking that KeyboardInterrupt was raised is not sufficient.
  # We want to assert that lock.acquire() was interrupted because
  # of the signal, not that the signal handler was called immediately
  # after timeout return of lock.acquire() (which can fool assertRaises).
"""

5s corresponds exactly to the timeout passed to acquire(), which means that it 
didn't get interrupted, which is precisely the goal of the test.

--
nosy: +neologix

___
Python tracker 

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



[issue12675] tokenize module happily tokenizes code with syntax errors

2014-02-08 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



  1   2   >