[issue16863] Python 2 error in Argparse tutorial

2013-01-05 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe added the comment:

 A quick patch would be 'This tutorial was written for argparse in Python 3. A 
 few details are different in 2.x.' But feel free to do better.

That really sounds great, especially since it avoids resorting to
things as ugly as ...and this is Python 2 output.

--

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



[issue16870] re fails to match ^ when start index is specified ?

2013-01-05 Thread Poul-Henning Kamp

New submission from Poul-Henning Kamp:

I'm surprised that this does not find any matches:

import re
r = re.compile(^abc)
s = 0123abcxyz
for i in range(0,len(s)):
print(i, r.search(s, i))

I would have expected the i==4 case to match ?

(This is on:
Python 2.7.3 (default, Dec 14 2012, 02:46:02) 
[GCC 4.2.1 Compatible FreeBSD Clang 3.2 (branches/release_32 168974)] on 
freebsd10
)

--
components: Regular Expressions
messages: 179116
nosy: bsdphk, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: re fails to match ^ when start index is specified ?
versions: Python 2.7

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



[issue16870] re fails to match ^ when start index is specified ?

2013-01-05 Thread Ned Deily

Ned Deily added the comment:

Note the warning about '^' in the documentation for the re search method:

The optional second parameter pos gives an index in the string where the 
search is to start; it defaults to 0. This is not completely equivalent to 
slicing the string; the '^' pattern character matches at the real beginning of 
the string and at positions just after a newline, but not necessarily at the 
index where the search is to start.

http://docs.python.org/2/library/re.html#re.RegexObject.search

--
nosy: +ned.deily
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue16870] re fails to match ^ when start index is specified ?

2013-01-05 Thread Ned Deily

Ned Deily added the comment:

To expand a bit, rather than multiple calls to search, you can use the start 
and end methods of the match object to determine where the string (without the 
'^' anchor) matches.  For example:

r = re.compile(abc)
s = 0123abcxyz
match = r.search(s)
if match:
print(match.start(), match.end())

--

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



[issue1694663] Overloading int.__pow__ does not work

2013-01-05 Thread Mark Dickinson

Mark Dickinson added the comment:

Yep, this was fixed as part of the issue 14658 fix.

--

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



[issue16853] add a Selector to the select module

2013-01-05 Thread Charles-François Natali

Charles-François Natali added the comment:

Here's a new version, with the following changes:
- there's no SELECT_ERR anymore: error conditions (POLLNVAL|POLLERR and also 
POLLHUP) are reported as SELECT_IN|SELECT_OUT, depending on the input event 
mask: I don't think that a separate error flag is needed, because the error 
will be reported when the FD will be read/written (and in the context where the 
error can be handled appropriately, which wouldn't be the case if an exception 
was thrown by the Selector). That's what Java and libevent do, for example. 
libevent reports IN|OUT inconditionally in case of POLLER|POLLHUP, but I think 
that the output events should be a subset ot input events.
- the exceptions set isn't passed to select() anymore: exception events (like 
OOB) are already reported in the read or write sets (checked with libevent and 
in the Linux kernel source)
- most importantly, there was something missing/annoying in the API: now, it 
only accepts only file descriptors, and also an optional opaque object: the 
object - called attached data - can be used for example to pass a callback 
(that can be invoked by a higher-level reactor), or for example 
context-specific data: it could be a kind of a thread state to make it easy to 
do a context-switch, or simply a high-level object like a file, a socket or a 
telnet instance. This is actually what Java does, but they take it further into 
encapsulating the FD, interested events, attached data and ready events into a 
SelectionKey, which is passed and returned to/from the Selector: 
http://docs.oracle.com/javase/7/docs/api/java/nio/channels/SelectionKey.html
- I've added some tests

--
Added file: http://bugs.python.org/file28575/selector-data.diff

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



[issue16762] test_subprocess failure on OpenBSD/NetBSD buildbots

2013-01-05 Thread Trent Nelson

Changes by Trent Nelson tr...@snakebite.org:


--
nosy: +trent

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



[issue16870] re fails to match ^ when start index is specified ?

2013-01-05 Thread Poul-Henning Kamp

Poul-Henning Kamp added the comment:

I have tried hard, but have utterly failed to figure out why you have chosen 
the semantics for ^ you mention, tried to come up with a plausible use case, 
and I have utterly failed.

I find it distinctly counter intuitive.

I think the Principle of Least Astonishment compliant definition of ^ and $ 
would be that they match the start and end of the string offered for matching, 
ie: taking start+end into account.

The real use-case behind this is searching through a mmap'ed database file, for 
a particular regexp in a particular field of the records, with the minimum 
amount of copying.

The semantics you mention, makes ^ and $ useless in this, and as far as I can 
tell, any other scenario involving start+end arguments.

--

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



[issue16853] add a Selector to the select module

2013-01-05 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

@Guido: agreed.

 there's no SELECT_ERR anymore [...] the error will be reported when the FD 
 will be read/written

