[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-01-25 Thread Charles-François Natali

Charles-François Natali added the comment:

> > But what problem does it cause if, once in a while, the call takes less
> > than the passed timeout?
> > If that's the case, you'll simply perform another loop, an wake up 1ms
> > later, that's all.
>
> "perform another loop" is my problem. If possible, I would like
> useless calls to the loop. With my latest patch to asyncio, there is
> no more useless calls to the loop (at least, not because of a time
> rounding issue).

Still, you fail to provide an example: you will only perform another call
if you pass a tilmeout really close to an exact multiple of the
granularity, *and* the syscall returns early.
Just perform a test on your machine, you'll see that early wakeups are
*really* rare.
And even if that's the case, I argue that performing an extra loop isn't a
problem: for example, noone ever complained about the way timpeouts are
rounded in the select module.

If you think otherwise, please back your claim by an example.

> Oh, I forgot to mention that I'm also concerned by the backward
> compatibility. Changing how poll and epoll round the timeout changes
> the behaviour. It may break applications or maybe change performances
> of applications (efficiency or reactivity). Changing the rounding
> method in Python 3.3 was not a good idea.

Don't apply it to 3.3 then.

> @Charles-François: I'm not sure that we are talking about the same
> thing. If you still want to change poll and epoll, go ahead. Since the
> performance issue has been fixed directly in asyncio, I don't feel the
> need of changing the poll or epoll anymore in Python 3.4. Or maybe you
> disagree with my change in the asyncio module?

I disagree with the introduction of a granularity to selectors.
If you really want to keep the change in asyncio, just introduce a fixed
"slack" value, e.g. 1e-3 seconds.

--

___
Python tracker 

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



[issue20133] Derby: Convert the audioop module to use Argument Clinic

2014-01-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Christian Heimes just posted this to python-dev:

See issue20394. This is unrelated to clicalization patch.

--

___
Python tracker 

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



[issue20394] Coverity complains on audioop

2014-01-25 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Christian Heimes reported 
(http://permalink.gmane.org/gmane.comp.python.devel/145253) Coverity issue:

"""
** CID 1164423:  Division or modulo by zero  (DIVIDE_BY_ZERO)
/Modules/audioop.c: 1375 in audioop_ratecv_impl()



*** CID 1164423:  Division or modulo by zero  (DIVIDE_BY_ZERO)
/Modules/audioop.c: 1375 in audioop_ratecv_impl()
1369without spurious overflow is the challenge; we can
1370settle for a reasonable upper bound, though, in this
1371case ceiling(len/inrate) * outrate. */
1372
1373 /* compute ceiling(len/inrate) without overflow */
1374 Py_ssize_t q = len > 0 ? 1 + (len - 1) / inrate : 0;
>>> CID 1164423:  Division or modulo by zero  (DIVIDE_BY_ZERO)
>>> In expression "9223372036854775807L / q", division by expression
"q" which may be zero has undefined behavior.
1375 if (outrate > PY_SSIZE_T_MAX / q / bytes_per_frame)
1376 str = NULL;
1377 else
1378 str = PyBytes_FromStringAndSize(NULL,
1379 q * outrate *
bytes_per_frame);
1380 }
"""

This is false positive. len should be non-negative and a case of 0 already 
checked just several lines before.

Is Coverity aware asserts? Perhaps this patch will silence it.

--
components: Build
files: audioop_ratecv_coverity_silence.patch
keywords: patch
messages: 209284
nosy: christian.heimes, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Coverity complains on audioop
versions: Python 2.7, Python 3.3, Python 3.4
Added file: 
http://bugs.python.org/file33718/audioop_ratecv_coverity_silence.patch

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

I don't know about diff #1, but diff #2 definitely applied cleanly against a 
fresh trunk at 8:22pm local time.  I've turned off git format.

--

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Rietveld doesn't like patches against out of date tree. And unfortunately it 
doesn't like patches in git format.

--

___
Python tracker 

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



[issue20358] test_curses is failing on Ubuntu 13.10

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

I changed the unit test so it doesn't specify a minium row/column greater than 
the maximum row/column.  The tests now pass.  So I'm calling this good.  Thanks 
for looking in to it, Zachary and Nadeem!

--
assignee:  -> larry
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



[issue20358] test_curses is failing on Ubuntu 13.10

2014-01-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0ae768637a07 by Larry Hastings in branch 'default':
Issue #20358: Tests for curses.window.overlay and curses.window.overwrite
http://hg.python.org/cpython/rev/0ae768637a07

--
nosy: +python-dev

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1435d2fe8e34 by Larry Hastings in branch 'default':
Issue #20390: Final fix, for generating NoPositional/NoKeyword for __init__ 
calls.
http://hg.python.org/cpython/rev/1435d2fe8e34

--

___
Python tracker 

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



[issue20322] Upgrade ensurepip's pip and setuptools

2014-01-25 Thread Donald Stufft

Changes by Donald Stufft :


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

___
Python tracker 

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



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

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

Raymond said "The preferred behavior is that a negative number always means 0." 
 My proposal honors that.

We certainly aren't changing this in 3.3 and 2.7, and as release manager for 
3.4 I'm pretty sure we aren't changing it there.

--

___
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-01-25 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Larry said, "A proper fix for the "bug" will require changing the semantics of 
the function. 
It's inappropriate to do that in 2.7, 3.3, and (now that we're in beta) 3.4."

I think we can not have it all and need to be pragmatic in this ticket. While 
we can not fix the default value quirk in 2.7, 3.3, and 3.4, at least we can 
make the negative times consistent whether it is sent through positional or 
keyword.

Otherwise, we have to fix the doc:

repeat(object [,times])
create an iterator which returns the object for the specified number of times.  
If not specified, returns the object endlessly.If times is negative and is sent 
via positional, it means zero repetitions. But if times is negative and is sent 
via keyword, it means endless repetition.

And it doesn't feel right, does it?

--

___
Python tracker 

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



[issue20226] Argument Clinic: support for simple expressions?

2014-01-25 Thread Larry Hastings

Changes by Larry Hastings :


--
stage: commit review -> committed/rejected

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Larry Hastings

Changes by Larry Hastings :


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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9c5b421cc7de by Larry Hastings in branch 'default':
Issue #20390: Small fixes and improvements for Argument Clinic.
http://hg.python.org/cpython/rev/9c5b421cc7de

--
nosy: +python-dev

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

I don't know why it's refusing to generate the review link.  The patch applies 
cleanly to trunk, even now, hours later.  Maybe it doesn't like file moves?

--

___
Python tracker 

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



[issue20322] Upgrade ensurepip's pip and setuptools

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

You can check those in for 3.4.  Do it right now and you can get them in for 
beta 3.

Sorry for the tardy reply!

--

___
Python tracker 

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



[issue13355] random.triangular error when low = high=mode

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

I haven't looked at this in depth but it sounds like this is a legitimate 
concern.  I'd like it fixed for 3.4, preferably before rc1.

--
nosy: +larry

___
Python tracker 

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



[issue20319] concurrent.futures.wait() can block forever even if Futures have completed

2014-01-25 Thread Glenn Langford

Glenn Langford added the comment:

> It seems more plausible that the locks around the removals are fixing the bug 
> but I don't see how. I'll look into it some more.

It is the locks around the waiter removals that matter; I think there are only 
formatting changes elsewhere in the patch. The reason the locks make a 
difference is that there can be a race condition if multiple wait() calls 
compete to modify the f._waiters list.

--

___
Python tracker 

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



[issue20319] concurrent.futures.wait() can block forever even if Futures have completed

2014-01-25 Thread Brian Quinlan

Brian Quinlan added the comment:

I'm looking at "futures.patch".

I don't understand why these blocks are helpful -"_create_and_install_waiters" 
has two call sites and both ("as_completed" and "wait") call 
"_create_and_install_waiters" from within an _AcquireFutures context manager:

-pending_count = sum(
-f._state not in [CANCELLED_AND_NOTIFIED, FINISHED] for f in fs)
+with _AcquireFutures(fs):
+pending_count = sum(
+f._state not in [CANCELLED_AND_NOTIFIED, FINISHED]
+for f in fs)

-for f in fs:
-f._waiters.append(waiter)
+with _AcquireFutures(fs):
+for f in fs:
+f._waiters.append(waiter)

It seems more plausible that the locks around the removals are fixing the bug 
but I don't see how. I'll look into it some more.

--

___
Python tracker 

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



[issue20177] Derby #8: Convert 28 sites to Argument Clinic across 2 files

2014-01-25 Thread Nikolaus Rath

Nikolaus Rath added the comment:

I'll wait with working on _datetimemodule.c until someone had a chance to look 
over my _timemodule.c patch. (I want to make sure I'm following the right 
procedure).

--

___
Python tracker 

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



[issue20177] Derby #8: Convert 28 sites to Argument Clinic across 2 files

2014-01-25 Thread Nikolaus Rath

Changes by Nikolaus Rath :


Added file: http://bugs.python.org/file33717/timemodule_part2_rev3.patch

___
Python tracker 

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



[issue20177] Derby #8: Convert 28 sites to Argument Clinic across 2 files

2014-01-25 Thread Nikolaus Rath

Changes by Nikolaus Rath :


Removed file: http://bugs.python.org/file33714/timemodule_part1_rev3.patch

___
Python tracker 

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



[issue20177] Derby #8: Convert 28 sites to Argument Clinic across 2 files

2014-01-25 Thread Nikolaus Rath

Changes by Nikolaus Rath :


Added file: http://bugs.python.org/file33716/timemodule_part1_rev3.patch

___
Python tracker 

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



[issue20363] BytesWarnings triggerred by test suite

2014-01-25 Thread Berker Peksag

Changes by Berker Peksag :


Removed file: http://bugs.python.org/file33712/issue20363_v2.diff

___
Python tracker 

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



[issue20363] BytesWarnings triggerred by test suite

2014-01-25 Thread Berker Peksag

Berker Peksag added the comment:

Ah, my bad. Thanks Arfrever.

--
Added file: http://bugs.python.org/file33715/issue20363_v3.diff

___
Python tracker 

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



[issue20363] BytesWarnings triggerred by test suite

2014-01-25 Thread Berker Peksag

Changes by Berker Peksag :


Removed file: http://bugs.python.org/file33669/issue20363.diff

___
Python tracker 

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



[issue20177] Derby #8: Convert 28 sites to Argument Clinic across 2 files

2014-01-25 Thread Nikolaus Rath

Nikolaus Rath added the comment:

I've attached updated patches to reflect the recent changes in the derby policy.

part1 is the part of the patch that is suitable for 3.4.

part2 are the changes that have to wait for 3.5 (mostly because of default 
values).

--
Added file: http://bugs.python.org/file33714/timemodule_part1_rev3.patch

___
Python tracker 

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



[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-25 Thread Guido van Rossum

Guido van Rossum added the comment:

LGTM. But you also need to update Doc/library/concurrent.futures.rst

I see this as a bugfix so it's not necessary to get this in before the beta 3 
release tonight.

I will work on an asyncio patch and test.

--

___
Python tracker 

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



[issue20363] BytesWarnings triggerred by test suite

2014-01-25 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

The new patch has %s and %r reversed in Lib/distutils/command/register.py.

--

___
Python tracker 

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



[issue20375] ElementTree: Document handling processing instructions

2014-01-25 Thread Nikolaus Rath

Nikolaus Rath added the comment:

I've also attached a testcase to confirm that the docpatch reflects current 
behavior, and to make sure that anticipated enhancements in Python 3.5 behave 
in a backwards compatible way.

--
Added file: http://bugs.python.org/file33713/etree-testcases.patch

___
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-01-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Great. Old and new both in at least one release, when possible, is best. I 
should have thought of asking if that would be possible. In this case, I think 
the (undocumented) old should disappear in 3.5.

Since the mistaken 'pattern' name is not documented now, I would not add 
anything to the doc.

I would augment the the warning
 "The 'pattern' keyword parameter name is deprecated."
to briefly explain the deprecation and its timing by saying
 "The erroneous and undocumented 'pattern' keyword parameter name is deprecated 
and will be removed in version 3.5."

The patch did not upload correctly. I just see "Modules/_sre.c |   64 
+++!!
  1 file changed, 44 insertions(+), 20 modifications(!)" when I open it in a 
new Firefox tab.

--

___
Python tracker 

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



[issue20363] BytesWarnings triggerred by test suite

2014-01-25 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the review, Arfrever and Serhiy. Here's a new patch.

--
Added file: http://bugs.python.org/file33712/issue20363_v2.diff

___
Python tracker 

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



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Nick Coghlan

Nick Coghlan added the comment:

I strongly prefer SocketKind - SockType is far too close to SocketType and
"type" is too closely associated with the type system in general.

--

___
Python tracker 

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



[issue20133] Derby: Convert the audioop module to use Argument Clinic

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

Christian Heimes just posted this to python-dev:



Coverity has detected an issue in this commit:


** CID 1164423:  Division or modulo by zero  (DIVIDE_BY_ZERO)
/Modules/audioop.c: 1375 in audioop_ratecv_impl()



*** CID 1164423:  Division or modulo by zero  (DIVIDE_BY_ZERO)
/Modules/audioop.c: 1375 in audioop_ratecv_impl()
1369without spurious overflow is the challenge; we can
1370settle for a reasonable upper bound, though, in this
1371case ceiling(len/inrate) * outrate. */
1372
1373 /* compute ceiling(len/inrate) without overflow */
1374 Py_ssize_t q = len > 0 ? 1 + (len - 1) / inrate : 0;
>>> CID 1164423:  Division or modulo by zero  (DIVIDE_BY_ZERO)
>>> In expression "9223372036854775807L / q", division by expression
"q" which may be zero has undefined behavior.
1375 if (outrate > PY_SSIZE_T_MAX / q / bytes_per_frame)
1376 str = NULL;
1377 else
1378 str = PyBytes_FromStringAndSize(NULL,
1379 q * outrate *
bytes_per_frame);
1380 }

--

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

No, wait, I think it's fine, it was just some detritus in my directory throwing 
me off.  But "hg stat" looks correct.

--

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

Oops, I goofed up moving _lzamodule.clinic.c.h.  I'll fix that locally, won't 
regenerate the patch just for that (unless you ask me to).

--

___
Python tracker 

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



[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

Can you try locally applying my patch for #20390 and seeing if you still have 
the problem?  I tried applying it to the itertoolmodule.c you attached to the 
issue and it seemed to fix the problem.

--

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

Okay, here's my revised patch, for real this time, with "hg mv" for the side 
files and everything.

--
Added file: 
http://bugs.python.org/file33711/larry.clinic.rollup.jan.25.diff.2.txt

___
Python tracker 

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



[issue20358] test_curses is failing on Ubuntu 13.10

2014-01-25 Thread Zachary Ware

Zachary Ware added the comment:

Ok, I've tracked down where the error is happening, but I don't know enough 
about curses to suggest where it should go from here.  It does appear to be the 
version of ncurses that Ubuntu 13.10 uses that's causing problems, version 
5.9+20130608.  The issue stems from a change in ncurses/base/lib_overlay.c, 
here's the relevant part of the diff to copywin (left is vanilla ncurses-5.9 
from http://ftp.gnu.org/pub/gnu/ncurses/, right is ncurses-5.9+20130608 
obtained by 'sudo apt-get source ncurses'):

--- ncurses-5.9/ncurses/base/lib_overlay.c  2009-10-24 18:21:31.0 
-0500
+++ ncurses-5.9+20130608/ncurses/base/lib_overlay.c 2014-01-25 
17:13:08.461548012 -0600
@@ -151,7 +151,10 @@
dminrow, dmincol,
dmaxrow, dmaxcol, over));
 
