[issue24376] xxlimited.c errors when building 32 and 64 bit on Windows

2015-06-03 Thread Mark Lawrence

Mark Lawrence added the comment:

Thanks for the comment David.  Last time I used any kind of change system in 
anger was Visual Source Safe 15 years ago, and VAX/VMS CMS/MMF(?) before that.  
Where do I start with Mercurial?  I don't even know what the difference is 
between setting up the now default 3.6 and 3.5?

--

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



[issue24374] Plug refleak in set_coroutine_wrapper

2015-06-03 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


Added file: http://bugs.python.org/file39611/set_coro.patch

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



[issue22931] cookies with square brackets in value

2015-06-03 Thread Tim Pierce

Changes by Tim Pierce twpie...@gmail.com:


--
nosy: +Tim Pierce

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



[issue24360] improve argparse.Namespace __repr__ for invalid identifiers.

2015-06-03 Thread paul j3

paul j3 added the comment:

An alternative would be to wrap a non-identifier name in 'repr()':

def repr1(self):
def fmt_name(name):
if name.isidentifier():
return name
else:
return repr(name)
type_name = type(self).__name__
arg_strings = []
for arg in self._get_args():
arg_strings.append(repr(arg))
for name, value in self._get_kwargs():
arg_strings.append('%s=%r' % (fmt_name(name), value))
return '%s(%s)' % (type_name, ', '.join(arg_strings))

This would produce lines like:

Namespace(baz='one', 'foo bar'='test', 'x __y'='other')

Namespace(a=1, b=2, 'double  quote'='', single ' quote =')

Namespace(')'=3, a=1)

Namespace(a=1, 'b=2), Namespace(c'=3)

With names that are deliberately messy, it is hard to say which is clearer.

--

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



[issue24338] In argparse adding wrong arguments makes malformed namespace

2015-06-03 Thread paul j3

paul j3 added the comment:

http://bugs.python.org/issue15125
argparse: positional arguments containing - in name not handled well

Discussion on whether positionals 'dest' should translate '-' to '_'.

--

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



[issue24268] PEP 489 -- Multi-phase extension module initialization

2015-06-03 Thread Petr Viktorin

Petr Viktorin added the comment:

I've posted a patch that fixes the remaining refleak in issue24373.

--

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



[issue24360] improve argparse.Namespace __repr__ for invalid identifiers.

2015-06-03 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

 Namespace(a=1, 'b=2), Namespace(c'=3)

:-) I read that a `prime-b`=2 and `c-prime`=3.

I just feel like having a repr which is closer to the constructor signature is 
better, but I guess it's a question of taste. Anyway, both would be fine.

--

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