I don't think this is a good idea, particularly during this early stage.
This assumption might be valid for select() but not for poll() and epoll() 
where (POLLERR | POLLHUP | POLLNVAL) is an alias for connection lost, and 
that's an event which both Twisted and Tornado take into account and treat 
differently than a pure read event.
The same assumption should also apply for kqueue().

 the exceptions set isn't passed to select() anymore: exception events (like 
 OOB) are already reported in the read or write sets

That's true only if SO_OOBINLINE has been pre-emptively set against the socket.
It might be ok to ignore select()'s exceptional events anyway though.
This is probably another thing you might want to decide later.

 there was something missing/annoying in the API [...]  now, it only accepts 
 only file descriptors, and also an optional opaque 'data' object

I like this change as it avoids maintaining a separate fd-handler map.

Will add line-by-line comments by using the review tool.

--

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



[issue16849] Element.{get, iter} doesn't handle keyword arguments when using _elementtree C accelerator.

2013-01-05 Thread Eli Bendersky

Eli Bendersky added the comment:

The patch was committed with some minor modifications to 3.3 (c1fc6b6d1cfc) and 
default branch (e1bee8b09828).

New tests were added to the test classes (please don't add new tests to the 
doctests, they are deprecated).

--

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



[issue15075] XincludeTest failure in test_xml_etree

2013-01-05 Thread Eli Bendersky

Eli Bendersky added the comment:

I investigated a bit, and type checks were added to protect from such mixing. 
Please open a new patch with a speficic reproducer if you run into similar 
problems (interepreter crash).

--

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



[issue16849] Element.{get, iter} doesn't handle keyword arguments when using _elementtree C accelerator.

2013-01-05 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


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

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



[issue16817] test___all__ affects other tests by doing too much importing

2013-01-05 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
dependencies: +sys.path in tests contains system directories

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



[issue1674555] sys.path in tests contains system directories

2013-01-05 Thread Eli Bendersky

Eli Bendersky added the comment:

Issue #16817 discusses a similar problem arising with test___all__. The patches 
have to be updated to provide a generic way to delegate certain tests to 
separate subprocesses.

Arfrever, it's not necessary to update all the patches at once. Start with the 
one for 3.2 and after we figure out it's acceptable, it should be easy to 
convert to the other branches.

--
versions: +Python 3.4 -Python 3.1

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



[issue16853] add a Selector to the select module

2013-01-05 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Inline comments:
http://bugs.python.org/review/16853/

--

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



[issue16853] add a Selector to the select module

2013-01-05 Thread Charles-François Natali

Charles-François Natali added the comment:

 there's no SELECT_ERR anymore [...] the error will be reported when the FD 
 will be read/written

 I don't think this is a good idea, particularly during this early stage.
 This assumption might be valid for select() but not for poll() and epoll() 
 where (POLLERR | POLLHUP | POLLNVAL) is an alias for connection lost, and 
 that's an event which both Twisted and Tornado take into account and treat 
 differently than a pure read event.

POLLERR and POLLNVAL semantics can be really different from
connection lost, so this mapping sounds wrong. The actual error
(which may be ECONNRESET, but also EBADF, ENOBUFS...) will be raised
upon the next call to read()/write(), or can be retrieved through
getsockopt(SO_ERROR).

Also, that's exactly what the Linux kernel does for select():
http://lxr.free-electrons.com/source/fs/select.c#L381
POLLHUP is mapped to the read-set, POLLERR both to the read and write set.

This means that connection lost could never be returned on platforms
where the select() syscall is used, which could lead to subtle
portability problems.

But I'm definitely open on this (I've based the behavior on libevent
and Java, FWIW).

 the exceptions set isn't passed to select() anymore: exception events (like 
 OOB) are already reported in the read or write sets

 That's true only if SO_OOBINLINE has been pre-emptively set against the 
 socket.
 It might be ok to ignore select()'s exceptional events anyway though.

Thanks, I didn't know: since the POSIX man pages was rather evasive on
this, I checked the Linux kernel source code, but apparently it's
non-standard. If we do ignore OOB in select(), then we probably also
want to suppress POLLPRI|EPOLLPRI, no?

--

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



[issue16871] Cleanup a few minor things

2013-01-05 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Here is a set of patches which clean a few minor things: add spaces after 
if/while/return/etc, remove spaces after class/function name, remove redundant 
parens after if/while/return/etc. One set contains only space changes, another 
set contains parens changes.

--
components: Library (Lib), Tests
messages: 179128
nosy: ezio.melotti, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Cleanup a few minor things
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

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



[issue16871] Cleanup a few minor things

2013-01-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file28576/minor_things_parens-2.7.diff
Added file: http://bugs.python.org/file28577/minor_things_parens-3.2.diff
Added file: http://bugs.python.org/file28578/minor_things_parens-3.3.diff
Added file: http://bugs.python.org/file28579/minor_things_parens-3.4.diff
Added file: http://bugs.python.org/file28580/minor_things_spaces-3.2.diff
Added file: http://bugs.python.org/file28581/minor_things_spaces-2.7.diff
Added file: http://bugs.python.org/file28582/minor_things_spaces-3.3.diff
Added file: http://bugs.python.org/file28583/minor_things_spaces-3.4.diff

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



