[issue9521] xml.etree.ElementTree skips processing instructions when parsing

2014-01-20 Thread Stefan Behnel

Stefan Behnel added the comment:

> As for backwards compatibility: yes, this is a concern. The keyword argument 
> would be a solution. On the other hand, I'm not sure that the default should 
> be something that causes dataloss...?

It's a matter of use cases. How often do people care? My experience tells me 
that it's much more common to parse XML in and extract information from it, 
than to do round trips. And when extracting information, both comments and 
processing instructions usually get in the way.

So I would say that this default behaviour isn't wrong. In fact, I'd even say 
that both lxml and ET behave as expected (or at least as intended) in their own 
ways.

Also, I can't really remember spotting a processing instruction anywhere 
*inside* of a root element in real world XML. For those living next to it, ET 
currently lacks support in its tree model.


> lxml sounds like it's doing the right things. Is there some connection 
> between lxml and etree that I'm not aware of, or did you just give it as an 
> example of how a different library behaves?

Both implement (essentially) the same API, so I consider compatibility and 
look-alikes important. The general idea is that lxml extends what's there, but 
otherwise tries to stay compatible as good as it can.

BTW, lxml also allows parser target objects to have "pi(self, target, data)" 
and "comment(text)" methods, through which it can pass comments and PIs through 
to user provided tree builders. I think ET lacks those, too.


Changing target version from 3.3/3.4 to 3.5 as this is a new feature that is 
unlikely to make it into a currently released (or close to release) Python 
version. Also changing the ticket type to enhancement as the current behaviour 
isn't "wrong". It's rather a matter of supporting an additional use case.

--
type: behavior -> enhancement
versions: +Python 3.5 -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



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

2014-01-20 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the patch for typeobject. I didn't convert the new method. It's so 
complicated. It counts whether how many arguments or keywords you pass. It 
asserts the args before parsing the args. I don't think clinic supports this.

This is the code:
assert(args != NULL && PyTuple_Check(args));
assert(kwds == NULL || PyDict_Check(kwds));

/* Special case: type(x) should return x->ob_type */
{
const Py_ssize_t nargs = PyTuple_GET_SIZE(args);
const Py_ssize_t nkwds = kwds == NULL ? 0 : PyDict_Size(kwds);

if (PyType_CheckExact(metatype) && nargs == 1 && nkwds == 0) {
PyObject *x = PyTuple_GET_ITEM(args, 0);
Py_INCREF(Py_TYPE(x));
return (PyObject *) Py_TYPE(x);
}

/* SF bug 475327 -- if that didn't trigger, we need 3
   arguments. but PyArg_ParseTupleAndKeywords below may give
   a msg saying type() needs exactly 3. */
if (nargs + nkwds != 3) {
PyErr_SetString(PyExc_TypeError,
"type() takes 1 or 3 arguments");
return NULL;
}
}

/* Check arguments: (name, bases, dict) */
if (!PyArg_ParseTupleAndKeywords(args, kwds, "UO!O!:type", kwlist,
 &name,
 &PyTuple_Type, &bases,
 &PyDict_Type, &orig_dict))
return NULL;

--
Added file: http://bugs.python.org/file33561/clinic_typeobject.patch

___
Python tracker 

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



[issue20165] unittest TestResult wasSuccessful returns True when there are unexpected successes

2014-01-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1e75ab9fd760 by Gregory P. Smith in branch 'default':
Fixes Issue #20165: The unittest module no longer considers tests marked with
http://hg.python.org/cpython/rev/1e75ab9fd760

--
nosy: +python-dev

___
Python tracker 

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



[issue20165] unittest TestResult wasSuccessful returns True when there are unexpected successes

2014-01-20 Thread Gregory P. Smith

Changes by Gregory P. Smith :


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



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

2014-01-20 Thread Vajrasky Kok

Changes by Vajrasky Kok :


Removed file: http://bugs.python.org/file33561/clinic_typeobject.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-01-20 Thread Vajrasky Kok

Changes by Vajrasky Kok :


Added file: http://bugs.python.org/file33562/clinic_typeobject.patch

___
Python tracker 

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



[issue20309] Not all descriptors are callable

2014-01-20 Thread Armin Rigo

Armin Rigo added the comment:

Instances of 'staticmethod' or 'classmethod' are not callable.  I'm unsure why 
not, but it's good enough, as you need to go through various unexpected hops in 
order to try to call one.

'dict.fromkeys' is not a classmethod, as seen by "dict.__dict__['fromkeys']".  
It's an internal object usually never seen by Python code.  I believe this is 
only because implementing a regular classmethod in C would be rather messy.

--

___
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) must round the timeout to the upper bound

2014-01-20 Thread STINNER Victor

New submission from STINNER Victor:

Hi, while comparing performances of Tulip and Trollius projects (asyncio 
module), I found a bug. The event loop is called too many times when a callback 
is scheduled with a timeout and the epoll selector is used, especially for 
timeout close to one millisecond.

In my opinion, it's a bug in epoll.poll(): it should wait *at least* timeout 
seconds if no event is received, not shorter.

Pseudo-code of Tulip:
---
timeout = scheduled[0].when - time.monotonic()
events = selector.select(timeout)
process_events(events)
while scheduled:
   if scheduled[0].when > time.monotonic():
  break
   ...
---

The problem is that "scheduled[0].when > time.monotonic()" test fails because 
epoll.poll() returns in less than timeout seconds.

The difference between the timeout and elapsed time is very small, less than 1 
millisecond.

Attached patch fixes this issue by rounding the timeout to the upper bound.

The rounding is different than datetime.timedelta constructor for example, 
because the usecase is different. epoll.poll(0.0001) calls epoll_wait() with a 
timemout of 1 millisecond (1e-4 rounded to 1e-3).

