[issue24379] slice.literal notation

2015-06-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Why not index the slice type itself? slice[1:2]

> Another feature of the new `literal` object is that it is not limited to just 
> the creation of `slice` instances; instead, it is designed to mix slices and 
> other types together.

This looks as disadvantage.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue24379] slice.literal notation

2015-06-03 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue24379] slice.literal notation

2015-06-03 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, I like this idea.

--
nosy: +rhettinger

___
Python tracker 

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

Changes by Eric Snow :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
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 Roundup Robot

Roundup Robot added the comment:

New changeset 0d8679858272 by Eric Snow in branch '3.5':
Issue #24369: Defend against key-changes during iteration.
https://hg.python.org/cpython/rev/0d8679858272

--
nosy: +python-dev

___
Python tracker 

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



[issue24379] slice.literal notation

2015-06-03 Thread Joe Jevnik

Joe Jevnik added the comment:

Here is the patch that includes the updates to 'slice.__repr__'

--
Added file: http://bugs.python.org/file39615/slicerepr.patch

___
Python tracker 

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



[issue24379] slice.literal notation

2015-06-03 Thread Joe Jevnik

New submission from Joe Jevnik:

I often find that when working with pandas and numpy I want to store slice 
objects in variables to pass around and re-use; however, the syntax for 
constructing a slice literal outside of an indexer is very different from the 
syntax used inside of a subscript. This patch proposes the following change:

slice.literal

This would be a singleton instance of a class that looks like:

class sliceliteral(object):
def __getitem__(self, key):
return key


The basic idea is to provide an alternative constructor to 'slice' that uses 
the subscript syntax. This allows people to write more understandable code.

Consider the following examples:

reverse = slice(None, None, -1)
reverse = slice.literal[::-1]

all_rows_first_col = slice(None), slice(0)
all_rows_first_col = slice.literal[:, 0]

first_row_all_cols_but_last = slice(0), slice(None, -1)
first_row_all_cols_but_last = slice.literal[0, :-1]


Again, this is not intended to make the code shorter, instead, it is designed 
to make it more clear what the slice object your are constructing looks like.

Another feature of the new `literal` object is that it is not limited to just 
the creation of `slice` instances; instead, it is designed to mix slices and 
other types together. For example:

>>> slice.literal[0]
0
>>> slice.literal[0, 1]
(0, 1)
>>> slice.literal[0, 1:]
(0, slice(1, None, None)
>>> slice.literal[:, ..., ::-1]
(slice(None, None, None), Ellipsis, slice(None, None, -1)

These examples show that sometimes the subscript notation is much more clear 
that the non-subscript notation.
I believe that while this is trivial, it is very convinient to have on the 
slice type itself so that it is quickly available. This also prevents everyone 
from rolling their own version that is accesible in different ways (think 
Py_RETURN_NONE).
Another reason that chose this aproach is that it requires no change to the 
syntax to support.

There is a second change proposed here and that is to 'slice.__repr__'. This 
change makes the repr of a slice object match the new literal syntax to make it 
easier to read.

>>> slice.literal[:]
slice.literal[:]
>>> slice.literal[1:]
slice.literal[1:]
>>> slice.literal[1:-1]
slice.literal[1:-1]
>>> slice.literal[:-1]
slice.literal[:-1]
>>> slice.literal[::-1]
slice.literal[::-1]

This change actually affects old behaviour so I am going to upload it as a 
seperate patch. I understand that the change to repr much be less desirable 
than the addition of 'slice.literal'

--
components: Interpreter Core
files: slice.patch
keywords: patch
messages: 244801
nosy: ll
priority: normal
severity: normal
status: open
title: slice.literal notation
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file39614/slice.patch

___
Python tracker 

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



[issue24378] dir(dictobject) returns empty list when __getattribute__ is overriden in the class

2015-06-03 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

___
___
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 Raymond Hettinger

Raymond Hettinger added the comment:

This patch looks correct.  Go ahead and apply.

--
assignee: rhettinger -> eric.snow

___
Python tracker 

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



[issue22385] Define a binary output formatting mini-language for *.hex()

2015-06-03 Thread Chris Lasher

Changes by Chris Lasher :


--
nosy: +gotgenes

___
Python tracker 

___
___
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 Stefan Behnel

Stefan Behnel added the comment:

Hmm, but IMHO a) the new syntax isn't just for asyncio and b) awaiting a Future 
seems like a *very* reasonable thing to do. I think opening a new ticket for 
this is a good idea.

--

___
Python tracker 

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



[issue24378] dir(dictobject) returns empty list when __getattribute__ is overriden in the class

2015-06-03 Thread Alka Yadav

New submission from Alka Yadav:

When __getattribute__ method is overrriden in a class,then in case of calling 
an attribute not in class object should throw KeyError.

But when calling dir on classs object gives an empty list as dir(dictobject) 
calls dictobject.__getattribute__(dir) and it throws KeyError instead of 
AttributeError in dir annd it returns NULL upstream

So dir source code need to be fixed to catch KeyError appropriately.

--
components: Library (Lib)
files: direrror.py
messages: 244798
nosy: alkayadavi...@gmail.com
priority: normal
severity: normal
status: open
title: dir(dictobject) returns empty list when __getattribute__ is overriden in 
the class
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file39613/direrror.py

___
Python tracker 

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


--
components: +Cross-Build

___
Python tracker 

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


--
stage: resolved -> needs patch

___
Python tracker 

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



[issue24303] OSError 17 due to _multiprocessing/semaphore.c assuming a one-to-one Pid -> process mapping.

2015-06-03 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I think it would be a better idea to partially backport the 2.7 logic that uses 
the random module.

--
nosy: +benjamin.peterson

___
Python tracker 

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

As far as I remember, argparse is not only use to parse things from sys.argv 
where the quoting is not necessary. And Namespace is not only use in argparse.

But if you don't want improvement, feel free to close.

--

___
Python tracker 

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

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

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

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

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

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

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

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

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


--
nosy: +Tim Pierce

___
Python tracker 

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


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

___
Python tracker 

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

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 

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

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

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

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

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


--
nosy: +remram

___
Python tracker 

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

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

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

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

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

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

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


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

___
Python tracker 

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

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

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

___
___
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 Eric Snow

Eric Snow added the comment:

Thanks for pushing this, Stefan (and Jim). :)

--
resolution:  -> fixed
type:  -> behavior

___
Python tracker 

___
___
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 Roundup Robot

Roundup Robot added the comment:

New changeset c78c5832ccc0 by Eric Snow in branch '3.5':
Issue #24362: Simplify the C OrderedDict fast nodes resize logic.
https://hg.python.org/cpython/rev/c78c5832ccc0

--
nosy: +python-dev

___
Python tracker 

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

Following taken from tortoisehg workbench, the only file changed is setup.py so 
please don't ask.

Changeset: 96496 (6278f932fb29) upgrade xxlimited abi to 3.5
Branch:  3.5 
User: Benjamin Peterson 
Date: 2015-06-03 00:04:46 -0500 (11 hours)
Parent: 96494 (38ffea158630) Issue #24368: Support keyword arguments in 
OrderedDict methods.
Child: 96497 (6278231825a1)  default  merge 3.5

--

___
Python tracker 

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

Changes by smparkes :


--
nosy: +smparkes

___
Python tracker 

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

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

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

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

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

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

Which revision? Can you post a hash or issue number instead - in my repo r46496 
is from a couple of years ago...

--

___
Python tracker 

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

New submission from Mark Lawrence:

5>..\Modules\xxlimited.c(268): error C2061: syntax error : identifier 'xx_slots'
5>..\Modules\xxlimited.c(268): error C2059: syntax error : ';'
5>..\Modules\xxlimited.c(268): error C3409: empty attribute block is not allowed
5>..\Modules\xxlimited.c(268): error C2513: '/*global*/ ' : no variable 
declared before '='
5>..\Modules\xxlimited.c(269): error C2065: 'Py_mod_exec' : undeclared 
identifier
5>..\Modules\xxlimited.c(279): error C2065: 'xx_slots' : undeclared identifier
5>..\Modules\xxlimited.c(283): error C2099: initializer is not a constant
5>..\Modules\xxlimited.c(290): warning C4013: 'PyModuleDef_Init' undefined; 
assuming extern returning int
5>..\Modules\xxlimited.c(290): warning C4047: 'return' : 'PyObject *' differs 
in levels of indirection from 'int'