[issue16853] add a Selector to the select module

2013-01-05 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

 The actual error (which may be ECONNRESET, but also EBADF, ENOBUFS...) will 
 be raised
 upon the next call to read()/write(), or can be retrieved through
getsockopt(SO_ERROR).

Mmmm... I would be tempted to think the same but the fact that both Tornado and 
Twisted distinguish between READ and ERROR events is suspicious.

 then we probably also want to suppress POLLPRI|EPOLLPRI, no?

Yes.

--

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



Re: [issue16871] Cleanup a few minor things

2013-01-05 Thread Senthil Kumaran
Looks good in most of the places, but at some places the parenthesis are of
course helpful for cohesiveness, and this can be quite subjective. With
these patches, are you in general removing all instances of parenthesis
when it is not required or also considering for places where parens may
help while reading the code?

+1 for the space changes patches.


On Sat, Jan 5, 2013 at 8:14 AM, Serhiy Storchaka rep...@bugs.python.orgwrote:


 Changes by Serhiy Storchaka storch...@gmail.com:


 --
 keywords: +patch
 Added file: http://bugs.python.org/file28576/minor_things_parens-2.7.diff
 Added file: http://bugs.python.org/file28577/minor_things_parens-3.2.diff
 Added file: http://bugs.python.org/file28578/minor_things_parens-3.3.diff
 Added file: http://bugs.python.org/file28579/minor_things_parens-3.4.diff
 Added file: http://bugs.python.org/file28580/minor_things_spaces-3.2.diff
 Added file: http://bugs.python.org/file28581/minor_things_spaces-2.7.diff
 Added file: http://bugs.python.org/file28582/minor_things_spaces-3.3.diff
 Added file: http://bugs.python.org/file28583/minor_things_spaces-3.4.diff

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue16871
 ___
 ___
 Python-bugs-list mailing list
 Unsubscribe:
 http://mail.python.org/mailman/options/python-bugs-list/senthil%40uthcode.com


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



[issue16855] traceback module leaves off module name in last line of formatted tracebacks

2013-01-05 Thread Walter Mundt

Walter Mundt added the comment:

Thanks for looking into the version applicability.  I'd bet that under the 
covers IDLE is relying on the traceback module too.  Anyone have a Windows 
CPython 2.7.3 and care to check the output of the test code in a cmd window?  I 
originally ran it unindented out of a file if that helps.

I will remember your comments on code indenting and use of cross-version print 
idioms in test code for future reference.  Others wanting to paste it into a 
file or interpreter can add an if True: prefix as a workaround for this bug.

--

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



[issue16870] re fails to match ^ when start index is specified ?

2013-01-05 Thread Matthew Barnett

Matthew Barnett added the comment:

The semantics of '^' are common to many different regex implementations, 
including those of Perl and C#.

The 'pos' argument merely gives the starting position the search (C# also lets 
you provide a starting position, and behaves in exactly the same way).

Perhaps you should be using 'match' instead.

--

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



[issue16871] Cleanup a few minor things

2013-01-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For me none of these parens help while reading the code (but this is quite 
subjective). I not object if only a part of these changes will be applied. 
Review the patches and point what changes should be applied and what changes 
should not.

--

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



[issue16869] makesetup should support .S source files

2013-01-05 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Should not this be?

*.S) obj=`basename $src .S`.o; cc='$(CC)';; #

The filetype extension .S instead .cpp.

And, I have less know-how on these, but for my understanding how would
non-preprocessed asm files (.s) will be handled? And doc reference to
how this change is help as well (unless some other core dev knowing
BUILD takes up).

On Fri, Jan 4, 2013 at 9:56 PM, Benno Leslie rep...@bugs.python.org wrote:


 New submission from Benno Leslie:

 It is useful to be able to build .S files as built-in modules (in
 particular if you want ctypes as a built-in you need .S files)

 The patch enables .S files to be specified in Setup.dist files.

 --
 components: Build
 files: makesetup-asm.diff
 keywords: patch
 messages: 179111
 nosy: bennoleslie
 priority: normal
 severity: normal
 status: open
 title: makesetup should support .S source files
 versions: Python 3.4
 Added file: http://bugs.python.org/file28574/makesetup-asm.diff

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue16869
 ___
 ___
 New-bugs-announce mailing list
 new-bugs-annou...@python.org
 http://mail.python.org/mailman/listinfo/new-bugs-announce


--
nosy: +orsenthil

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



[issue16853] add a Selector to the select module

2013-01-05 Thread Guido van Rossum

Guido van Rossum added the comment:

I think that this needs extensive tests that verify the behavior of many end 
cases, including under duress (e.g. when there are too many connections for the 
kernel to handle).  That would seem the only way to make sure that the code is 
reliable across platforms.  It is likely that you could borrow some ideas for 
test scenarios from Twisted.

--

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



[issue13103] copy of an asyncore dispatcher causes infinite recursion

2013-01-05 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Same problem in 3.4.