[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2015-06-03 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

I gave that a shot. 
Doing it cleanly in C as the warning module is initialized much earlier. 
Though I'm not super used to CPython internals. 
Doing just before the repl by using `PyRun_SimpleString` make the patch 
relatively small.

--
keywords: +patch
nosy: +mbussonn
Added file: 
http://bugs.python.org/file39612/enable_deprecation_warnings_in_repl.patch

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



[issue24338] In argparse adding wrong arguments makes malformed namespace

2015-06-03 Thread py.user

py.user added the comment:

paul j3 wrote:
 It's an attempt to turn such flags into valid variable names.

I'm looking at code and see that he wanted to make it handy for use in a 
resulting Namespace.

args = argparse.parse_args(['--a-b-c'])
abc = args.a_b_c

If he doesn't convert, he cannot get attribute without getattr().

It's not a UNIX reason.

--

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



[issue24338] In argparse adding wrong arguments makes malformed namespace

2015-06-03 Thread paul j3

paul j3 added the comment:

Yes, the '_' makes it accessible as an attribute name.  But the presence of '-' 
in the option name has a UNIX history.  That is a flag like '--a-b-c' is 
typical, '--a_b_c' is not.

There is less of precedent for a flag like '@@a@b' or '--a@b'.

Here's the relevant code from '_ActionContainer' class.

def _get_optional_kwargs(self, *args, **kwargs):
# determine short and long option strings
...
for option_string in args:
# error on strings that don't start with an appropriate prefix
if not option_string[0] in self.prefix_chars:
...
raise ValueError(msg % args)

# strings starting with two prefix characters are long options
option_strings.append(option_string)
if option_string[0] in self.prefix_chars:
if len(option_string)  1:
if option_string[1] in self.prefix_chars:
long_option_strings.append(option_string)

# infer destination, '--foo-bar' - 'foo_bar' and '-x' - 'x'
dest = kwargs.pop('dest', None)
if dest is None:
if long_option_strings:
dest_option_string = long_option_strings[0]
else:
dest_option_string = option_strings[0]
dest = dest_option_string.lstrip(self.prefix_chars)
if not dest:
msg = _('dest= is required for options like %r')
raise ValueError(msg % option_string)
dest = dest.replace('-', '_')

Even if you need to have odd ball characters in the option flag, you don't have 
to settle for them in the 'dest'.  You can always give the argument a nice 
looking 'dest'.  

That's a rather common pattern in 'argparse'.  Provide a default handling for 
common cases, and provide parameters that let the user override those defaults. 
 The net effect is to limit the complexity of the code, while increasing the 
complexity of the documentation.

--

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2015-06-03 Thread Serhiy Storchaka

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


--
stage: needs patch - patch review
versions: +Python 3.6 -Python 3.5

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2015-06-03 Thread Tal Einat

Tal Einat added the comment:

Should Argument Clinic conversion patches still be against the 'default' 
branch, and not 3.5, even though they don't include any functionality changes?

--

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



[issue18003] lzma module very slow with line-oriented reading.

2015-06-03 Thread Martin Panter

Martin Panter added the comment:

Looking at https://bugs.python.org/file39586/decomp-optim.patch, the “closed” 
property is the first of the three hunks:

1. Adds @property / def closed(self) to Lib/_compression.py
2. Adds def __iter__(self) to Lib/gzip.py
3. Adds def __iter__(self) to Lib/lzma.py

--

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



[issue18003] lzma module very slow with line-oriented reading.

2015-06-03 Thread Martin Panter

Martin Panter added the comment:

New patch just fixes the spelling error in the comment.

--
stage: needs patch - patch review
Added file: http://bugs.python.org/file39604/decomp-optim.v2.patch

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



[issue18003] lzma module very slow with line-oriented reading.

2015-06-03 Thread Larry Hastings

Larry Hastings added the comment:

I don't see anything about closed in the patch you posted.

--

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



[issue18003] lzma module very slow with line-oriented reading.

2015-06-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Yes, this is right.

--

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



[issue24363] httplib fails to handle semivalid HTTP headers

2015-06-03 Thread Cory Benfield

Cory Benfield added the comment:

 It is obvious that this case could be treated as a folded (continuation) 
 line. But in general I think it would be better to ignore the erroneous line, 
 or to record it as a defect so that the server module or other user can check 
 it.

Just to clarify, in an instance very similar to this one this would be 
*terrible* advice. The token that would be lost here is the 'Secure' field on 
the cookie, which is an extremely important token to have: if we don't 
correctly parse it, we run the risk of sending the cookie on plaintext 
connections.

Discarding data is the problem, and while discarding *less* data is an 
improvement, it would be good if we could resolve this problem in such a way 
that we'd have correctly parsed this header.

Generally speaking, if we treat these as continuation lines I think we have the 
best change of making a useful header out of this mess.

--

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



[issue18003] lzma module very slow with line-oriented reading.

2015-06-03 Thread Martin Panter

Martin Panter added the comment:

Yes that’s basically right Larry. The __iter__() was previously inherited; now 
I am overriding it with a custom version. Similarly for the “closed” property, 
but that one is only a member of objects internal to the gzip, lzma and bz2 
modules.

--

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



[issue24270] PEP 485 (math.isclose) implementation

2015-06-03 Thread Tal Einat

Tal Einat added the comment:

Indeed, it should be.

--

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



[issue24371] configparser hate dot in option like eth2.6

2015-06-03 Thread Yavuz Selim Komur

New submission from Yavuz Selim Komur:

[remember]
eth2.6 = True
eth5 = True



eth5 correct but eth2.6 return exception

--
components: Extension Modules, Library (Lib)
messages: 244730
nosy: Yavuz Selim Komur
priority: normal
severity: normal
status: open
title: configparser hate dot in option like eth2.6
versions: Python 3.3, Python 3.4

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2015-06-03 Thread Tal Einat

Tal Einat added the comment:

Attached is an updated patch for Modules/mathmodule.c.

This is based on Georg's patch, updated to apply to current 3.5, with several 
improvements:

* replaced legacy converters
* converted math.ceil() and math.floor() functions
* converted the new math.gcd() and math.isclose() functions
* AC generated code in separate file: Modules/clinic/mathmodule.c.h
* this patch doesn't change any internal variable names in the C code

--
nosy: +taleinat
Added file: http://bugs.python.org/file39602/issue20186.mathmodule.patch

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



[issue24270] PEP 485 (math.isclose) implementation

2015-06-03 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue24363] httplib fails to handle semivalid HTTP headers