epoll.poll(0.0) still calls epoll_wait() with a timeout of 0 millisecond. I 
don't think that it's possible to write a reliable unit test for that on our 
slow buildbots.

--
files: epoll_timeout.patch
keywords: patch
messages: 208532
nosy: gvanrossum, haypo, neologix, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: epoll.poll(timeout) must round the timeout to the upper bound
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file33563/epoll_timeout.patch

___
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) must round the timeout to the upper bound

2014-01-20 Thread STINNER Victor

STINNER Victor added the comment:

Bug report in Tulip project, the bug affects also the new asyncio module of 
Python 3.4:
http://code.google.com/p/tulip/issues/detail?id=106

--

___
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) must round the timeout to the upper bound

2014-01-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Looks good to me on the principle.

--

___
Python tracker 

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



[issue17481] inspect.getfullargspec should use __signature__

2014-01-20 Thread Nick Coghlan

Nick Coghlan added the comment:

Ah, I had indeed missed the fact that getfullargspec() was still calling 
isfunction(). In that case, is the patch currently actually buying us anything 
much beyond handling __signature__ attributes? Most of the new types that 
inspect.signature() supports will still fail that preliminary check, so code 
will need to use the new API explicitly in order to benefit from it.

By contrast, if we remove the check, then there's a wider range of exceptions 
that may be thrown, but also a much wider variety of inputs supported.

Instead of keeping the check, we could just unconditionally convert exceptions 
from the signature call to a TypeError in order to maintain compatibility with 
the old external behaviour.

--

___
Python tracker 

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



[issue20309] Class method descriptors are different between builtin and user classes

2014-01-20 Thread Nick Coghlan

Nick Coghlan added the comment:

I believe it's just a matter of pattern of use - applying staticmethod
outside a class (or retrieving the descriptor directly from the dict,
bypassing the descriptor protocol), so nobody every noticed.

Ditto for the C wrapper vs the Python wrapper for a classmethod - it's
really rare to access those without going through the descriptor
machinery, so it's likely just an accident of implementation that one
of them isn't callable.

I don't see any specific reason for them to be non-callable - I
suspect it's just a case of never adding the code to make it happen.

--
title: Not all descriptors are callable -> Class method descriptors are 
different between builtin and user classes

___
Python tracker 

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



[issue20222] unittest.mock-examples doc uses builtin file which is removed in Python 3

2014-01-20 Thread Michael Foord

Michael Foord added the comment:

Thanks for picking this up. /file/open/ should be fine.

--

___
Python tracker 

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



[issue20309] Not all method descriptors are callable

2014-01-20 Thread Nick Coghlan

Nick Coghlan added the comment:

Oh, so that's how that happens :)

(the title reverted because I replied via email from a part of the thread 
before Larry changed the issue name)

--
title: Class method descriptors are different between builtin and user classes 
-> Not all method descriptors are callable

___
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) must round the timeout to the upper bound

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

Charles-François Natali added the comment:

AFAICT, this also affects poll().
Although it's supposed to be passed an integer, passing a float will result
in a truncation towards 0:
"""
$ strace -e poll python -c "import select; p = select.poll(); p.poll(0.9)"
poll(0x23321b0, 0, 0)   = 0 (Timeout)
"""

See also this line in PollSelector:
"""
def select(self, timeout=None):
timeout = None if timeout is None else max(int(1000 * timeout),
0)
"""

This will round timeout=1e-4 to 0.

--

___
Python tracker 

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



[issue20307] Android's failure to expose SYS_* system call constants causes _posixsubprocess cross-compilation to fail

2014-01-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2014-01-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +haypo, skrah

___
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-20 Thread STINNER Victor

STINNER Victor added the comment:

select.select(), selectors.PollSelector.select(), select.epoll.poll(), 
select.kqueue.control() have the bug.

OS multiplexers:

- select: microsecond resolution (10^-6), timeout converted by 
_PyTime_ObjectToTimeval() which converts 1e-7 to zero => BUG!
- poll: millisecond resolution (10^-3) but expects int type, select is ok, 
selectors uses int(1000 * timeout) which converts 1e-4 to zero => BUG!
- epoll: millisecond resolution (10^-3), select uses (int)(dtimeout * 1000.0) 
which converts 1e-4 to zero => BUG!
- devpoll: millisecond resolution (10^-3) but expects int type, select is ok, 
selectors doesn't support it yet => ok
- kqueue: nanosecond resolution (10^-9), timeout converted by 
_PyTime_ObjectToTimespec() which converts 1e-10 to zero => BUG!

_PyTime_ObjectToTimeval() is used in various places:

- datetime.datetime.fromtimestamp(), datetime.datetime.utcfromtimestamp()
- select.select(), 

_PyTime_ObjectToTimespec() is used in various places:

- posix.utime()
- signal.sigtimedwait()
- select.kqueue.control()
- time.clock_settime()

A new parameter should be added to _PyTime_ObjectToTimeval() and 
_PyTime_ObjectToTimespec() to choose the rounding method.

--

I saw the bug with poll and epoll because these functions have the worst 
resolution (millisecond). Attached patch fixes poll and epoll, and add a 
generic test on all selectors: select_round_timeout.patch.

According to my test, select.select() has an effective resolution of 0.1 ms 
(10^4) on my Fedora 19 (Linux kernel 3.12), so I don't think that the select 
rounding issue is important. Tell me if you consider that 
_PyTime_ObjectToTime*() (select, kqueue) should be fixed. If yes, I will open a 
separated issue (because the implementation is different and it may impact 
other unrelated functions).

--
title: epoll.poll(timeout) must round the timeout to the upper bound -> 
epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to 
the upper bound
Added file: http://bugs.python.org/file33564/select_round_timeout.patch

___
Python tracker 

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