$ ./python
Python 3.4.0a0 (default:e1bee8b09828, Jan  5 2013, 20:29:00)
[GCC 4.3.2] on linux
Type help, copyright, credits or license for more information.
 import asyncore
 a = asyncore.dispatcher()
 del a.socket
 a.foo
Traceback (most recent call last):
  File stdin, line 1, in module
  File ./Lib/asyncore.py, line 410, in __getattr__
retattr = getattr(self.socket, attr)
  ...
  File ./Lib/asyncore.py, line 410, in __getattr__
retattr = getattr(self.socket, attr)
RuntimeError: maximum recursion depth exceeded while calling a Python object


--

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



[issue13103] copy of an asyncore dispatcher causes infinite recursion

2013-01-05 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

asyncore's __getattr__ horror was scheduled for removal a long ago (3.1 as per 
issue8483).
We can safely remove it for 3.4 and fix the RuntimeError exception above for 
all the earlier Python versions which are affected.

--

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



[issue13103] copy of an asyncore dispatcher causes infinite recursion

2013-01-05 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
assignee:  - giampaolo.rodola

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



[issue16871] Cleanup a few minor things

2013-01-05 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

How about innecessary code churn?

--
nosy: +jcea

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



[issue16871] Cleanup a few minor things

2013-01-05 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

I elaborate: issue15580. An example of many.

--

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



[issue16872] Metaclass conflict proposition

2013-01-05 Thread João Bernardo

New submission from João Bernardo:

This is actually a proposition for a behavior change caused by a bugfix.

I have a project dealing with a metaclass factory and the next thing in the 
TODO list was to add multiple inheritance support.
For my surprise, I tried and there was no metaclass conflict on Python 2.7... 
I've been developing on Py3.2 and now on Py3.3 an it couldn't obviously choose 
one of the metaclass to use.

I found this(http://hg.python.org/cpython/rev/c2a89b509be4) commit saying the 
metaclass calculation was fixed on some special cases (I think it is because of 
the __new__ method on the metaclass). Py3.1 and inferior are not affected.



The thing is: My metaclasses are smart enough to produce the right behavior so 
the bug doesn't bother me as long as this bugfix never gets backported.

For Python 3.2+, the solution requires some more code/knowledge for the user:

If I have this class diagram for Obj, A and B:


  Obj[type=M]M
  /\ - / \
A[type=MA]  B[type=MB] MA MB


then, I want to create C:

class C(A, B, metaclass=something):
pass

Where something cannot be neither MA, MB or M because of metaclass 
conflict.

but if 

something = lambda *args: M(*args)

I can call finally call my smart metaclass to solve the problem.



Now the proposition:

It is possible for the metaclass to have some special attribute (e.g. 
__call_me_maybe__ = True) so Python knows it can deal with these special cases 
and avoid the user to explicitly use the `metaclass` parameter?

So
class C(A, B):
pass

Would call MA because of the special attribute inherited from M and it 
would know how to deal with the B class. 
If it can't do it with some X class, just return NotImplemented or other thing 
so the `TypeError: metaclass conflict...` will finally be shown.

--
components: Interpreter Core
messages: 179140
nosy: JBernardo
priority: normal
severity: normal
status: open
title: Metaclass conflict proposition
type: behavior
versions: Python 3.4

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



[issue8109] Server-side support for TLS Server Name Indication extension

2013-01-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 927afb7bca2a by Antoine Pitrou in branch 'default':
Issue #8109: The ssl module now has support for server-side SNI, thanks to a 
:meth:`SSLContext.set_servername_callback` method.
http://hg.python.org/cpython/rev/927afb7bca2a

--
nosy: +python-dev

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



[issue16853] add a Selector to the select module

2013-01-05 Thread Charles-François Natali

Charles-François Natali added the comment:

 I think that this needs extensive tests that verify the behavior of many end 
 cases, including under duress (e.g. when there are too many connections for 
 the kernel to handle).  That would seem the only way to make sure that the 
 code is reliable across platforms.  It is likely that you could borrow some 
 ideas for test scenarios from Twisted.

Will do.

I'm adding a new version taking into account some of Giampaolo's remarks.

Also, the API now also allows passing a file descriptor or any object
with a `fileno()` method, since it will likely be useful.

To sum up, the API is:

def register(self, fileobj, events, data=None):
Register a file object.

Parameters:
fileobj -- file object
events  -- events to monitor (bitwise mask of SELECT_IN|SELECT_OUT)
data-- attached data


def unregister(self, fileobj):
Unregister a file object.

Parameters:
fileobj -- file object


def modify(self, fileobj, events, data=None):
Change a registered file object monitored events or attached data.

Parameters:
fileobj -- file object
events  -- events to monitor (bitwise mask of SELECT_IN|SELECT_OUT)
data-- attached data


def select(self, timeout=None):
Perform the actual selection, until some monitored file objects are
ready or a timeout expires.

Parameters:
timeout -- if timeout  0, this specifies the maximum wait time, in
   seconds
   if timeout == 0, the select() call won't block, and will
   report the currently ready file objects
   if timeout is None, select() will block until a monitored
   file object becomes ready

Returns:
list of (fileobj, events, attached data) for ready file objects
`events` is a bitwise mask of SELECT_IN|SELECT_OUT

Selector.select() output looks a lot like poll()/epoll() except for
two details: the output is the file object, and not the file
descriptor (poll()/epoll() are unfortunately inconsistent in this
regard), and there's a third field, the attached data (will be None if
not provided in register()/modify()). I think that this optional field
is really useful to pass e.g. a callback or some context information.