2015-06-03 Thread Cory Benfield

Cory Benfield added the comment:

While we're here and I'm recommending to drop as little data as possible: we 
need to be really careful about not exposing ourselves to any kind of data 
smuggling attack here.

It's really important that we don't let attackers construct bodies of requests 
or responses that will cause us to misinterpret header blocks. It's therefore 
going to be really tricky to balance those concerns.

--

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2015-06-03 Thread Tal Einat

Tal Einat added the comment:

Attached is an AC conversion patch for Objects/enumobject.c.

Note that this file contains the implementations of the 'enumerate' and 
'reversed' classes, but *not* the 'Enum' class.

This is based on the 3.5 branch.

--
Added file: http://bugs.python.org/file39603/issue20186.enumobject.patch

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



[issue24372] Documentation for ssl.wrap_socket's ssl_version parameter is odd

2015-06-03 Thread Christian Heimes

Christian Heimes added the comment:

I'd like to deprecate ssl.wrap_socket() in favor of SSLContext.wrap_socket(). 
Libraries should rather accept a context than expose the awkward interface of 
ssl.wrap_socket(). A context object is far more powerful and easier to use.

--

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



[issue24363] httplib fails to handle semivalid HTTP headers

2015-06-03 Thread Michael Del Monte

Michael Del Monte added the comment:

Given that obs-fold is technically valid, then can I recommend reading the 
entire header first (reading to the first blank line) and then tokenizing the 
individual headers using a regular expression rather than line by line?  That 
would solve the problem more elegantly and easily than attempting to read lines 
on the fly and then unreading the nonconforming lines.

Here's my recommendation:

def readheaders(self):
self.dict = {}
self.unixfrom = ''
self.headers = hlist = []
self.status = ''
# read entire header (read until first blank line)
while True:
line = self.fp.readline(_MAXLINE+1)
if not line:
self.status = 'EOF in headers'
break
if len(line)  _MAXLINE:
raise LineTooLong(header line)
hlist.append(line)
if line in ('\n', '\r\n'):
break
if len(hlist)  _MAXHEADERS:
raise HTTPException(got more than %d headers % _MAXHEADERS)
# reproduce and parse as string
header = \n.join(hlist)
self.headers = re.findall(r[^ \n][^\n]+\n(?: +[^\n]+\n)*, header)
firstline = True
for line in self.headers:
if firstline and line.startswith('From '):
self.unixfrom = self.unixfrom + line
continue
firstline = False
if ':' in line:
k,v = line.split(':',1)
self.addheader(k, re.sub(\n +,  , v.strip()))
else:
self.status = 'Non-header line where header expected' if 
self.dict else 'No headers'


I think this handles everything you're trying to do.  I don't understand the 
unixfrom bit, but I think I have it right.

As for Cory's concern re: smuggling, _MAXLINE and _MAXHEADERS should help with 
that.  The regexp guarantees that every line plus continuation appears as a 
single header.

I use re.sub(\n +,  , v.strip()) to clean the value and remove the 
continuation.

--

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



[issue24372] Documentation for ssl.wrap_socket's ssl_version parameter is odd

2015-06-03 Thread Christian Heimes

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


--
nosy: +christian.heimes

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