-if (src && dst) {
+if (src != 0
+   && dst != 0
+   && dmaxrow >= dminrow
+   && dmaxcol >= dmincol) {
_nc_lock_global(curses);
 
bk = AttrOf(dst->_nc_bkgd);


The failing test passes 1, 2, 3, 3, 2, 1 for sminrow, smincol, dminrow, 
dmincol, dmaxrow, dmaxcol, which fails the dmaxrow >= dminrow check and copywin 
returns -1 (ERR).  Changing the test to call with 1, 1, 2, 2, 3, 3 prevents the 
failure, but does ugly things to the tty when the process ends.

--
title: test_curses is failing -> test_curses is failing on Ubuntu 13.10

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

Hang on, my tree was out of date.  Which is why I didn't get a review link, 
duh.  And if side files have appeared I'll fix 'em.

--

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Larry Hastings

Changes by Larry Hastings :


Removed file: 
http://bugs.python.org/file33710/larry.clinic.rollup.jan.25.diff.2.txt

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

Thanks for the reviews, Nick and Serhiy, especially considering that the 
Rietveld link didn't work!

Serhiy: I believe I fixed everything.  There are no side files checked in yet.  
Can you give me another review?

--
Added file: 
http://bugs.python.org/file33710/larry.clinic.rollup.jan.25.diff.2.txt

___
Python tracker 

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



[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-01-25 Thread STINNER Victor

STINNER Victor added the comment:

> Looks like 3b8a2281d323aa9abf497192b01cf9
06b98ed3d8 broke the buildbots.

Oh, I didn't watch buildbots, sorry. It should be fixed by f453443c96e4.

My first attempt used an attribute using a default value of None, but
it was harder to use: I had to check if the value is None or not. I
prefer to enforce an implementation to define the resolution. Or do
you know a selector which has no resolution?

--

___
Python tracker 

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



[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-01-25 Thread Guido van Rossum

Guido van Rossum added the comment:

I don't have the energy to read all the debate here, but over on python-tulip 
we continue to discuss this. Victor and I have currently agreed to drop the 
math.ceil() calls from the event loop and instead simply consider any event 
scheduled within "granularity" from the current clock value to be "ready". 
Victor will check it in.

Regarding the buildbot failures, Victor will have to review those.  They are in 
the telnet tests:

==
ERROR: test_read_until (test.test_telnetlib.ReadTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/test_telnetlib.py",
 line 179, in test_read_until
data = telnet.read_until(b'match')
  File 
"/usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/telnetlib.py",
 line 312, in read_until
with _TelnetSelector() as selector:
TypeError: Can't instantiate abstract class MockSelector with abstract methods 
resolution

==
ERROR: test_expect (test.test_telnetlib.ExpectTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/test_telnetlib.py",
 line 388, in test_expect
(_,_,data) = telnet.expect([b'match'])
  File 
"/usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/telnetlib.py",
 line 617, in expect
with _TelnetSelector() as selector:
TypeError: Can't instantiate abstract class MockSelector with abstract methods 
resolution

--

--

___
Python tracker 

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



[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-01-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f453443c96e4 by Victor Stinner in branch 'default':
Issue #20311: Fix test_telnetlib, set the resolution of the MockSelector
http://hg.python.org/cpython/rev/f453443c96e4

--

___
Python tracker 

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



[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-01-25 Thread STINNER Victor

STINNER Victor added the comment:

2014-01-25 Charles-François Natali :
>> It looks like changing the rounding method doesn't solve anything.
>> selector.select(timeout) may still take less than timeout, so it
>> doesn't give any guarantee.
>
> But what problem does it cause if, once in a while, the call takes less
> than the passed timeout?
> If that's the case, you'll simply perform another loop, an wake up 1ms
> later, that's all.

"perform another loop" is my problem. If possible, I would like
useless calls to the loop. With my latest patch to asyncio, there is
no more useless calls to the loop (at least, not because of a time
rounding issue).

Oh, I forgot to mention that I'm also concerned by the backward
compatibility. Changing how poll and epoll round the timeout changes
the behaviour. It may break applications or maybe change performances
of applications (efficiency or reactivity). Changing the rounding
method in Python 3.3 was not a good idea.

@Charles-François: I'm not sure that we are talking about the same
thing. If you still want to change poll and epoll, go ahead. Since the
performance issue has been fixed directly in asyncio, I don't feel the
need of changing the poll or epoll anymore in Python 3.4. Or maybe you
disagree with my change in the asyncio module?

--

___
Python tracker 

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



[issue19944] Make importlib.find_spec load packages as needed

2014-01-25 Thread Eric Snow

Changes by Eric Snow :


--
status: pending -> closed

___
Python tracker 

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



[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-01-25 Thread Eric Snow

Eric Snow added the comment:

A better example:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.0%203.x/builds/1538

--

___
Python tracker 

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



[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-01-25 Thread Eric Snow

Eric Snow added the comment:

FYI: on my local box I saw only the 2 failed tests in test_telnetlib.

--

___
Python tracker 

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



[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-01-25 Thread Eric Snow

Eric Snow added the comment:

Looks like 3b8a2281d323aa9abf497192b01cf906b98ed3d8 broke the buildbots.

e.g. 
http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.0%203.x/builds/1533

--
nosy: +eric.snow

___
Python tracker 

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



[issue19944] Make importlib.find_spec load packages as needed

2014-01-25 Thread Eric Snow

Changes by Eric Snow :


--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> pending
type:  -> enhancement

___
Python tracker 

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



[issue19944] Make importlib.find_spec load packages as needed

2014-01-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 665f1ba77b57 by Eric Snow in branch 'default':
Issue 19944: Fix importlib.find_spec() so it imports parents as needed.
http://hg.python.org/cpython/rev/665f1ba77b57

--
nosy: +python-dev

___
Python tracker 

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



[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-01-25 Thread Charles-François Natali

Charles-François Natali added the comment:

> > Once again, what's wrong with your initial approach of ceiling the
timeout?
>
> It looks like changing the rounding method doesn't solve anything.
> selector.select(timeout) may still take less than timeout, so it
> doesn't give any guarantee.

But what problem does it cause if, once in a while, the call takes less
than the passed timeout?
If that's the case, you'll simply perform another loop, an wake up 1ms
later, that's all.

There's a lot of call written this way, and this has never been a problem:
so far, you still didn't give an example of problematic behavior.

--

___
Python tracker 

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



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Ethan Furman

Ethan Furman added the comment:

How do we feel about SockType instead?  (Just a short round of bike-shedding, 
promise! ;)

--

___
Python tracker 

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



[issue20193] Derby: Convert the zlib, _bz2 and _lzma modules to use Argument Clinic

2014-01-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I suppose that zdict=b'' have same effect as not specifying zdict. Am I right?

--

___
Python tracker 

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



[issue20193] Derby: Convert the zlib, _bz2 and _lzma modules to use Argument Clinic

2014-01-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch for zlib reverts reverted decompress(), decompressobj() and 
Decompress.flush(). It get rids from DEF_WBITS and use MAX_WBITS instead, 
exposes DEF_BUF_SIZE (former DEFAULTALLOC) to Python level.

--
Added file: http://bugs.python.org/file33709/zlib_clinic_3.patch

___
Python tracker 

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



[issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures

2014-01-25 Thread Glenn Langford

Glenn Langford added the comment:

Updated patch with a test case, and added a minor note to the docstring to 
clarify behaviour.

The use of sleep() in the test is not great, but it is the most obvious way to 
test and it is consistent with the approach used in other concurrent test cases.

--
Added file: http://bugs.python.org/file33708/issue20369.patch

___
Python tracker 

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



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Eli Bendersky

Eli Bendersky added the comment:

Yep, the overriding of the type name was inadvertent. Nothing sacred about it, 
so Ethan's SocketKind is just as good.

--

___
Python tracker 

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



[issue20393] Docs: mark deprecated items in the TOC

2014-01-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +georg.brandl

___
Python tracker 

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



[issue20393] Docs: mark deprecated items in the TOC

2014-01-25 Thread Zearin

New submission from Zearin:

When exploring the docs for the standard library, it’s frustrating to have an 
idea and look for the answer only to find out that an entire module (or 
package) has been deprecated _after_ I click on it. 

Can we have links to deprecated items on the Standard Library’s TOC page 
flagged?  

I see you’re using multiple CSS classes on some links.  I propose: 

- add a CSS class to flag links to deprecated items
- use something like the following CSS




/*
 * Example 1: color 
 */
.toctree-wrapper a.deprecated {
color: #933;
}

/* 
 * Example 2: "badge" 
 */
.toctree-wrapper a.deprecated:after {
display: inline-block;
content: "deprecated";
margin: 0 1em;
padding: 0 1ex !important;
border-radius:  1ex !important;

font-size: x-small;

background-color: #f66;
color: #933;
}



Of course, since the CSS class '.deprecated' already exists, there's 2 options: 

1. the examples above are rewritten to use a different classname, or 
2. add the following CSS:



/* "Reset" .deprecated in a toctree context */
.toctree-wrapper a.deprecated {
background: none;
border: none;
padding: 0;
}

/* << insert above example CSS here >> */



--
assignee: docs@python
components: Documentation
messages: 209239
nosy: docs@python, zearin
priority: normal
severity: normal
status: open
title: Docs: mark deprecated items in the TOC
type: enhancement
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-01-25 Thread STINNER Victor

STINNER Victor added the comment:

Hi,

2014-01-25 Charles-François Natali :
> I'm sorry, but I'm not convinced.
> The selector's granularity is an implementation detail, and I don't think
> it should be exposed.

I disagre, it's not a detail because it causes bugs, knowing the
resolution matters.

> Furthermore, it's not a mere function of the C type used to represent the
> timeout to the underlying syscall (long, timeval): it also depends on the
> operating system, the hardware, etc.

I exposed the resolution of the underlying C structure, I know that it
doesn't guarantee anything. But we did the same thing for clocks with
time.get_clock_info(name).resolution.

At least, if the C structure has a resolution of 1 ms, don't expect to
have a resolution better than 1 ms in practice. It's better than not
knowing it.

The OS limitations can be documented.

> Once again, what's wrong with your initial approach of ceiling the timeout?

It looks like changing the rounding method doesn't solve anything.
selector.select(timeout) may still take less than timeout, so it
doesn't give any guarantee.

IMO adding a granularity to asyncio is a better approach. asyncio can
for example adjusts its granularity at runtime if it see that the
announced selector resolution is wrong. And the granularity also uses
the clock resolution.

Victor

--

___
Python tracker 

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



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Ethan Furman

Ethan Furman added the comment:

The containers are there to help with discoverability.  If you want to know 
what all the (common) AF values are you can either do

[name for name in dir(socket) if name.isupper() and name.startswith('AF_')]

or

list(socket.AddressFamily)

--

___
Python tracker 

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



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Ethan Furman

Ethan Furman added the comment:

Complete patch with new test, fixed tests, and regression fix.

Doc patch still needed.

--
stage: test needed -> patch review
Added file: http://bugs.python.org/file33707/issue20386.stoneleaf.patch.02

___
Python tracker 

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



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Georg Brandl

Georg Brandl added the comment:

I'm not saying the enums are necessary (argue about that with Eli), but that if 
they *are* in the module as a public attribute, they *have* to be documented, 
period.

--

___
Python tracker 

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



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

But as a user when are you gonna need to use AddressFamily container?
Before enum we didn't have something like:

AddressFamily = (AF_INET, AF_INET6, ...)

Basically because we didn't need it. Sorry if I'm missing something here.

--

___
Python tracker 

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



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Georg Brandl

Georg Brandl added the comment:

> Why should new enums be documented and how are they useful?

Because they are a new public class(-like object) in the module. When renaming 
them to a non-public name, as you suggest, that could be left out.

--

___
Python tracker 

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



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

> Please find a better name for the type enum and document the new enums.

Why should new enums be documented and how are they useful?
IMO socket module adopted enum module only to provide a better representation 
of AF_* and SOCK_* constants on repr(), which is fine.
The fact that in order to do that enum module forces you to create a container 
is incidental and should not result in polluting socket module API (which is 
already pretty crowded).
In summary I'd be for renaming those enums to _SocketType and _AddressFamily.

--

___
Python tracker 

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



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Ethan Furman

Ethan Furman added the comment:

Here's a patch for the test.

--
Added file: http://bugs.python.org/file33706/issue20386.stoneleaf.test.patch.01

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

_PyType_GetDocFromInternalDoc and _PyType_GetTextSignatureFromInternalDoc 
declarations are too long. could you please wrap them around?

First parameter of class methods (e.g. dict.fromkeys) now has a type of object 
(PyDictObject *) instead of PyTypeObject * (or PyDict_Type *).

There is redundant cast in dict___contains__:

register PyDictObject *mp = (PyDictObject *)self;

First parameter of static methods (e.g. str.maketrans) now has a type of object 
(PyUnicodeObject *) instead of void *.

There is redundant cast in unicodedata_UCD_decimal_impl:

PyUnicodeObject *v = (PyUnicodeObject *)unichr;

Perhaps here should be os.path.dirname() instead of os.path.basename():

dirname = os.path.basename(destination.filename)

The 'fail("Can't write to destination "' line is too long. And I think it will 
look better if use string formatting.

--

___
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-01-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is patch for 3.3 which adds alternative parameter name. Now both keyword 
names are allowed, but deprecation warning is emitted if old keyword name is 
used.

>>> import re
>>> p = re.compile('')
>>> p.match()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Required argument 'string' (pos 1) not found
>>> p.match('')
<_sre.SRE_Match object at 0xb705c598>
>>> p.match(string='')
<_sre.SRE_Match object at 0xb705c720>
>>> p.match(pattern='')
__main__:1: DeprecationWarning: The 'pattern' keyword parameter name is 
deprecated.  Use 'string' instead.
<_sre.SRE_Match object at 0xb705c758>
>>> p.match('', string='')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Argument given by name ('string') and position (1)
>>> p.match('', pattern='')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Argument given by name ('pattern') and position (1)

--
Added file: http://bugs.python.org/file33705/sre_deprecate_pattern_keyword.patch

___
Python tracker 

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



[issue5755] "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++"

2014-01-25 Thread Jon Parise

Changes by Jon Parise :


--
nosy:  -jon

___
Python tracker 

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



[issue15955] gzip, bz2, lzma: add option to limit output size

2014-01-25 Thread Nikolaus Rath

Nikolaus Rath added the comment:

Let me be more precise: 

My suggestion is not to remove `unconsumed_tail` entirely, but I think its 
value needs to be defined only when the end of the compressed stream has been 
reached.

In other words, you could still do:

while not decomp.eof
  # ...
if decomp.unconsumed_tail:
raise RuntimeError('unexpected data after end of compressed stream')

but as long as decomp.eof is True, decomp.unconsumed_tail could (as far as I 
can tell) be None, no matter if there is uncompressed data in the internal 
buffer or not.

--

___
Python tracker 

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



[issue20374] Failure to compile with readline-6.3-rc1

2014-01-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm surprised that warnings are emitted at lines 939 and 941, but not 944.

I think that instead type casting, the more robust way is to change hook 
functions signatures for on_startup_hook and on_pre_input_hook.

static int
#ifdef _RL_FUNCTION_TYPEDEF /* or may be test libedit macro? */
on_startup_hook(void)
#else
on_startup_hook()
#endif

--

___
Python tracker 

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



[issue20374] Failure to compile with readline-6.3-rc1

2014-01-25 Thread Benjamin Peterson

Benjamin Peterson added the comment:

It doesn't complain on Linux. I suppose if we don't want any warnings, we'd 
have to do something like the originally proposed patch.

--

___
Python tracker 

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



[issue20374] Failure to compile with readline-6.3-rc1

2014-01-25 Thread Ned Deily

Ned Deily added the comment:

FYI, removing the cast causes the following new warnings when compiling 3.3 
with gcc-4.2 on OS X 10.5 and 10.6 (haven't checked elsewhere):

Modules/readline.c: In function 'setup_readline':
Modules/readline.c:939: warning: assignment from incompatible pointer type
Modules/readline.c:941: warning: assignment from incompatible pointer type

--

___
Python tracker 

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



[issue20331] Fix various fd leaks

2014-01-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Charles-François.

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



[issue20331] Fix various fd leaks

2014-01-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6548f894b590 by Serhiy Storchaka in branch '2.7':
Issue #20331: Fixed possible FD leaks in various modules:
http://hg.python.org/cpython/rev/6548f894b590

New changeset 2766320bdb10 by Serhiy Storchaka in branch '3.3':
Issue #20331: Fixed possible FD leaks in various modules:
http://hg.python.org/cpython/rev/2766320bdb10

New changeset b30e57756686 by Serhiy Storchaka in branch 'default':
Issue #20331: Fixed possible FD leaks in various modules:
http://hg.python.org/cpython/rev/b30e57756686

--
nosy: +python-dev

___
Python tracker 

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



[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-25 Thread Tal Einat

Tal Einat added the comment:

To make reproducing these bugs easier, I'm attaching my partially converted 
version of Modules/itertoolsmodules.c, which has the buggy generated code 
inside.

"Partially converted" means that I've only converted some of the functions 
requiring conversion. This file should be in a working state.

--
Added file: http://bugs.python.org/file33704/itertoolsmodule.c

___
Python tracker 

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



[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-25 Thread Tal Einat

Tal Einat added the comment:

Also, I'm seeing this in the generated code for __new__ methods:

if (({self_name} == {self_type_object}) &&

--

___
Python tracker 

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



[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-25 Thread Tal Einat

Tal Einat added the comment:

To clarify my previous comment, I was referring to the first argument passed to 
the generated 'impl' function.

Context: I'm attempting to convert 'itertools.groupby' in 
Modules/itertoolsmodule.c.

--

___
Python tracker 

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



[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-25 Thread Tal Einat

Tal Einat added the comment:

I'm still seeing the first argument to a __new__ function as "groupbyobject *" 
instead of "PyTypeObject *". This causes the following error (for example):

./Modules/itertoolsmodule.c:112:34: error: no member named 'tp_alloc' in 
'groupbyobject'
gbo = (groupbyobject *)type->tp_alloc(type, 0);

--

___
Python tracker 

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



[issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type

2014-01-25 Thread Rodrigo Parra

New submission from Rodrigo Parra:

The functions looks up for the file extension in three maps: types_map, 
suffix_map and encodings_map.

Lookup in types_map is case insensitive (by calling lower() first).
Lookup in both suffix_map and encodings_map is case sensitive.

These can lead to some seemingly counterintuitive results, like:

a)
guess_type("foo.tar") == ("application/x-tar", None)
guess_type("foo.TAR") == ("application/x-tar", None)

b)
guess_type("foo.tgz") == ("application/x-tar", "gzip")
guess_type("foo.TGZ") == (None, None)

c)
guess_type("foo.tar.gz") == ("application/x-tar", "gzip")
guess_type("foo.TAR.GZ") == (None, None)

Lookup should be case insensitive at least for the suffix_map, in which case 
(b) would be solved. The submitted patch implements this change.

As for the encodings_map, I am not so sure, in particular because of the tar.Z 
extension. I found that the compress command expects the uppercase 'Z'. If 
someone is relying in the results of guess_type to call compress, errors could 
occur.

--
components: Library (Lib)
files: case_guess_type.patch
keywords: patch
messages: 209218
nosy: Rodrigo.Parra, tim.golden
priority: normal
severity: normal
status: open
title: Inconsistency with uppercase file extensions in MimeTypes.guess_type
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file33703/case_guess_type.patch

___
Python tracker 

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



[issue20331] Fix various fd leaks

2014-01-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Don't forget to use "hg mv" to rename existing side files.

--

___
Python tracker 

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



[issue20331] Fix various fd leaks

2014-01-25 Thread Charles-François Natali

Charles-François Natali added the comment:

LGTM.

--
nosy: +neologix

___
Python tracker 

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



[issue20391] windows python launcher should support explicit 64-bit version

2014-01-25 Thread Thomas Heller

New submission from Thomas Heller:

The windows python launcher supports the '-3.3' resp. '-3.3-32' command line 
switches to ask for 'the best 3.3' version resp. 'the 32-bit 3.3' version, but 
does not support a '-3.3-64' switch to explicitely request the 64-bit version 
of Python.

I suggest that this support should be added.

--
messages: 209215
nosy: theller
priority: normal
severity: normal
status: open
title: windows python launcher should support explicit 64-bit version
type: enhancement

___
Python tracker 

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



[issue20325] Argument Clinic: self converters are not preserved when cloning functions

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

You didn't supply a test case, nor is there any code checked in that reproduced 
the issue.  I had to make a test case by hand.

--

___
Python tracker 

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



[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-01-25 Thread Charles-François Natali

Charles-François Natali added the comment:

> If the patch is accepted, my changes on Python 3.3 should also be
reverted.

I'm sorry, but I'm not convinced.
The selector's granularity is an implementation detail, and I don't think
it should be exposed.
Furthermore, it's not a mere function of the C type used to represent the
timeout to the underlying syscall (long, timeval): it also depends on the
operating system, the hardware, etc.

Once again, what's wrong with your initial approach of ceiling the timeout?
It does seem reasonable to round away from zero, to ensure - not taking OS
bugs/limitations - that select() will wait at least the passed timeout.

--

___
Python tracker 

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



[issue20325] Argument Clinic: self converters are not preserved when cloning functions

2014-01-25 Thread Tal Einat

Tal Einat added the comment:

You're right, this issue does indeed seem to have been resolved since I created 
this issue. I just checked this on Objects/bytesobject.c with the latest 
version and get the desired output. So you've done right to close this issue.


I'd like to note that I most certainly did supply a way to reproduce this 
issue! I described it precisely and concisely. Consider, also, that I was only 
asking if this is a bug since I wasn't sure. If someone had replied "this 
sounds like a bug, please supply code for which reproduces this" then I would 
have supplied such code.

Just to be sure, I just checked this again with clinic.py from revision 
88635:fbc31e0b0c77 (Tue Jan 21, the day I reported this issue) and I get 
precisely the behavior I described. So the issue did exist at the time when I 
reported it and the test case I supplied is sound.

--

___
Python tracker 

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



[issue19023] ctypes docs: Unimplemented and undocumented features

2014-01-25 Thread Adam Knight

Adam Knight added the comment:

Can someone add this in?  What needs to be done to make it happen? Kind of need 
this for a project I'm working on...

--
nosy: +ahknight

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Nick Coghlan

Nick Coghlan added the comment:

LGTM, but I'm not familiar with Clinic's own code...

--

___
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-01-25 Thread Mark Lawrence

Mark Lawrence added the comment:

>From a user perspective the docs say this "itertools.repeat(object[, times]) - 
>Make an iterator that returns object over and over again. Runs indefinitely 
>unless the times argument is specified."  So to me the use of "Times=None" in 
>the "equivalent to" section is simply a red herring, as the user often won't 
>bother reading this and certainly won't see it from interactive help.  As for 
>negative times values I'd say leave it as is, although it someone was to 
>suggest deprecating this behaviour and raising a ValueError instead I'd have 
>no objections.

--

___
Python tracker 

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



[issue20231] Argument Clinic accepts no-default args after default args

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

The bug you cited is fixed in today's rollup patch, #20390.  (I don't know how 
to denote the dependency between the two issues, maybe someone else can do that 
for me?)

--

___
Python tracker 

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



[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

The bug you cited is fixed in today's rollup patch, #20390.  (I don't know how 
to denote the dependency between the two issues, maybe someone else can do that 
for me?)

--

___
Python tracker 

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



[issue20348] Argument Clinic HOWTO listed multiple times in HOWTO index

2014-01-25 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the patch!

--
assignee: larry -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue20390] Argument Clinic rollup patch, 2014/01/25

2014-01-25 Thread Larry Hastings

New submission from Larry Hastings:

Rollup patch with a bunch of small fixes in it.  Can I get a quick turnaround 
review on this?  I'd like it to go in before today's beta is cut.  Definitely 
the core change has to go in, but that's uncontroversial.

  Core:
  * _PyType_GetDocFromInternalDoc() and
_PyType_GetTextSignatureFromInternalDoc() are now marked
 Py_LIMITED_API.

  Tools:
  * The default filename for the "file" preset is now:
 "clinic/{filename}.h".

  * The "class" directive syntax has been extended with two new required
arguments: "typedef" and "type_object".  "typedef" should be the
equivalent C type for this Python class, presented as a
pointer-to-type.  "type_object" should be an expression that
evaluates to a PyTypeObject * for this Python type.  Example:
class dict "PyDictObject *" "&PyDict_Type"
This was necessary for the next item.

  * If __new__ or __init__ functions did not use kwargs (or args), the
PyArg_NoKeywords (or PyArg_NoPositional) calls generated are only
run if the type object is an exact match.  (Otherwise subclasses
will not be allowed to start accepting those kinds of arguments.)

  * Argument Clinic now fails if you have required parameters after
optional parameters.

  * Converters now have a new template they can inject code into:
it's called "modifiers", and code put there is run in the parsing
function after argument parsing but before the call to the impl.
"modifiers" is intended for converters that may want dynamic
default values.  An example string you might add:
"if ({name} == NULL)\nname = time(NULL);"

--
assignee: larry
components: Demos and Tools
files: larry.clinic.rollup.jan.25.diff.1.txt
messages: 209205
nosy: larry, ncoghlan, serhiy.storchaka, zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: Argument Clinic rollup patch, 2014/01/25
type: enhancement
versions: Python 3.4
Added file: 
http://bugs.python.org/file33702/larry.clinic.rollup.jan.25.diff.1.txt

___
Python tracker 

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



[issue20348] Argument Clinic HOWTO listed multiple times in HOWTO index

2014-01-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1eec62cf3675 by Ezio Melotti in branch 'default':
#20348: fix headers markup in Argument Clinic howto.  Patch by Moritz Neeb.
http://hg.python.org/cpython/rev/1eec62cf3675

--
nosy: +python-dev

___
Python tracker 

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



[issue20184] Derby #16: Convert 50 sites to Argument Clinic across 9 files

2014-01-25 Thread Nick Coghlan

Nick Coghlan added the comment:

More comprehensive patch uploaded - all the non-type callables implemented in 
bltinmodule.c have been converted or classified with a reason for not being 
converted yet (see the new test in test_inspect.py for details, as well as the 
AC 3.4 and AC 3.5 comments in the module itself).

I also cleaned up the docstrings for the builtins I actually changed in the 
patch. There were a few that had never been properly updated for the Py3k 
transition.

There are still a couple of test failures with this version - the doctest tests 
get confused by the fact ord and chr now have a doctest in their docstrings, 
and test_gdb is definitely not in a happy place (that has always been 
temperamental, though).

I also just realised the Unicode character in the new ord and chr docstrings 
could pose a compatibility problem at the C compiler source encoding level, so 
we may have to reconsider that (even though I was rather happy to sneak that 
obscure Monty Python reference in there).

--
Added file: 
http://bugs.python.org/file33701/issue20184_builtin_conversion_v2.diff

___
Python tracker 

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



[issue20325] Argument Clinic: self converters are not preserved when cloning functions

2014-01-25 Thread Larry Hastings

Larry Hastings added the comment:

You didn't give me a test case, and I can't reproduce this.  Either it was 
accidentally fixed already, or there's something else going on in your test 
case.

I'm closing this for now as unreproducable.  If you see the problem again, 
please reopen this issue.

--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-01-25 Thread STINNER Victor

STINNER Victor added the comment:

I revert all changes in select an selectors, the timeout is rounded again 
towards zero, as it was before.

I applied my asyncio_granularity.patch:
- selectors.BaseSelector has a new abstract "resolution" property
- asyncio.BaseEventLoop has a new granularity attribute which is used in 
_run_once() to round timings

I don't like hurry to push changes without review, but I wanted to revert my 
changes on select and selectors and fix the issue in asyncio issue before 
Python 3.4 beta 3.

I'm now waiting for buildbots. Don't hesitate to review my changes on selectors 
(new resolution attribute) and asyncio (new granularity attribute).

For selectors, I chose an abstract attribute to ensure that the resolution is 
defined in subclasses of BaseSelector and because it does not make sense to 
modify the resolution.

For asyncio, it's a classic attribute because a subclass may want to adjust the 
granularity if it overrides the time() method, or for other reasons.

--

___
Python tracker 

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



  1   2   >