--
Added file: http://bugs.python.org/file28584/selector-5.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16853
___diff --git a/Lib/select.py b/Lib/select.py
new file mode 100644
--- /dev/null
+++ b/Lib/select.py
@@ -0,0 +1,286 @@
+Select module.
+
+This module supports asynchronous I/O on multiple file descriptors.
+
+
+
+from _select import *
+
+
+# generic events, that must be mapped to implementation-specific ones
+# read event
+SELECT_IN  = (1  0)
+# write event
+SELECT_OUT = (1  1)
+
+
+def _fileobj_to_fd(fileobj):
+Return a file descriptor from a file object.
+
+Parameters:
+fileobj -- file descriptor, or any object with a `fileno()` method
+
+Returns:
+corresponding file descriptor
+
+if isinstance(fileobj, int):
+fd = fileobj
+else:
+try:
+fd = int(fileobj.fileno())
+except (ValueError, TypeError):
+raise ValueError(Invalid file object: {!r}.format(fileobj))
+return fd
+
+
+class _Key:
+Object used internally to associate a file object to its backing file
+descriptor and attached data.
+
+def __init__(self, fileobj, data=None):
+self.fileobj = fileobj
+self.data = data
+self.fd = _fileobj_to_fd(fileobj)
+
+
+class _BaseSelector:
+Base selector class.
+
+A selector supports registering file objects to be monitored for specific
+I/O events.
+
+A file object is a file descriptor or any object with a `fileno()` method.
+An arbitrary object can be attached to the file object, which can be used
+for example to store context information, a callback, etc.
+
+A selector can use various implementations (select(), poll(), epoll()...)
+depending on the platform. The default `Selector` class uses the most
+performant implementation on the current platform.
+
+
+def __init__(self):
+# this maps file descriptors to keys
+self._fd_to_key = {}
+# this maps file objects to keys - for fast (un)registering
+self._fileobj_to_key = {}
+
+def register(self, fileobj, events, data=None):
+Register a file object.
+
+Parameters:
+fileobj -- file object
+events  -- events to monitor (bitwise mask of SELECT_IN|SELECT_OUT)
+data-- attached data
+
+if (not events) or (events  ~(SELECT_IN|SELECT_OUT)):
+raise ValueError(Invalid events: {}.format(events))
+
+if fileobj in 

[issue8109] Server-side support for TLS Server Name Indication extension

2013-01-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I've committed the latest patch. Thank you very much!

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

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



[issue16853] add a Selector to the select module

2013-01-05 Thread Meador Inge

Meador Inge added the comment:

The EpollSelector and PollSelector implementations are basically identical.  
You might want to refactor these to share more code.

--
nosy: +meador.inge

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



[issue8109] Server-side support for TLS Server Name Indication extension

2013-01-05 Thread danblack

danblack added the comment:

 I've committed the latest patch. Thank you very much!

much appreciate your help.

--

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



[issue16868] Python Developer Guide: Include a reminder to ping bug report if not reviewed in timely manner

2013-01-05 Thread Meador Inge

Meador Inge added the comment:

This seems like a reasonable addition to me.  Although, I don't like the 
substantial amount of time part (yes I know it was already there).  That 
should probably be replaced with something more concrete, e.g. one week.

--
nosy: +meador.inge

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



[issue9685] tuples should remember their hash value

2013-01-05 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
nosy: +meador.inge

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



[issue16868] Python Developer Guide: Include a reminder to ping bug report if not reviewed in timely manner

2013-01-05 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I would also take out the sentence about forgetting about the issue, because 
that's just one of several possible reasons and I don't think usually the main 
reason.

--
nosy: +chris.jerdonek

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



[issue16143] Building with configure option --without-doc-strings crashes first time through PyUnicode_DecodeUTF8Stateful

2013-01-05 Thread Franck Michea

Changes by Franck Michea franck.mic...@gmail.com:


--
nosy: +kushou

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



[issue16871] Cleanup a few minor things

2013-01-05 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Here is another recent comment from Georg on this topic:

And please don't commit cosmetic/cleanup changes to bugfix branches in the 
future.

(from http://bugs.python.org/issue16793#msg178372 )

--
nosy: +chris.jerdonek

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



[issue16855] traceback module leaves off module name in last line of formatted tracebacks

2013-01-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

console = cmd window. I did run it there and that is where I duplicated your 
2.7.3 result. I don't understand the different result with 2.7.3 IDLE, since it 
runs in a separate pythonw process that *should* give the same result as the 
python cmd window. But given that all in well in 3.3, I don't care to try to 
investigate. Who knows, maybe the fix you want would change both 2.7 IDLE 
results.

--

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



[issue16795] Patch: some changes to AST to make it more useful for static language analysis

2013-01-05 Thread Sven Brauch

Sven Brauch added the comment:

While writing tests, I noticed that the additional fields (lineno, col_offset 
for vararg, kwarg, and other arguments) currently are mandatory. Is that a 
problem?
It doesn't seem trivial to change that, since apparently only attributes (not 
fields) can be optional, but those are not allowed by the syntax of python.asdl 
at this point.
In case the fields need to be mandatory, what would be the correct approach to 
achieve that?