[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2014-01-20 Thread Stefan Krah

Stefan Krah added the comment:

I agree with Marc-Andre.  Also, we should have an Android buildbot.

--

___
Python tracker 

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



[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2014-01-20 Thread STINNER Victor

STINNER Victor added the comment:

Is there the only patch required to compile Python 3.4 on Android?

--

___
Python tracker 

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



[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.

2014-01-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f82b6ec1ae6e by Stefan Krah in branch '3.3':
Issue #19036: Including locale.h should not depend on HAVE_LANGINFO_H.
http://hg.python.org/cpython/rev/f82b6ec1ae6e

--
nosy: +python-dev

___
Python tracker 

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



[issue19036] setlocale fails due to locale.h being wrapped up in LANGINFO check.

2014-01-20 Thread Stefan Krah

Changes by Stefan Krah :


--
resolution: remind -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> compile error

___
Python tracker 

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



[issue20301] Correct docs for default access argument for DeleteKeyEx

2014-01-20 Thread Zachary Ware

Changes by Zachary Ware :


--
nosy: +zach.ware

___
Python tracker 

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



[issue20309] Not all method descriptors are callable

2014-01-20 Thread R. David Murray

R. David Murray added the comment:

See also issue 19072 for previous report of the classmethod problem.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue20312] A missing link to Python-3.4.0b2.tar.bz2 in the download page.

2014-01-20 Thread Marco Buttu

New submission from Marco Buttu:

At the page:

http://www.python.org/getit/releases/3.4.0/

the link:

http://www.python.org/ftp/python/3.4.0/Python-3.4.0b2.tar.bz2

does not work.

--
assignee: docs@python
components: Documentation
messages: 208545
nosy: docs@python, marco.buttu
priority: normal
severity: normal
status: open
title: A missing link to Python-3.4.0b2.tar.bz2 in the download page.
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



[issue20310] Recommend using pprint for deterministic doctest

2014-01-20 Thread R. David Murray

R. David Murray added the comment:

I think suggesting pprint is a great idea.  It also has another advantage in 
3.4: in many cases it should produce output that is line wrapped such that 
NORMALIZE_WHITESPACE isn't needed.

However, I'd make it as an *additional* suggestion.  Pedagogically, sort makes 
it clear that you *must* resolve the problem of the ordering of dict 
items...then you can suggest pprint as something that also sorts, and has some 
additional nice properties as well.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue17481] inspect.getfullargspec should use __signature__

2014-01-20 Thread Yury Selivanov

Yury Selivanov added the comment:

> Instead of keeping the check, we could just unconditionally convert 
> exceptions from the signature call to a TypeError in order to maintain 
> compatibility with the old external behaviour.

Agreed. See the new patch (getargsspec_02.patch)

Unfortunately, we have to keep the old 'ismethod' check in place for backwards 
compatibility purposes.

Larry,

The attached patch contains one failing unit-test: 'inspect.signature' returns 
'None' for '_testapi.docstring_no_signature'. It should instead raise a 
ValueError.

--
Added file: http://bugs.python.org/file33565/getargsspec_02.patch

___
Python tracker 

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



[issue20313] inspect.signature should raise ValueError for builtins with no signature info

2014-01-20 Thread Yury Selivanov

New submission from Yury Selivanov:

'inspect.signature' currently returns 'None' for builtins with no signature 
information. However, the protocol is that it raises a "ValueError(callable is 
not supported by signature)" if object is callable, but a signature can not be 
provided.

Attached patch fixes this, as well as updates the relevant section in the 
inspect.signature documentation.

--
components: Library (Lib)
files: sig_builtin_01.patch
keywords: patch
messages: 208548
nosy: brett.cannon, larry, ncoghlan, yselivanov
priority: normal
severity: normal
status: open
title: inspect.signature should raise ValueError for builtins with no signature 
info
versions: Python 3.4
Added file: http://bugs.python.org/file33566/sig_builtin_01.patch

___
Python tracker 

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



[issue17481] inspect.getfullargspec should use __signature__

2014-01-20 Thread Yury Selivanov

Yury Selivanov added the comment:

Larry,

I created a separate issue for that: http://bugs.python.org/issue20313

--

___
Python tracker 

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



[issue20313] inspect.signature should raise ValueError for builtins with no signature info

2014-01-20 Thread Zachary Ware

Zachary Ware added the comment:

This is already a part of issue20189 (except the doc fix).

--
nosy: +zach.ware

___
Python tracker 

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



[issue20075] help(open) eats first line

2014-01-20 Thread Zachary Ware

Zachary Ware added the comment:

Gennadiy, sorry this stalled out like it did.

The patched function will be moving as part of issue20189.  Larry, if you want 
to incorporate this patch into that patch, please do so; otherwise I'll get 
this one updated and committed as soon after you commit that one as I can.  
Gennadiy, if you beat me to updating this patch after Larry commits #20189, 
please do so.

(Setting priority as 'critical' since it would be quite embarrassing to release 
3.4.0 with broken "help(open)".)

--
dependencies: +inspect.Signature doesn't recognize all builtin types
priority: normal -> critical

___
Python tracker 

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



[issue20313] inspect.signature should raise ValueError for builtins with no signature info

2014-01-20 Thread Yury Selivanov

Yury Selivanov added the comment:

I see. Could you please incorporate the doc change and unittests into the patch 
for #20189?

--

___
Python tracker 

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



[issue20314] Potentially confusing formulation in 6.1.4. Template strings

2014-01-20 Thread Gerrit Holl

New submission from Gerrit Holl:

The standard library documentation “6.1. string — Common string operations” 
describes string formatting through the `.format` method and the corresponding 
mini-language, and the `Template` class.  In the part describing the `Template` 
class (6.1.4) is the text:

> Instead of the normal %-based substitutions, Templates support $-based 
> substitutions, using the following rules:

This is potentially confusing.  The documentation in this section has not made 
any mention of %-based substitutions.  Rather, a novel reader may, at this 
point, think that {}-based substitution is normal.  I would suggest to resolve 
this issue by simply not mentioning %-based substitutions, replacing the 
sentence above by:

> Templates support $-based substitutions, using the following rules:

--
assignee: docs@python
components: Documentation
messages: 208553
nosy: Gerrit.Holl, docs@python
priority: normal
severity: normal
status: open
title: Potentially confusing formulation in 6.1.4. Template strings
type: enhancement
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



[issue20314] Potentially confusing formulation in 6.1.4. Template strings

2014-01-20 Thread Georg Brandl

Georg Brandl added the comment:

+1.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue20312] A missing link to Python-3.4.0b2.tar.bz2 in the download page.

2014-01-20 Thread Georg Brandl

Changes by Georg Brandl :


--
assignee: docs@python -> larry
nosy: +larry

___
Python tracker 

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



[issue20171] Derby #2: Convert 115 sites to Argument Clinic in Modules/_cursesmodule.c

2014-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is half-baked (just for demonstration) patch for the _curses and 
_curses_panel modules.

Known issues:

* The chgat, getstr, and instr methods have signatures which can't be processed 
by current Argument Clinic (issue20303).

* Signatures of the noutrefresh and refresh methods depends on compile-time 
options.

* Many other functions are defined optionally. But the #ifdef trick doesn't 
work with side file destination.

* A lot of functions are generated by preprocessor. We can't use Argument 
Clinic for them (if not increase the volume of code too much). I think 
preprocessor should be used to generate docstrings with signature (done in the 
_curses_panel module).

* Functions in these modules have not docstrings at all. I try to add 
docstrings (simplified descriptions from the documentation file), but may be we 
should do this in separate issue.

I have temporary added the window class to the _curses module and the panel 
classes to the _curses_panel modules. Now you can examine docstrings of 
_curses.window and _curses_panel.panel with pydoc.

--
keywords: +patch
Added file: http://bugs.python.org/file33567/curses_clinic.patch

___
Python tracker 

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



[issue20314] Potentially confusing formulation in 6.1.4. Template strings

2014-01-20 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Jan 20, 2014, at 05:10 PM, Gerrit Holl wrote:

>This is potentially confusing.  The documentation in this section has not
>made any mention of %-based substitutions.  Rather, a novel reader may, at
>this point, think that {}-based substitution is normal.  I would suggest to
>resolve this issue by simply not mentioning %-based substitutions, replacing
>the sentence above by:
>
>> Templates support $-based substitutions, using the following rules:

+1

PEP 292 templates predate .format().

--
nosy: +barry
title: Potentially confusing formulation in 6.1.4. Template strings -> 
Potentially confusing formulation in 6.1.4. Template strings

___
Python tracker 

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



[issue20314] Potentially confusing formulation in 6.1.4. Template strings

2014-01-20 Thread Zachary Ware

Zachary Ware added the comment:

I would suggest moving the section "4.7.2. printf-style String Formatting" from 
stdtypes to string, alongside the other two formatting specifications, or 
otherwise moving %-formatting and {}-formatting into the same page that is not 
stdtypes.  4.7.2 is a pretty long section, and it seems odd to me that it is 
still in that page instead of with the other string formatting specs, though it 
is the only place that would have made sense in a pre-{}-and-$-formatting world.

On the other hand, Gerrit's proposed solution is a *lot* simpler :)

--
nosy: +zach.ware

___
Python tracker 

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



[issue20314] Potentially confusing formulation in 6.1.4. Template strings

2014-01-20 Thread Zachary Ware

Changes by Zachary Ware :


--
versions: +Python 2.7, Python 3.4

___
Python tracker 

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



[issue20314] Potentially confusing formulation in 6.1.4. Template strings

2014-01-20 Thread Georg Brandl

Georg Brandl added the comment:

> I would suggest moving the section "4.7.2. printf-style String
> Formatting" from stdtypes to string

That's something I wanted to do for a long time.  Problem is that 
non-Intersphinx external links will break (and I guess quite a few people have 
a bookmark on that section)... so it might be good to keep 4.7.2 with a pointer.

--

___
Python tracker 

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



[issue20315] Remove old compatibility code

2014-01-20 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch removes the code which supports compatibility with old Python 
2.x versions. As far as these files are never used with Python 2.x (and the 
compatibility was broken by other differences between 2.x and 3.x), this code 
can be removed from 3.x.

--
files: py2_compat.patch
keywords: patch
messages: 208559
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Remove old compatibility code
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file33568/py2_compat.patch

___
Python tracker 

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



[issue19966] Wrong mtimes of files in 3.3.3 tarballs

2014-01-20 Thread Georg Brandl

Changes by Georg Brandl :


--
priority: normal -> release blocker

___
Python tracker 

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



[issue20315] Remove old compatibility code

2014-01-20 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Seems good to me.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2014-01-20 Thread Shiz

Shiz added the comment:

I managed to cross-compile Python 3.3.3 for arm-linux-androideabi (using the 
Android NDK r9c) with the patches in this issue, issue 20306 and issue 20307. 
It did require a small additional patch which addressed the fact that the host 
system can't run the generated parser generator, which I'll make an issue for 
as soon as I refactored the patch. The patch allows the user to specify a host 
parser generator that points to a compiled version of pgen that is runnable on 
the host through the HOSTPGEN environment variable in ./configure.

Compiling the tip proved somewhat harder as the cross-compilation requires a 
host Python of the same version, which I didn't have. I formatted a patch which 
allows the user to supply a special host python path using the HOSTPYTHON 
environment variable to ./configure. I'll make an issue for that soon, and will 
bundle it with the HOSTPGEN patch if it's seen as a sufficient approach.

As far as maintaining an Android port for CPython goes; I may be interested in 
this as I'd need to regularly use it anyway. Can anyone tell me what the 
possibilities are here?