I believe it's down to r46496.

--
components: Windows
messages: 244764
nosy: BreamoreBoy, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: xxlimited.c errors when building 32 and 64 bit on Windows
type: compile error
versions: Python 3.5, Python 3.6

___
Python tracker 

___
___
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 R. David Murray

R. David Murray added the comment:

I'm guessing python3 would also handle unicode identifiers, but I haven't 
checked.  That said, there's no reason configparser couldn't handle any key 
that doesn't have a '#', ';', ':' or '=' in it, in theory.  Whether we *want* 
to do that or not is a different question, and would lead to the question of 
what the correct normalization would be for keys.

--
nosy: +lukasz.langa, r.david.murray
type:  -> enhancement
versions: +Python 3.6 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2015-06-03 Thread Carl Osterwisch

Carl Osterwisch added the comment:

I need to have an external DLL open and read the named file but this current 
NamedTemporaryFile implementation prevents that from working on Windows.

--
nosy: +Carl Osterwisch

___
Python tracker 

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

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

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

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

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

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

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

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

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

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

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


--
nosy: +gvanrossum, haypo

___
Python tracker 

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

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

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

New submission from Yury Selivanov:

Code to raise RuntimeError introduced in issue24342 has some refleaks.  Please 
review the attached patch.

--
assignee: yselivanov
components: Interpreter Core
files: set_coro.patch
keywords: patch
messages: 244749
nosy: ncoghlan, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: Plug refleak in set_coroutine_wrapper
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file39607/set_coro.patch

___
Python tracker 

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

DISCLAIMER:

I'm currently planning and researching two SSL related PEPs. One PEP is about 
SSLContext.

I like to standardize a minimal interface for SSL context object, so libraries 
can deal with any abitrary SSL implementation. With just one small addition and 
an SSLContext ABC, every library could then support stdlib ssl, PyOpenSSL, 
GnuTLS, NSS, PyQT/PySide QSslSocket and even non-standard sockets like NSPR 
PRFileDesc and QTcpSocket.

My idea only works with a SSL context object. So I'm interested that people use 
the new feature rather then the old ssl.wrap_socket() function. :)

--

___
Python tracker 

___
___
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 Piotr Dobrogost

Changes by Piotr Dobrogost :


--
nosy: +piotr.dobrogost

___
Python tracker 

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

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

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


--
nosy: +christian.heimes

___
Python tracker 

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

It occurs to me that None would also be a fine default, and probably the 
smarter choice.

Then wrap_socket could say:
if ssl_version is None:
  ssl_version = PROTOCOL_SSLv23

And we could change the default as needed, without being held to the actual 
value. And wrapper code, like mine, would declare a default of None and things 
would continue to work across versions.

--

___
Python tracker 

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

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

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

New submission from Eric V. Smith:

The documentation for ssl.wrap_socket()'s ssl_version parameter says 
"ssl_version={see docs}". But as far as I can tell, there's no reason not to 
document it as PROTOCOL_SSLv23, since that's what it actually is in the code.

My use case is that I'm producing a utility function for an RFC-5804 Manage 
Sieve client, which implements starttls(). I want to expose most of 
wrap_sockets()'s parameters, and pass them in to ssl.wrap_socket() itself. In 
order to do so, I need to specify the default values to match wrap_socket(). 
But ssl_version's default isn't documented.

Is the reason to allow us to change the default in a bug fix release? If that's 
the case, I suggest creating a sentinel value, like ssl.DEFAULT_PROTOCOL, and 
have that be the documented default. Then I could declare my parameter as 
defaulting to ssl.DEFAULT_PROTOCOL, pass it in to ssl.wrap_socket(), and have 
it use the "current" default.

If that's a desirable solution, I'll happily write a patch. If so, it would 
just apply to 3.6, but if we just want to document the actual value of 
ssl_version, then it would apply to the versions I've selected.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 244742
nosy: docs@python, eric.smith
priority: low
severity: normal
status: open
title: Documentation for ssl.wrap_socket's ssl_version parameter is odd
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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

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

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

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

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

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

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

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

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


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

___
Python tracker 

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

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


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

___
Python tracker 

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

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

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

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

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