Thanks.

--

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



[issue16795] Patch: some changes to AST to make it more useful for static language analysis

2013-01-05 Thread Benjamin Peterson

Benjamin Peterson added the comment:

A question mark after the type name in the AST makes it optional.

--

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



[issue16872] Metaclass conflict proposition

2013-01-05 Thread Benjamin Peterson

Benjamin Peterson added the comment:

This is material for the python-ideas list.

--
nosy: +benjamin.peterson
resolution:  - rejected
status: open - closed

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



[issue16868] Python Developer Guide: Include a reminder to ping bug report if not reviewed in timely manner

2013-01-05 Thread Ezio Melotti

Ezio Melotti added the comment:

I agree with Chris.

+substantial amount of time first ping the issue on the `issue tracker`_

I would add a comma after 'time'.

 I don't like the substantial amount of time part (yes I know it
 was already there).  That should probably be replaced with something
 more concrete, e.g. one week.

That really depends on the situation.  I think the point of that sentence is to 
make clear that some time might pass before someone can look at the issue, and 
I'm not sure it's necessary to quantify this.

--

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



[issue16795] Patch: some changes to AST to make it more useful for static language analysis

2013-01-05 Thread Sven Brauch

Sven Brauch added the comment:

Thanks. I had seen and tried this before, but the ast module in python, which 
is used in the tests, still requires the additional arguments. Probably this is 
only valid for the C API?

--

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



[issue16866] libainstall doesn't create $(BINDIR) directory

2013-01-05 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks for the fix. The patches fixes it. Since this is a bug fix, it should be 
backported all the way till 2.7.

--
assignee:  - orsenthil
nosy: +orsenthil
stage:  - commit review
versions: +Python 2.7, Python 3.2, Python 3.3

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



[issue16853] add a Selector to the select module

2013-01-05 Thread Charles-François Natali

Charles-François Natali added the comment:

I've noticed a bug present in Tulip, pyftpdlib and tornado (and this
implementation, too): none of them passes the maxevents argument to
epoll.poll(), and by default the poll() wrapper in the socket module
uses FD_SETSIZE-1, so you'll never get more than FD_SETSIZE-1 events.

Note that the default value used by epoll() is probably too low (we
could maybe use an heuristic to use RLIMIT_NOFILE hard limit, with
capping because it can be quite large on FreeBSD or the Hurd ;-), or
at least the documentation doesn't warn users enough about this. The
signature reads:

.. method:: epoll.poll(timeout=-1, maxevents=-1)

   Wait for events. timeout in seconds (float)


Which confuses users into thinking that the number of returned events
is unlimited by default.

 The EpollSelector and PollSelector implementations are basically identical.  
 You might want to refactor these to share more code.

Yes, but I find the current code much easier to read: epoll() and
poll() have different constants, different units for timeout, epoll()
must accept a maxevents argument, have a close() method, etc.

--

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



[issue16873] increase epoll.poll() maxevents default value, and improve documentation

2013-01-05 Thread Charles-François Natali

New submission from Charles-François Natali:

In issue #16853, it was noted that many several projects don't set epoll.poll() 
maxevents argument, which effectively limits the number of events retuend to 
FD_SETSIZE-1 (set in selectmodule.c).

Also, the methode documentation can confuse users into thinking that by 
default, the number of events is unlimited:


.. method:: epoll.poll(timeout=-1, maxevents=-1)

   Wait for events. timeout in seconds (float)


It would probably make sense to use a larger default value for epoll max events 
(the only downside is increased memory consumption for the events array), maybe 
based on RLIMIT_NOFILE hard limit.
And the documentation should probably be improved.

--
components: Library (Lib)
messages: 179157
nosy: neologix
priority: normal
severity: normal
stage: needs patch
status: open
title: increase epoll.poll() maxevents default value, and improve documentation
type: enhancement
versions: Python 3.4

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



[issue8109] Server-side support for TLS Server Name Indication extension

2013-01-05 Thread Christian Heimes

Christian Heimes added the comment:

Coverity reports an issue in the callback function:

/Modules/_ssl.c: 2403 ( uninit_use)
   2400/* remove race condition in this the call back while if 
removing the
   2401 * callback is in progress */
   2402PyGILState_Release(gstate);
 CID 966640: Uninitialized scalar variable (UNINIT)
 Using uninitialized value ret.
   2403return ret;
   2404}
   2405
   2406ssl = SSL_get_app_data(s);
   2407assert(PySSLSocket_Check(ssl));

I don't know which error code should be returned in this case.

--
nosy: +christian.heimes
resolution: fixed - 
stage: committed/rejected - needs patch
status: closed - open

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