[issue23237] Interrupts are lost during readline PyOS_InputHook processing (reopening)

2015-06-03 Thread Michiel de Hoon

Michiel de Hoon added the comment:

I am uploading an updated version of the patch.
I'd be happy to submit a patch to the documentation also, but wasn't able to 
find it on Mercurial. Can somebody please point me to the right repository for 
the documentation?

--
Added file: http://bugs.python.org/file39608/issue23237.version2.patch

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



[issue24375] Performance regression relative to 2.7

2015-06-03 Thread Yury Selivanov

New submission from Yury Selivanov:

Attached (t.py) is a random script that I stumbled upon pretty randomly on the 
internet -- someone used it to test different languages VMs performance.

The interesting thing is that 2.7 runs it 20-30% faster than 3.4  3.5 
consistently.  The script does not involve any unicode data manipulation, it's 
mostly abount float arithmetic and function calls.

--
components: Interpreter Core
files: t.py
messages: 244754
nosy: benjamin.peterson, haypo, ncoghlan, pitrou, yselivanov
priority: normal
severity: normal
status: open
title: Performance regression relative to 2.7
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file39609/t.py

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



[issue24362] Simplify the fast nodes resize logic in C OrderedDict.

2015-06-03 Thread Stefan Krah

Stefan Krah added the comment:

I think this is much nicer, thank you!

And the XXX comment looks right, updating od_size could be moved
down.  I suspect that updating it too early was the cause for
#24361, which is also solved by this patch.

--

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



[issue24372] Documentation for ssl.wrap_socket's ssl_version parameter is odd

2015-06-03 Thread Eric V. Smith

Eric V. Smith added the comment:

I have a requirement to support 2.7.5, so SSLContext is currently a problem for 
me.

I realize that 2.7 could at best get a documentation change.

--

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



[issue24374] Plug refleak in set_coroutine_wrapper

2015-06-03 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


--
nosy: +gvanrossum, haypo

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



[issue24363] httplib fails to handle semivalid HTTP headers

2015-06-03 Thread Michael Del Monte

Michael Del Monte added the comment:

... or perhaps

if ':' in line and line[0] != ':':

to avoid the colon-as-first-char bug that plagued this library earlier, though 
the only ill-effect of leaving it alone would be a header with a blank key; not 
the end of the world.

--

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



[issue24134] assertRaises can behave differently

2015-06-03 Thread Tim Graham

Tim Graham added the comment:

Unfortunately, the revert wasn't merged to the 2.7 branch until after the 
release of 2.7.10. I guess this regression wouldn't be considered serious 
enough to warrant a 2.7.11 soon, correct?

--

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



[issue24373] Use traverse finalize in xxlimited and in PEP 489 tests

2015-06-03 Thread Petr Viktorin

New submission from Petr Viktorin:

The example object in the xxlimited module can be part of a reference loop (it 
can contain itself), so it needs GC and tp_traverse.