Since in the meanwhile the tip was updated to unconditionally include locale.h 
in Python/fileutils.c according to issue 19036, here's an updated patch for 
this issue that applies cleanly against the tip.

--
Added file: 
http://bugs.python.org/file33569/Python-3.4-d51d6f1f9db8-workaround-android-locale-issues.patch

___
Python tracker 

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



[issue20316] Byte-compiled files should be absent in tarballs

2014-01-20 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis:

Tarballs of 3.3.2 (and all previous versions tested by me) do not contain any 
*.py[co] files.
Tarballs of 3.3.3 contain 1 .pyc file, which is even generated for wrong Python 
version:

$ find -name "*.py[co]"
./Tools/hg/hgtouch.pyc
$ file Tools/hg/hgtouch.pyc
Tools/hg/hgtouch.pyc: python 2.7 byte-compiled

Please ensure that this problem will not occur with future tarballs.

--
messages: 208562
nosy: Arfrever, georg.brandl
priority: normal
severity: normal
status: open
title: Byte-compiled files should be absent in tarballs
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



[issue20316] Byte-compiled files should be absent in tarballs

2014-01-20 Thread Georg Brandl

Changes by Georg Brandl :


--
nosy: +larry
priority: normal -> release blocker

___
Python tracker 

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



[issue20309] Not all method descriptors are callable

2014-01-20 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue20316] Byte-compiled files should be absent in tarballs

2014-01-20 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

Potential fix:

--- Makefile.pre.in
+++ Makefile.pre.in
@@ -1487,4 +1487,4 @@
 # Touch generated files
 touch:
-   hg --config extensions.touch=Tools/hg/hgtouch.py touch -v
+   PYTHONDONTWRITEBYTECODE=1 hg --config 
extensions.touch=Tools/hg/hgtouch.py touch -v

--

___
Python tracker 

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



[issue20316] Byte-compiled files should be absent in tarballs

2014-01-20 Thread Larry Hastings

Larry Hastings added the comment:

Your fix won't work, because release managers call hgtouch from a different 
spot, from a private tool called "release.py".

You'll notice that all the 3.4 releases have that hgtouch.pyc file--up until 
3.4b2.  I already found that bug.  I added "Tools/hg/hgtouch.pyc" to the tuple 
of "files we don't want in tarballs" in export() in release.py.  Didn't push it 
because I was doing other hacking and it wasn't ready, but I could push just 
that change.

--

___
Python tracker 

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



[issue20316] Byte-compiled files should be absent in tarballs

2014-01-20 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

When Mercurial is ported to Python 3 somewhen in the future, then e.g. 
Tools/hg/__pycache__/hgtouch.cpython-34.pyc could be generated, so 
PYTHONDONTWRITEBYTECODE=1 might still be useful in release.py.

--

___
Python tracker 

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



[issue20316] Byte-compiled files should be absent in tarballs

2014-01-20 Thread Larry Hastings

Larry Hastings added the comment:

The construction of release.py would make it easy to just always pass it in 
when running Python (and hg, and any program).  Maybe that's a better choice.

--

___
Python tracker 

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



[issue20315] Remove old compatibility code

2014-01-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5f754f1e3194 by Serhiy Storchaka in branch '3.3':
Issue #20315: Removed support for backward compatibility with early 2.x 
versions.
http://hg.python.org/cpython/rev/5f754f1e3194

New changeset ede054eb3dc1 by Serhiy Storchaka in branch 'default':
Issue #20315: Removed support for backward compatibility with early 2.x 
versions.
http://hg.python.org/cpython/rev/ede054eb3dc1

--
nosy: +python-dev

___
Python tracker 

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



[issue20315] Remove old compatibility code

2014-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks for your review Benjamin.

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



[issue20262] Convert some debugging prints in zipfile to warnings

2014-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Benjamin just have approved it for 2.7.

--
assignee:  -> serhiy.storchaka
versions: +Python 2.7

___
Python tracker 

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



[issue19966] Wrong mtimes of Include/Python-ast.h and Python/Python-ast.c in tarballs

2014-01-20 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

Apparently at least 3.4.0b2 tarballs are also affected.

--
nosy: +larry
title: Wrong mtimes of files in 3.3.3 tarballs -> Wrong mtimes of 
Include/Python-ast.h and Python/Python-ast.c in tarballs
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



[issue20267] TemporaryDirectory does not resolve path when created using a relative path

2014-01-20 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +georg.brandl, ncoghlan

___
Python tracker 

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



[issue20267] TemporaryDirectory does not resolve path when created using a relative path

2014-01-20 Thread Yury Selivanov

Yury Selivanov added the comment:

This looks like a bug to me (or we should complain if a relative 'dir' was 
passed).

I'm attaching a patch that fixes this, although I'm not sure if the unittest I 
wrote will work on windows.

Moreover, 'mkstemp' and 'mktemp' have the same bug (separate issue for them?)

--
keywords: +patch
nosy: +yselivanov
Added file: http://bugs.python.org/file33570/tempfile_01.patch

___
Python tracker 

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



[issue20316] Byte-compiled files should be absent in tarballs

2014-01-20 Thread Benjamin Peterson

Benjamin Peterson added the comment:

http://hg.python.org/release/rev/9272f4fd7689

--
nosy: +benjamin.peterson
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



[issue20316] Byte-compiled files should be absent in tarballs

2014-01-20 Thread Georg Brandl

Georg Brandl added the comment:

> When Mercurial is ported to Python 3 somewhen in the future

Good one.

--

___
Python tracker 

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



[issue20317] ExitStack hang if enough nested exceptions

2014-01-20 Thread jcflack

New submission from jcflack:

Python 3.3.2 (default, Dec  4 2013, 20:19:27) 
[GCC 4.7.3] on linux (gentoo)

Suppose we create a context manager that will fail during exit because of a 
simple coding error:

@contextmanager
def f():
 try:
  yield 6
 finally:
  throdbog() # woops, forgot to define this

Now let's stack up a few of these:

with ExitStack() as stack:
 i = stack.enter_context(f())
 i = stack.enter_context(f())
 i = stack.enter_context(f())
 print(i)

... prints 6, then hangs, won't respond to ^C, can be killed.

Three levels on the stack seems to be the magic number. With one or two it 
works as expected ("During handling of the above exception, another exception 
occurred", etc.).

Is the ExitStack code somehow creating a circularly-linked exception structure 
when there are three levels?

--
components: Library (Lib)
messages: 208574
nosy: jcflack
priority: normal
severity: normal
status: open
title: ExitStack hang if enough nested exceptions
type: crash
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



[issue20262] Convert some debugging prints in zipfile to warnings

2014-01-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 208fa45672c2 by Serhiy Storchaka in branch '2.7':
Issue #20262: Warnings are raised now when duplicate names are added in the
http://hg.python.org/cpython/rev/208fa45672c2

New changeset 9fda6658c01a by Serhiy Storchaka in branch '3.3':
Issue #20262: Warnings are raised now when duplicate names are added in the
http://hg.python.org/cpython/rev/9fda6658c01a

New changeset f7cebf727bc6 by Serhiy Storchaka in branch 'default':
Issue #20262: Warnings are raised now when duplicate names are added in the
http://hg.python.org/cpython/rev/f7cebf727bc6

--
nosy: +python-dev

___
Python tracker 

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



[issue20317] ExitStack hang if enough nested exceptions

2014-01-20 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue20312] A missing link to Python-3.4.0b2.tar.bz2 in the download page.

2014-01-20 Thread Georg Brandl

Georg Brandl added the comment:

Fixed.

--
nosy: +georg.brandl
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



[issue20262] Convert some debugging prints in zipfile to warnings

2014-01-20 Thread Serhiy Storchaka

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



[issue20318] subprocess.Popen can hang in threaded applications

2014-01-20 Thread Andrew Lutomirski

New submission from Andrew Lutomirski:

Running python python_thread_bug.py -j4 often results in one of the threads 
failing to start until another thread finishes.

The bug appears to be that subprocess's pipe_cloexec function is racy: if 
another thread forks between os.pipe() and _set_cloexec_flag, then the 
resulting process could hang on to the write end of the pipe.  That will cause 
the Popen call that got rudely interrupted to wait until the whole resulting 
process tree dies.

--
components: Library (Lib)
files: python_thread_bug.py
messages: 208577
nosy: Andrew.Lutomirski
priority: normal
severity: normal
status: open
title: subprocess.Popen can hang in threaded applications
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file33571/python_thread_bug.py

___
Python tracker 

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



[issue20318] subprocess.Popen can hang in threaded applications

2014-01-20 Thread R. David Murray

R. David Murray added the comment:

Hmm.  I thought someone had already reported this, but I can't find an issue.  
I suspect it is fixed in 3.4 and it may not be practical to fix it in earlier 
versions.

--
nosy: +gps, haypo, r.david.murray

___
Python tracker 

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



[issue20289] Make cgi.FieldStorage a context manager

2014-01-20 Thread Berker Peksag

Berker Peksag added the comment:

Here's a patch with a test and documentation update.

--
nosy: +berker.peksag
stage: test needed -> patch review

___
Python tracker 

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



[issue20289] Make cgi.FieldStorage a context manager

2014-01-20 Thread Berker Peksag

Changes by Berker Peksag :


--
keywords: +patch
Added file: http://bugs.python.org/file33572/issue20289.diff

___
Python tracker 

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



[issue20246] buffer overflow in socket.recvfrom_into

2014-01-20 Thread Ryan Smith-Roberts

Ryan Smith-Roberts added the comment:

The send part of the test doesn't matter, since what's being tested happens 
before any reads. The MSG multiplier should be removed completely, since none 
of the other tests do that.

Patch attached.

--
Added file: 
http://bugs.python.org/file33573/recvfrom_into_small_buffer_test.patch

___
Python tracker 

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



[issue20284] patch to implement %-interpolation for bytes (roughly PEP 461)

2014-01-20 Thread Neil Schemenauer

Changes by Neil Schemenauer :


Removed file: http://bugs.python.org/file33501/bytes_mod.patch

___
Python tracker 

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



[issue20284] patch to implement %-interpolation for bytes (roughly PEP 461)

2014-01-20 Thread Neil Schemenauer

Changes by Neil Schemenauer :


Removed file: http://bugs.python.org/file33505/bytes_mod_v2.patch

___
Python tracker 

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



[issue20284] patch to implement %-interpolation for bytes (roughly PEP 461)

2014-01-20 Thread Neil Schemenauer

Changes by Neil Schemenauer :


Removed file: http://bugs.python.org/file33506/bytes_mod_v3.patch

___
Python tracker 

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



[issue20284] patch to implement %-interpolation for bytes (roughly PEP 461)

2014-01-20 Thread Neil Schemenauer

Changes by Neil Schemenauer :


Removed file: http://bugs.python.org/file33516/bytes_mod_v4.patch

___
Python tracker 

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