[issue16868] Python Developer Guide: Include a reminder to ping bug report if not reviewed in timely manner

2013-01-05 Thread Meador Inge

Meador Inge added the comment:

On Sat, Jan 5, 2013 at 5:55 PM, Ezio Melotti rep...@bugs.python.org wrote:

 That really depends on the situation.  I think the point of that sentence is 
 to make clear that some time might
 pass before someone can look at the issue, and I'm not sure it's necessary to 
 quantify this.

It currently says:


 If your patch has not received any notice from reviewers (i.e., no
comment made) after a substantial amount of time then you may email
python-...@python.org asking for someone to take a look at your patch.


That doesn't seem very useful to me because a newcomer is going to
wonder how much time is substantial.  If you quantify it, then they
don't really have to think about it as much which makes contributing
easier.

--

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



[issue16866] libainstall doesn't create $(BINDIR) directory

2013-01-05 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Digging a little deeper, make libainstall needs $(BINDIR) because of this

$(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config

*And* that python$(VERSION)-config file refers to the python exe which is 
available only after bininstall or it's dependees are called.

In affect, if make libainstall is for using lib/* contents this fix is okay, 
but leaves a resultant invalid bin/python-config
So, I am not sure the utility of make libainstall is without executing make 
bininstall - in which case, this is not a bug and probably a documentation 
change would be required.

I am adding Martin and Georg who have dabbled with BUILD previously for their 
views.

--
nosy: +georg.brandl, loewis

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



[issue16853] add a Selector to the select module

2013-01-05 Thread Guido van Rossum

Guido van Rossum added the comment:

I am trying to use this module in Tulip instead of its pollster implementation, 
and am running into a problem.  Tulip defines separate 
add_reader()/add_writer() methods, which call to the pollster's 
register_reader()/register_writer(), respectively.  The translation of this to 
the selector's API is somewhat complex; I would have to keep track of whether I 
already have a reader or writer registered, and then decide whether to call 
register() or modify().  If you don't want to change the API back to separate 
register_*() methods for readers and writers, perhaps you can add a method that 
tells me, for a given fileobj, whether it is registered, and with which poll 
flags (SELECT_IN/OUT/both) and the user data?

Also, I need a method that gives me the number of registered FDs.

--

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



[issue16874] setup.py upload option repeated in docs

2013-01-05 Thread Chris Jerdonek

New submission from Chris Jerdonek:

The following page:

http://docs.python.org/dev/distutils/uploading.html

says, Other upload options include --repository= or --repository= where url...

I haven't looked into what the correct wording is meant to be.

--
assignee: eric.araujo
components: Distutils, Documentation
keywords: easy
messages: 179162
nosy: chris.jerdonek, eric.araujo, tarek
priority: normal
severity: normal
stage: needs patch
status: open
title: setup.py upload option repeated in docs
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

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



[issue7434] general pprint rewrite

2013-01-05 Thread Danilo Bargen

Changes by Danilo Bargen gez...@gmail.com:


--
nosy: +gwrtheyrn

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



[issue16866] libainstall doesn't create $(BINDIR) directory

2013-01-05 Thread Benno Leslie

Benno Leslie added the comment:

I was using this in the case where I just want to link against libpython.a and 
for me it is a limited case where I don't really need the functionality of 
python-config; so for me this is certainly the best approach. But I concede 
this use case is probably a very little general interest.

If the goal is to have a working python-config, then I guess libainstall should 
depend on bininstall.

I'm not too fussed which approach is taken, I just think that (make  make 
libainstall) should work.

I'm happy to fashion a patch for whichever approach is thought to be best.

--

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



[issue16875] in 3.3.0 windows 64 idle editor

2013-01-05 Thread Glenn

New submission from Glenn:

when in the Idle editor this line command does not work:
 print Hello World!

does not work it says it is a syntax error but 

 x=Hello World!
 x
produces this
'Hello World!'

--
components: IDLE
messages: 179164
nosy: pargo
priority: normal
severity: normal
status: open
title: in 3.3.0 windows 64 idle editor
type: behavior
versions: Python 3.3

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



[issue16875] in 3.3.0 windows 64 idle editor

2013-01-05 Thread Ezio Melotti

Ezio Melotti added the comment:

That's because in Python 3 print is a function, so you need to do print(Hello 
World!) instead.
See the Python 3 tutorial: http://docs.python.org/3/tutorial/

--
nosy: +ezio.melotti
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue16875] in 3.3.0 windows 64 idle editor

2013-01-05 Thread Ned Deily

Ned Deily added the comment:

Also see http://docs.python.org/3/whatsnew/3.0.html#print-is-a-function

--
nosy: +ned.deily

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



[issue16876] epoll: reuse epoll_event buffer instead of allocating a new one at each poll()

2013-01-05 Thread Charles-François Natali

New submission from Charles-François Natali:

Currently, epoll.poll() allocates an epoll_event buffer every time/ this is 
bad, because it changes an O(number of ready FDs) syscall into a 
O(maxevents/FD_SETSIZE) complexity.
The patch attached allocates a epoll events buffer per epoll instance, and it 
only gets reallocated when necessary (note that the reallocation heuristic will 
probably be improved in #16873 (and having a per instance maxevents count will 
likely be useful).

Here's a benchmark without patch:
$ ./python -m timeit -s 'import select; ep = select.epoll(); ep.register(1, 
select.EPOLLOUT)' 'ep.poll()'
10 loops, best of 3: 4.25 usec per loop

With patch:
$ ./python -m timeit -s 'import select; ep = select.epoll(); ep.register(1, 
select.EPOLLOUT)' 'ep.poll()'
10 loops, best of 3: 3.38 usec per loop

--
components: Extension Modules
files: epoll_realloc.diff
keywords: needs review, patch
messages: 179167
nosy: neologix
priority: normal
severity: normal
stage: patch review
status: open
title: epoll: reuse epoll_event buffer instead of allocating a new one at each 
poll()
type: performance
versions: Python 3.4
Added file: http://bugs.python.org/file28585/epoll_realloc.diff

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



[issue16876] epoll: reuse epoll_event buffer instead of allocating a new one at each poll()

2013-01-05 Thread Charles-François Natali

Changes by Charles-François Natali neolo...@free.fr:


Removed file: http://bugs.python.org/file28585/epoll_realloc.diff

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



[issue16876] epoll: reuse epoll_event buffer instead of allocating a new one at each poll()

2013-01-05 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
nosy: +christian.heimes

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



[issue16876] epoll: reuse epoll_event buffer instead of allocating a new one at each poll()

2013-01-05 Thread Charles-François Natali

Changes by Charles-François Natali neolo...@free.fr:


Added file: http://bugs.python.org/file28586/epoll_realloc.diff

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



[issue16866] libainstall doesn't create $(BINDIR) directory

2013-01-05 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks Benno. I think that making libainstall depend on bininstall is
a right solution too. A nod from devs who have committed changes in
that area may help.  Also, I believe that this is a bug fix and should
be ported back upto 2.7. If there are any concerns it could be raised.

--

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



[issue16499] CLI option for isolated mode

2013-01-05 Thread Nick Coghlan

Nick Coghlan added the comment:

The system Python idea in PEP 432 is aimed at providing an alternate 
interpreter binary which changes the default behaviour to be appropriate for 
system utilities, while allowing such features to be enabled selectively.

--

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



[issue16877] Odd behavior of ~ in os.path.abspath and os.path.realpath

2013-01-05 Thread Ian Shields

New submission from Ian Shields:

Filespecs that start with ~ are not properly handled by os.path.realpath or 
os.path.abspath (and maybe other functions). Following console output from 
Fedora 17 using Puthon 3.2 illustrates the issue. Similar issue in 2.7
[ian@attic4 developerworks]$ cd ..
[ian@attic4 ~]$ mkdir testpath
[ian@attic4 ~]$ cd testpath
[ian@attic4 testpath]$ pwd
/home/ian/testpath
[ian@attic4 testpath]$ python3
Python 3.2.3 (default, Jun  8 2012, 05:36:09) 
[GCC 4.7.0 20120507 (Red Hat 4.7.0-5)] on linux2
Type help, copyright, credits or license for more information.
 import os
 os.path.abspath(~)
'/home/ian/testpath/~'
 os.path.realpath(~/xxx/zzz)
'/home/ian/testpath/~/xxx/zzz'
 os.path.abspath(~/..)
'/home/ian/testpath'

Function should probably use expanduser to determine if path is already 
absolute. Documentation at http://docs.python.org/3/library/os.path.html is 
also misleading as this is not how these functions work if given an absolute 
path to start with.

--
components: None
messages: 179170
nosy: ibshields
priority: normal
severity: normal
status: open
title: Odd behavior of ~ in os.path.abspath and os.path.realpath
type: behavior
versions: Python 3.2

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



[issue16877] Odd behavior of ~ in os.path.abspath and os.path.realpath

2013-01-05 Thread R. David Murray

R. David Murray added the comment:

This is intentional. You have to call expanduser yourself if you want ~ to be 
expanded.  Otherwise it is treated as any other path component would be.

I don't understand your final comment, can you clarify?

--
nosy: +r.david.murray
resolution:  - invalid
stage:  - committed/rejected
status: open - pending

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



[issue15204] Deprecate the 'U' open mode

2013-01-05 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
stage:  - patch review
versions: +Python 3.4

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



[issue11346] Generator object should be mentioned in gc module document

2013-01-05 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +pitrou
stage:  - needs patch
type:  - enhancement
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4

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



[issue16869] makesetup should support .S source files

2013-01-05 Thread Benno Leslie

Benno Leslie added the comment:

Thanks for the comments Senthil. I'll improve the patch fixing the bug, adding 
support for .s and updating the docs.

--

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



[issue8109] Server-side support for TLS Server Name Indication extension

2013-01-05 Thread danblack

danblack added the comment:

 I don't know which error code should be returned in this case.

Thanks Christian. My fault - asked Antoine to remove the default value for it 
and didn't see this like.

make line 2403:

return SSL_TLSEXT_ERR_OK;

--

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