The tp_dealloc hook was incorrect, and a correct version would be difficult to 
generalize for something more complicated than a example class (#16690; [0]). 
It's better to avoid dealloc and show off tp_finalize.

Same for the class in _testmultiphase (PEP 489 tests), which is based on 
xxlimited. The incorrect dealloc is causing the reference leak mentioned in 
#24268.

The Xxo object also wasn't actually added to the module.

Here is a patch to fix these.

[0] https://mail.python.org/pipermail/python-dev/2015-June/140422.html

--
components: Extension Modules
files: xxlimited-finalize.patch
keywords: patch
messages: 244743
nosy: encukou, ncoghlan
priority: normal
severity: normal
status: open
title: Use traverse  finalize in xxlimited and in PEP 489 tests
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file39605/xxlimited-finalize.patch

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



[issue24079] xml.etree.ElementTree.Element.text does not conform to the documentation

2015-06-03 Thread Martin Panter

Martin Panter added the comment:

Okay, here is a version with most of the wording reverted to Jérôme’s 
suggestion. I only left my itertext() example, and the grouping of text and 
tail together. If there are any more bits that are incorrect or unclear please 
identify them.

--
Added file: http://bugs.python.org/file39606/etree-text.v2.patch

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



[issue24371] configparser hate dot in option like eth2.6

2015-06-03 Thread Skip Montanaro

Skip Montanaro added the comment:

What little I could find about Windows INI file syntax didn't identify the 
valid character set of the keys. Like other Windows-based file formats, INI 
seems to only be operationally defined. It wouldn't surprise me if you needed 
to restrict yourself to the usual identifier syntax. In regular expression 
terms:

[_A-Za-z][a-zA-Z_0-9]*

--
nosy: +skip.montanaro

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



[issue24375] Performance regression relative to 2.7

2015-06-03 Thread Stefan Krah

Stefan Krah added the comment:

This is my experience, too:  Floating-point calculations are often
20-30% faster on 2.7.

--
nosy: +skrah

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



[issue24375] Performance regression relative to 2.7

2015-06-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

FTR, Python 2.7 was slower until the computed gotos patch was backported.

--

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



[issue24375] Performance regression relative to 2.7

2015-06-03 Thread Yury Selivanov

Yury Selivanov added the comment:

This is strange. On one of my gentoo boxes I'm having about the same 
performance of 2.7.9 and 3.4.3.

On macos x, 2.7.10 is faster than 3.5.x (make distclean  ./configure  make).

I don't know if I should close this issue.

--

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



[issue24017] Implemenation of the PEP 492 - Coroutines with async and await syntax

2015-06-03 Thread Alex Grönholm

Alex Grönholm added the comment:

Was __await__() deliberately left out of concurrent.futures.Future or was that 
an oversight? Or am I misunderstanding something?

--
nosy: +alex.gronholm

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



[issue24375] Performance regression relative to 2.7

2015-06-03 Thread Yury Selivanov

Yury Selivanov added the comment:

Alright.  I'm closing it, as it seems it's not obvious what's really going on 
here.  I'll try to profile it on my own later.

 (also, computing the Mandelbrot set using the CPython interpreter isn't a 
 very good use case)

Antoine, well, regardless of the actual task, we shouldn't have such cases 
(ideally).  FWIW, using numba.jit gives a ~50x boost ;)

--
resolution:  - postponed
status: open - closed
type:  - performance

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



[issue24375] Performance regression relative to 2.7

2015-06-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 This is strange. On one of my gentoo boxes I'm having about the same 
 performance of 2.7.9 and 3.4.3.

As I said: the computed gotos patch improved performance between 2.7.9 and 
2.7.10.

In any case, if there's no obvious course of action you can suggest, I think 
it's better to close this issue. We don't want to keep an issue open for each 
performance regression in the wild.

(also, computing the Mandelbrot set using the CPython interpreter isn't a very 
good use case)

--

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



[issue24017] Implemenation of the PEP 492 - Coroutines with async and await syntax

2015-06-03 Thread Yury Selivanov

Yury Selivanov added the comment:

 Was __await__() deliberately left out of concurrent.futures.Future or was 
 that an oversight? Or am I misunderstanding something?

I don't think concurrent.Future is supposed to be used with asyncio (in 'yield 
from' or 'await' expressions).

--

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



[issue24376] xxlimited.c errors when building 32 and 64 bit on Windows

2015-06-03 Thread Steve Dower

Steve Dower added the comment:

It's more recent, but still only a doc change.

What's the description of the change you're referring to?

--

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



[issue24338] In argparse adding wrong arguments makes malformed namespace

2015-06-03 Thread paul j3

paul j3 added the comment:

The code that converts '-' to '_' is independent of the code that uses 
'prefix_chars'.

The '-' conversion handles a long standing UNIX practice of allowing that 
character in the middle of option flags.  It's an attempt to turn such flags 
into valid variable names.  There is a bug/issue about whether the conversion 
should be applied to positional argument 'dest' parameters.  

Is the use of other funny characters in optional flags common enough to warrant 
a patch?  It probably wouldn't be hard to convert all 'prefix_chars' to '_'.  
But should it still convert '-', even if it isn't in that list?  What about 
users who are content with using 'getattr', and don't want the conversion?

Note also that you can invoke `parse_args` with your own custom Namespace 
object.

https://docs.python.org/3.4/library/argparse.html#the-namespace-object