[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2014-01-20 Thread Neil Schemenauer

Neil Schemenauer added the comment:

I've updated my patch into a sequence, the first of which implements PEP 461.

02-code-a.patch adds support for %a (ascii() on arg)

03-py2-flag.patch makes %s and %r behave similar to Python 2 if a command
line flag is provided to the interpreter

04-py-eq.patch makes the command line flag also enable comparision between 
bytes() and str() (warning is generated).

--
title: patch to implement %-interpolation for bytes (roughly PEP 461) -> patch 
to implement PEP 461 (%-interpolation for bytes)
Added file: http://bugs.python.org/file33574/01-pep461.patch

___
Python tracker 

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



[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2014-01-20 Thread Neil Schemenauer

Changes by Neil Schemenauer :


Added file: http://bugs.python.org/file33575/02-code-a.patch

___
Python tracker 

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



[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2014-01-20 Thread Neil Schemenauer

Changes by Neil Schemenauer :


Added file: http://bugs.python.org/file33576/03-py2-flag.patch

___
Python tracker 

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



[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2014-01-20 Thread Neil Schemenauer

Changes by Neil Schemenauer :


Added file: http://bugs.python.org/file33577/04-py2-eq.patch

___
Python tracker 

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



[issue20318] subprocess.Popen can hang in threaded applications

2014-01-20 Thread Gregory P. Smith

Gregory P. Smith added the comment:

2.7 subprocess is fundamentally flawed and cannot be fixed. Install 
subprocess32 from PyPI. It's fixed in 3.2 and later.

--
nosy: +gregory.p.smith
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2014-01-20 Thread Stefan Krah

Stefan Krah added the comment:

Shiz  wrote:
> As far as maintaining an Android port for CPython goes; I may be interested
> in this as I'd need to regularly use it anyway. Can anyone tell me what the
> possibilities are here?

There seem to be some external ports already. -- On the other hand, if we
integrate your patches, we'd sort of make Android officially supported.

The problems with this are:

   a) In the past proponents of non-mainstream platforms have not been
  very active after an initial enthusiasm.

   b) There were no build slaves (See http://www.python.org/dev/buildbot/)
  for these platforms.

   c) Many (or all) core committers did not have access to the platform
  in question.

Wikipedia claims that "QEMU also powers the Android emulator which is part of
the Android SDK."  Can you run a build slave with network access and also run
the test suite in this emulator?

Running a build slave is rather easy, see:

https://wiki.python.org/moin/BuildBot
http://bugs.python.org/file24399/buildslave_install.txt

--

___
Python tracker 

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



[issue20318] subprocess.Popen can hang in threaded applications

2014-01-20 Thread Andrew Lutomirski

Andrew Lutomirski added the comment:

Would it be worth adding something to the Python 2.7 subprocess docs indicating 
that subprocess is known to be broken?

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

___
Python tracker 

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



[issue20318] subprocess.Popen can hang in threaded applications

2014-01-20 Thread Andrew Lutomirski

Andrew Lutomirski added the comment:

FWIW, sticking a mutex in Popen.__init__ (wrapping the whole thing) seems to 
work around this issue (for programs that aren't using multiprocessing or fork, 
for example).  This might be a good-enough fix and be safe enough to stick in 
the standard library.

--
status: open -> closed

___
Python tracker 

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



[issue20197] Support WebP image format detection in imghdr module

2014-01-20 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
versions: +Python 3.5 -Python 2.7, Python 3.4

___
Python tracker 

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



[issue20275] asyncio: remove debug code from BaseEventLoop

2014-01-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8bb2c3ae9402 by Victor Stinner in branch 'default':
Close #20275: Optimize BaseEventLoop._run_once()
http://hg.python.org/cpython/rev/8bb2c3ae9402

--
nosy: +python-dev
resolution:  -> fixed
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



[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2014-01-20 Thread Tal Einat

Tal Einat added the comment:

Attaching patch for complete conversion of Objects/unicodeobject.c.

Notes:
* maketrans() was already converted
* converting the lstrip, rstrip and strip methods required a small, non-trivial 
change to the code, since they used a common function for argument parsing
* the documentation for replace() now correctly reflects the actual function 
signature
* I rephrased some doc-strings where it was required, and in several places 
moved some of the text into parameter descriptions

--
Added file: http://bugs.python.org/file33578/unicodeobject.c.patch

___
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-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> A new parameter should be added to _PyTime_ObjectToTimeval() and
> _PyTime_ObjectToTimespec() to choose the rounding method.

That doesn't sound necessary. Just fix the select and selectors module so that 
the final (OS-level) timeout is always > 0 when the user timeout is > 0.

--

___
Python tracker 

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



[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2014-01-20 Thread Tal Einat

Tal Einat added the comment:

Attached patch for AC conversion of Objects/stringlib/transmogrify.h.

Converting the functions in this file required changes to Objects/bytesobject.c 
and Objects/bytearrayobject.c. Those changes are in the patch as well. The 
conversion of those files is part of issue20179 (Derby #10). I'm adding a 
comment on that issue as well with a reference to this.

--
Added file: http://bugs.python.org/file33579/transmogrify.h.patch

___
Python tracker 

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



[issue20179] Derby #10: Convert 50 sites to Argument Clinic across 4 files

2014-01-20 Thread Tal Einat

Tal Einat added the comment:

While converting Objects/stringlib/transmogrify.h as part of issue20180 (Derby 
#11), some changes to Objects/bytesobject.c and Objects/bytearrayobject.c were 
required. Those changes are included in the relevant patch attached to that 
issue.

--
nosy: +taleinat

___
Python tracker 

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



[issue20267] TemporaryDirectory does not resolve path when created using a relative path

2014-01-20 Thread Yury Selivanov

Yury Selivanov added the comment:

The patch is ok for windows.

--

___
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-20 Thread Glenn Langford

New submission from Glenn Langford:

concurrent.futures.wait() can get into a state where it blocks forever on 
waiter.event.wait(), even when the underlying Futures have completed.

This is demonstrated in a stress test where a large number of wait() calls are 
run in multiple threads, contending for the same Futures.

The cause is believed to be waiter removal, which is done without locking the 
Future. 

A suggested fix which appears to work is to change the following code in wait():

for f in fs:
f._waiters.remove(waiter)

to:

for f in fs:
with f._condition:
f._waiters.remove(waiter)

--
components: Library (Lib)
files: stress_wait.py
messages: 208592
nosy: glangford
priority: normal
severity: normal
status: open
title: concurrent.futures.wait() can block forever even if Futures have 
completed
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file33580/stress_wait.py

___
Python tracker 

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



[issue20297] concurrent.futures.as_completed() installs waiters for already completed Futures

2014-01-20 Thread Glenn Langford

Glenn Langford added the comment:

See also http://bugs.python.org/issue20319

--

___
Python tracker 

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



[issue20320] select.select(timeout) and select.kqueue.control(timeout) must round the timeout to the upper bound

2014-01-20 Thread STINNER Victor

New submission from STINNER Victor:

Rounding issue causes performance bug in asyncio, see issue #20311 for the 
rationale. This issue address bugs for select and kqueue because their 
implementation is different.

OS multiplexer:

- select: microsecond resolution (10^-6), timeout converted by 
_PyTime_ObjectToTimeval() which converts 1e-7 to zero => BUG!
- kqueue: nanosecond resolution (10^-9), timeout converted by 
_PyTime_ObjectToTimespec() which converts 1e-10 to zero => BUG!

_PyTime_ObjectToTimeval() is used in various places:

- datetime.datetime.fromtimestamp(), datetime.datetime.utcfromtimestamp()
- select.select(), 

_PyTime_ObjectToTimespec() is used in various places:

- posix.utime()
- signal.sigtimedwait()
- select.kqueue.control()
- time.clock_settime()

Attached patch adds a new round parameter to _PyTime_ObjectToTimeval() and 
_PyTime_ObjectToTimespec() to choose the rounding method:

* _PyTime_ROUND_DOWN: Round towards zero. (current implementation)
* _PyTime_ROUND_UP: Round away from zero. (new rounding method)

The patch changes the rounding method for select, kqueue but also for 
sigtimedwait().

--
files: time_rouding.patch
keywords: patch
messages: 208594
nosy: belopolsky, haypo, neologix, pitrou, serhiy.storchaka, skrah
priority: normal
severity: normal
status: open
title: select.select(timeout) and select.kqueue.control(timeout) must round the 
timeout to the upper bound
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file33581/time_rouding.patch

___
Python tracker 

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



[issue20309] Not all method descriptors are callable

2014-01-20 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



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

2014-01-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 033137c12d88 by Victor Stinner in branch '3.3':
Issue #20311: select.epoll.poll() now rounds the timeout away from zero,
http://hg.python.org/cpython/rev/033137c12d88

New changeset 02f9db3e684e by Victor Stinner in branch 'default':
(Merge 3.3) Issue #20311: select.epoll.poll() now rounds the timeout away from
http://hg.python.org/cpython/rev/02f9db3e684e

--
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-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e042ea77a152 by Victor Stinner in branch 'default':
Issue #20311: selector.PollSelector.select() now rounds the timeout away from
http://hg.python.org/cpython/rev/e042ea77a152

--

___
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-20 Thread STINNER Victor

STINNER Victor added the comment:

Rounding issues with poll() and epoll() have been fixed in Python 3.3 and 3.4. 
I'm now waiting for buildbots before closing the issue.

I created a new issue #20320 to address the rounding issue with select() and 
kqueue (and signal.sigtimedwait).

--

___
Python tracker 

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



[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2014-01-20 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue20310] Recommend using pprint for deterministic doctest

2014-01-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

That's a rather bad idea. pprint output isn't supposed to be identical accross 
versions; actually, it has recently changed in some cases.

--
nosy: +pitrou

___
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-20 Thread STINNER Victor

STINNER Victor added the comment:

The epoll test failed on a buildbot. The test uses a short delay (10 
milliseconds) and compare two different clocks: time.perf_counter() and 
select.epoll.poll(). I didn't expect a failure very the greatest delay, the 
test uses even shorter delay (the shortest is 0.1 ms).

The best would be to trace syscalls to check if epoll_wait() is called with a 
non-zero timeout, but tracing syscalls is overkill and too low level for such 
test.

It's maybe better to drop this unstable test? Unstable on our slow buildbots.

http://buildbot.python.org/all/builders/x86%20Gentoo%20Non-Debug%203.3/builds/1392/steps/test/logs/stdio

==
FAIL: test_timeout_rounding (test.test_epoll.TestEPoll)
--
Traceback (most recent call last):
  File 
"/var/lib/buildslave/3.3.murray-gentoo-wide/build/Lib/test/test_epoll.py", line 
58, in test_timeout_rounding
self.assertGreaterEqual(dt, timeout)
AssertionError: 0.008995789801701903 not greater than or equal to 0.01

--

___
Python tracker 

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



[issue9521] xml.etree.ElementTree skips processing instructions when parsing

2014-01-20 Thread Nikolaus Rath

Nikolaus Rath added the comment:

For the record: I disagree that this is an enhancement. ElementTree supports 
PIs as first-class tree elements. They can be added, inspected, removed, and 
written out when serializing into XML. Only when reading in XML, they are 
silently dropped. I think this is a bug, no matter how rarely people might 
stumble upon it in practice.

If there was no support for PIs at all (i.e., they couldn't be created as tree 
objects) I'd agree with you that this is an enhancement.


Unless there are objections, I'll try to work on a patch that either documents 
that PIs are lost, or optionally adds them to the tree when parsing (depending 
on how difficult that turns out to be).

--

___
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-20 Thread STINNER Victor

STINNER Victor added the comment:

Another failure:

http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.3/builds/1360/steps/test/logs/stdio

==
FAIL: test_timeout_rounding (test.test_epoll.TestEPoll)
--
Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.3.bolen-ubuntu/build/Lib/test/test_epoll.py", 
line 58, in test_timeout_rounding
self.assertGreaterEqual(dt, timeout)
AssertionError: 0.009388947859406471 not greater than or equal to 0.01

--

___
Python tracker 

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



  1   2   >