This means you can write a Namespace class alternative that can handle funny 
characters in any way you want.  I discuss the use of custom Namespace classes 
in http://bugs.python.org/issue9351.

Between the availability of 'getattr' and namespace customization, I don't 
think there's anything here that requires a patch.  But I'm in favor of keeping 
the issue open for discussion.

--
nosy: +paul.j3

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



[issue24251] Different behavior for argparse between 2.7.8 and 2.7.9 when adding the same arguments to the root and the sub commands

2015-06-03 Thread paul j3

paul j3 added the comment:

And the corresponding bug issue

http://bugs.python.org/issue9351

--
nosy: +paul.j3

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



[issue24361] OrderedDict: crash with threads

2015-06-03 Thread Eric Snow

Eric Snow added the comment:

This has been fixed via issue24362.

--
resolution:  - fixed
stage: needs patch - resolved
status: open - closed

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



[issue24377] Refleak in OrderedDict.__repr__ when an item is not found.

2015-06-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6df1b3c6c8e8 by Eric Snow in branch '3.5':
Issue #24377: Fix a ref leak in OrderedDict.__repr__.
https://hg.python.org/cpython/rev/6df1b3c6c8e8

--
nosy: +python-dev

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



[issue24376] xxlimited.c errors when building 32 and 64 bit on Windows

2015-06-03 Thread Mark Lawrence

Mark Lawrence added the comment:

Try r96496 :(

--

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



[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2015-06-03 Thread paul j3

paul j3 added the comment:

Another example of this patch causing backward compatibility problems

http://bugs.python.org/issue24251

--

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



[issue24377] Refleak in OrderedDict.__repr__ when an item is not found.

2015-06-03 Thread Eric Snow

New submission from Eric Snow:

It should be a one-line fix.

--
assignee: eric.snow
messages: 244775
nosy: eric.snow
priority: high
severity: normal
stage: needs patch
status: open
title: Refleak in OrderedDict.__repr__ when an item is not found.
type: behavior
versions: Python 3.5, Python 3.6

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



[issue8232] webbrowser.open incomplete on Windows

2015-06-03 Thread Steve Dower

Steve Dower added the comment:

I do like this fix, and I'm sorry I didn't get to reviewing it before beta 1 
was released - can we consider this something to fix for 3.5 or do we need to 
slip it until 3.6?

--

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



[issue24377] Refleak in OrderedDict.__repr__ when an item is not found.

2015-06-03 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
resolution:  - fixed
stage: needs patch - resolved
status: open - closed

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



[issue22359] Remove incorrect uses of recursive make

2015-06-03 Thread koobs

Changes by koobs koobs.free...@gmail.com:


--
stage: resolved - needs patch

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



[issue24360] improve argparse.Namespace __repr__ for invalid identifiers.

2015-06-03 Thread paul j3

paul j3 added the comment:

I mentioned in the related bug/issue that no one has to use odd characters and 
spaces in the Namespace.  While they are allowed by 'getattr' etc, the 
programmer has the option of supplying rational names in the 'dest' parameter.  

There's also the question of what kinds of strings can you supply via  
'sys.argv'.  For example, I have to use quotes to enter

$ python echoargv.py '--b=2), Namespace(c' test

Without them 'bash' gives me an error.

Strings like this may be nice for exercising a patch, they may not be realistic 
in full argparse context.

--

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



[issue24251] Different behavior for argparse between 2.7.8 and 2.7.9 when adding the same arguments to the root and the sub commands

2015-06-03 Thread Rémi Rampin

Changes by Rémi Rampin remiram...@gmail.com:


--
nosy: +remram

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



[issue24376] xxlimited.c errors when building 32 and 64 bit on Windows

2015-06-03 Thread R. David Murray

R. David Murray added the comment:

Mark, FYI the 'r' numbers are unique to each mercurial checkout and meaningless 
to anyone else.  Only the hash numbers can be used to compare revisions between 
different repositories.  (You *could* refer to the r number from the cpython 
repository as seen in the mercurial web interface to it, because other people 
could look that one up via the web interface, but it is best to get in the 
habit of always using the hash.)

--
nosy: +r.david.murray

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



[issue8232] webbrowser.open incomplete on Windows

2015-06-03 Thread R. David Murray

R. David Murray added the comment:

I haven't reviewed the patch, but if it only makes the existing API actually 
work for Windows, I think it would be fair game for 3.5.  Larry would need to 
make the call, though.

--
nosy: +larry, r.david.murray

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



[issue24369] Using OrderedDict.move_to_end during iteration is problematic.

2015-06-03 Thread Eric Snow

Eric Snow added the comment:

Here's a patch that tracks changes to the C OrderedDict linked list, similar to 
how it's done in deque.  I've left the pure Python OrderedDict alone.

@Raymond, that state counter works great. :)

--
keywords: +patch
stage: test needed - patch review
Added file: http://bugs.python.org/file39610/issue24369-iteration-mutation.diff

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



[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2015-06-03 Thread Rémi Rampin

Rémi Rampin added the comment:

To me this is much more than a compatibility problem. The way it worked before 
made a lot of sense, and just felt like the correct solution to accept a flag 
in multiple places.

Having a --verbose flag is something everybody should consider (Python has a 
decent builtin logging module), and anybody providing it would definitely want 
to accept it before and after subcommands (or at least, for every subcommand).

The only way right now is to not only create different arguments with 
add_argument(), for each parser, but you also need to provide different 
destination names (and then do something shitty like verbosity = 
args.verb_main+args.verb_subcommand). This bug makes argparse completely 
unusable for any real-life application that uses subparsers (in addition to 
breaking existing programs). And it breaks silently too, simply amazing!

Of course there is very little point in fixing this now. Since this affects 
multiple released versions of Python, I have to use a work-around anyway (until 
I can move from argparse to something that won't decide to break someday for 
the hell of it).

--

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



[issue24360] improve argparse.Namespace __repr__ for invalid identifiers.

2015-06-03 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

Sure and anyway if you have a huge namespace, things will become unreadable. 
But during development/teaching, having object that have a sane 
representation is useful, otherwise your brain (well at least mine), choke on 
the output and break the flow of my thoughts.

One could also just use __repr(self)__ = repr(self.__dict__), that woudl be 
even simpler and readable :-)

--

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



[issue24376] xxlimited.c errors when building 32 and 64 bit on Windows

2015-06-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b8bcc5507541 by Steve Dower in branch '3.5':
Issue #24376: xxlimited.c errors when building 32 and 64 bit on Windows
https://hg.python.org/cpython/rev/b8bcc5507541

New changeset c802fba79554 by Steve Dower in branch 'default':
Issue #24376: xxlimited.c errors when building 32 and 64 bit on Windows
https://hg.python.org/cpython/rev/c802fba79554

--
nosy: +python-dev

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



[issue24360] improve argparse.Namespace __repr__ for invalid identifiers.

2015-06-03 Thread paul j3

paul j3 added the comment:

Off hand I don't see a problem with this patch (but I haven't tested it yet).

But I have a couple of cautions:

The docs say, regarding the Namespace class:

 This class is deliberately simple, just an object subclass with a readable 
 string representation.

This patch improves the 'readable' part, but adds some complexity.

The docs also note that the user can provide their own namespace object, and by 
implication, a custom Namespace class with this improved '__repr__'.

The Namespace '__repr__' is mainly of value during code development, especially 
when trying ideas in an interactive shell.  It's unlikely that you would want 
to show the whole namespace to your end user.  So even if your final API 
requires funny characters, you don't need to use them during development.

--
nosy: +paul.j3

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



[issue24376] xxlimited.c errors when building 32 and 64 bit on Windows

2015-06-03 Thread Zachary Ware

Zachary Ware added the comment:

We need to bump the Py_LIMITED_API definition in PCbuild/xxlimited.vcxproj
as well.

--

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



[issue24376] xxlimited.c errors when building 32 and 64 bit on Windows

2015-06-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 31301b84ac8d by Steve Dower in branch 'default':
Issue #24376: Bumps xxlimited.vcxproj to use 3.6 limited ABI.
https://hg.python.org/cpython/rev/31301b84ac8d

--

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