[issue10225] Fix doctest runable examples in python manual

2016-07-12 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +andymaier, belopolsky, docs@python, eric.araujo, ezio.melotti, 
georg.brandl, lukasz.langa, rhettinger, terry.reedy -lissacoffeyx

___
Python tracker 

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



[issue10225] Fix doctest runable examples in python manual

2016-07-12 Thread Berker Peksag

Changes by Berker Peksag :


--
Removed message: http://bugs.python.org/msg270297

___
Python tracker 

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



[issue10225] Fix doctest runable examples in python manual

2016-07-12 Thread lissacoffeyx

lissacoffeyx added the comment:

I had a thought that it made the template more readable, but the better 
solution was to just use real newlines instead of '\n'. 

Thanks
http://www.fixithere.net/sky-customer-service/

--
nosy: +lissacoffeyx -andymaier, belopolsky, docs@python, eric.araujo, 
ezio.melotti, georg.brandl, lukasz.langa, rhettinger, terry.reedy

___
Python tracker 

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



[issue25393] 'resource' module documentation error

2016-07-12 Thread Berker Peksag

Changes by Berker Peksag :


--
keywords: +easy
nosy: +berker.peksag
stage:  -> needs patch
type: enhancement -> behavior
versions: +Python 3.6

___
Python tracker 

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




[issue25548] Show the address in the repr for class objects

2016-07-12 Thread Kushal Das

Kushal Das added the comment:

The NEWS file got a typo. Thanks for noticing that.
This change did require a lot of updates to the tests.
If rest of the people agrees to revert this change, then we should go ahead and 
do it. Just wondering if Raymond has anything to add.

--

___
Python tracker 

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



[issue27498] Regression in repr() of class object

2016-07-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27449] pip install --upgrade pip (Windows)

2016-07-12 Thread frank-e

frank-e added the comment:

Thanks, worked, most likely an error on my side (command line window without 
admin rights).

--

___
Python tracker 

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



[issue27133] python 3.5.1 will not compile because libffi module uses wrong CFLAGS

2016-07-12 Thread Martin Panter

Martin Panter added the comment:

In the original report you mentioned a linker error caused by not using “-m64” 
from CFLAGS. Perhaps would it make more sense to add LDFLAGS=“-m64”, or use 
CC=“cc -m64” instead? There is also Issue 27490 and Issue 22981, both 
apparently about setting the ABI with CFLAGS.

--
nosy: +martin.panter

___
Python tracker 

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



[issue22981] Use CFLAGS when extracting multiarch

2016-07-12 Thread Martin Panter

Martin Panter added the comment:

Why do you set CFLAGS=-m32? When I cross-compile a 32-bit Python on a 64-bit 
host, I set CC="gcc -m32" instead. (Otherwise, I would have to specify 
LDFLAGS="-m32" as well.)

--
components: +Build
nosy: +martin.panter

___
Python tracker 

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



[issue27490] ARM cross-compile: pgen built without $(CFLAGS) as $(LIBRARY) dependency

2016-07-12 Thread Martin Panter

Martin Panter added the comment:

I don’t know the details of how Python uses CFLAGS etc, but according to 

 and 
,
 the general convention may be that CFLAGS and LDFLAGS are only for _compiler_ 
and _linker_ flags respectively, and CFLAGS may not be used for a link step.

Why don’t you either use CC="arm-none-eabi-gcc -mfloat-abi=hard", or 
LDFLAGS="-mfloat-abi=hard"? If these options work for you, perhaps what we 
really need is better documentation of how to build Python.

Ideally I would also like to make it so that compiling pgen is not necessary. 
But I think we can only use Gnu Make extensions if they are harmless in other 
operating systems (e.g. we have to keep the makefile compatible with BSD Make, 
though maybe it is okay to require Gnu Make for cross compiling).

In  I left some rambling thoughts 
on ways to make the file regeneration like pgen does less automatic and more up 
to the user to control.

--
nosy: +martin.panter

___
Python tracker 

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



[issue19027] undefined symbol: _PyParser_Grammar

2016-07-12 Thread Martin Panter

Martin Panter added the comment:

The same $(GRAMMAR_H) dependency and touch command still exists today, so I 
suspect this is still valid (though I didn’t try to reproduce it). I think we 
need to figure out if you can write a proper makefile rule that handles a 
single command that updates two targets at once.

FWIW I don’t think “make touch” will currently help on Python 2, because it 
only affects two files that are generated by pgen (see also my comment in Issue 
19142).

--
nosy: +martin.panter
stage:  -> needs patch

___
Python tracker 

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



[issue27504] Missing assertion methods in unittest documentation

2016-07-12 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> not a bug
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



[issue19142] Cross-compile fails trying to execute foreign pgen on build host

2016-07-12 Thread Martin Panter

Martin Panter added the comment:

Since 2.7.12 and 3.5.2, pgen should not be executed when in cross-compilation 
mode, thanks to Issue 22359 and Issue 22625. So I suspect the main problem is 
basically solved now.

Even though it should no longer be used, pgen is still cross-compiled depending 
on the timestamps and “make touch”. (Evidence: 
Issue 27490.)

My guess of why “make touch” did not work for Trevor was that he was compiling 
Python 2. In this case, “make touch” was added in revision da3f4774b939, and 
still only affects two files, neither of which are generated by pgen. Maybe 
Python 2’s “make touch” rule could be expanded for other generated files 
including Include/graminit.h etc.

--
nosy: +martin.panter
superseder:  -> When cross-compiling, don’t try to execute binaries

___
Python tracker 

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



[issue27504] Missing assertion methods in unittest documentation

2016-07-12 Thread Mitchell Model

Mitchell Model added the comment:

My strong apology. I missed a section of the documentation. It didn't seem 
possible that they weren't there, but I made a mistake when I checked for them. 
Sorry.

> On Jul 12, 2016, at 9:15 PM, R. David Murray  wrote:
> 
> 
> R. David Murray added the comment:
> 
> If you are looking at the source, you can look at the source.  If you are 
> looking at the documentation, we believe they are all documented.  If you use 
> pydoc/help, they are all documented.
> 
> I can't find the phrase you cite, but 'assert methods' is correct: all of the 
> method names start with the word 'assert'.
> 
> If there are specific methods you think are *not* in the library reference 
> that you think should be, please give examples.  I suspect they will turn out 
> to be internal helper functions.
> 
> --
> nosy: +r.david.murray
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue27487] -m switch regression in Python 3.5.2 (under rare circumstances)

2016-07-12 Thread Nick Coghlan

Nick Coghlan added the comment:

Oops, that PEP reference was meant to be PEP 451 (which added the __spec__ 
attribute and the concept of module specs as something distinct from the 
modules themselves)

--

___
Python tracker 

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



[issue27487] -m switch regression in Python 3.5.2 (under rare circumstances)

2016-07-12 Thread Nick Coghlan

Nick Coghlan added the comment:

Breaking down a few of the moving parts here:

* Yes, modules replacing themselves in sys.modules as a side effect of import 
is supported behaviour (it's why the import system looks them up by name in 
sys.modules as the final step, rather than just returning whatever the loader 
returns)

* the dependency on __spec__ attributes is actually in importlib, where 
following PEP 351 Brett has been pushing hard to ensure modules always have a 
__spec__ attribute so the rest of the import system (including, indirectly, 
runpy) can rely on having it available (however, as seen here, not everything 
in sys.modules is going to be a module, so we may need to either keep more of 
the workarounds that help tolerate folks breaking that assumption, or else find 
a way to try to enforce it even for custom objects)

* explicitly copying __spec__ from the original module object to the 
replacement object (in Wolfgang's code) should indeed be enough to get the use 
case reported here restored to the way it behaved in 3.5.1

--

___
Python tracker 

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



[issue27505] Missing documentation for setting module __class__ attribute

2016-07-12 Thread Nick Coghlan

Changes by Nick Coghlan :


--
dependencies: +Improved handling of __class__ assignment

___
Python tracker 

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



[issue22986] Improved handling of __class__ assignment

2016-07-12 Thread Nick Coghlan

Nick Coghlan added the comment:

Just noting I filed http://bugs.python.org/issue27505 regarding the lack of 
documentation for the new-in-Python-3.5 ability to set module __class__ 
attributes.

--

___
Python tracker 

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



[issue27505] Missing documentation for setting module __class__ attribute

2016-07-12 Thread Nick Coghlan

New submission from Nick Coghlan:

Python 3.5 added the ability to set module __class__ attributes by way of 
http://bugs.python.org/issue22986

However, this isn't covered in the What's New guide or anywhere else in the 
documentation, and even in the NEWS file it appears under the cryptic title 
"Issue #22986: Allow changing an object’s __class__ between a dynamic type and 
static type in some cases." for 3.5.0a1

This should be documented somewhere (perhaps in the data model section of the 
language reference?) and an example given of using the feature to emit 
DeprecationWarning for access to a particular module level attribute.

It should also be mentioned in the Python 3.5 What's New documentation.

--
assignee: docs@python
components: Documentation
messages: 270285
nosy: docs@python, ncoghlan, njs
priority: normal
severity: normal
stage: needs patch
status: open
title: Missing documentation for setting module __class__ attribute
type: enhancement
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



[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-12 Thread R. David Murray

R. David Murray added the comment:

How about this: rename the existing readmailcapfile as an internal 
_readmailcapfile with the new signature.  Then add a backward compatible 
readmailcapfile with the existing signature/return value that uses a dummy 
value for lineno and throws away the lineno on output.  The point here is just 
to avoid breaking programs that are using the existing api, even though it is 
an internal one.  Yes, it is cruft, but backward compatibility sometimes 
requires cruft.  We could deprecate the old api with a message that says it is 
an internal method and should not be used, and see if anyone complains about it 
being deprecated.

--

___
Python tracker 

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



[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-12 Thread Michael Lazar

Michael Lazar added the comment:

I can certainly do that. Although in addition to adding a keyword argument, we 
would also have to change the return signature to switch between modes like 
this:

if lineno is None:
return caps
else:
return caps, lineno

Overall I'm not a fan of this technique and would like to avoid it if possible. 
The problem is that we have to keep track of the current line between 
successive calls to readmailcapfile(). An alternative would be to go back to 
using lineno as a generator. This is close to what I had in the initial patch.

lineno = itertools.count()
caps = readmailcapfile(fp, lineno=lineno)
caps = readmailcapfile(fp2, lineno=lineno)
caps = readmailcapfile(fp3, lineno=lineno)
...etc

Happy to hear any insights you have on this.

--

___
Python tracker 

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



[issue27504] Missing assertion methods in unittest documentation

2016-07-12 Thread R. David Murray

R. David Murray added the comment:

If you are looking at the source, you can look at the source.  If you are 
looking at the documentation, we believe they are all documented.  If you use 
pydoc/help, they are all documented.

I can't find the phrase you cite, but 'assert methods' is correct: all of the 
method names start with the word 'assert'.

If there are specific methods you think are *not* in the library reference that 
you think should be, please give examples.  I suspect they will turn out to be 
internal helper functions.

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



[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-07-12 Thread Demur Rumed

Demur Rumed added the comment:

Benchmarked f'X is {x}' with BUILD_TUPLE change:

Before: 6.62 usec per loop
After: 6.33 usec per loop

f'X is {x} {x+2} {x+3}'
Before: 15.1 usec per loop
After: 14.7 usec per loop

Attached patch

--
keywords: +patch
Added file: http://bugs.python.org/file43701/fstrtup.patch

___
Python tracker 

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



[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-07-12 Thread Demur Rumed

Demur Rumed added the comment:

The simplest perf fix is to first use BUILD_TUPLE instead of BUILD_LIST

timeit 'x=1;(x,x,x)'
0.36 usec per loop

timeit 'x=1;[x,x,x]'
0.425 usec per loop

Introducing a new opcode BUILD_STRING to inline PyTuple_New + PyUnicode_Join to 
replace BUILD_TUPLE + CALL_FUNCTION should benchmark against BUILD_TUPLE 
version, not BUILD_LIST + CALL_FUNCTION

--

___
Python tracker 

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



[issue27504] Missing assertion methods in unittest documentation

2016-07-12 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +ezio.melotti, michael.foord, rbcollins
versions: +Python 3.6 -Python 3.2, 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



[issue27487] -m switch regression in Python 3.5.2 (under rare circumstances)

2016-07-12 Thread Martin Panter

Martin Panter added the comment:

In trying to understand this, I built a package with two simple files:

$ cat package/*.py
# package/__init__.py:
from . import module
# package/module.py:
import sys
sys.modules[__name__] = object()

With this I can reproduce your __spec__ error, and I see it works without error 
in 3.5.0 and 2.7.11. FWIW, with the current 3.3 branch, I get a different error:

/media/disk/home/proj/python/cpython/python: Error while finding loader for 
'package.module' (: 'object' object has no attribute 
'__loader__')

The revision that causes the regression is 3202d143a194. Since I made that 
change, I feel responsible for it. But I don’t have much time ATM to come up 
with an ideal solution. One quick solution would be to revert my change, but 
since this is an obscure use case, I am not enthusiastic about doing that :)

Is it possible to set the __spec__ attribute to work around the problem? I 
don’t really understand the “module spec” business, but “runpy” seems to rely 
on that attribute. Is replacing sys.modules entries like this even supported 
usage?

Even in 3.5.0, I can still produce the error by importing the package before 
using runpy:

$ python3.5 -c 'import runpy, package; runpy.run_module("package.module")'
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 104, in _get_module_details
spec = importlib.util.find_spec(mod_name)
  File "/usr/lib/python3.5/importlib/util.py", line 99, in find_spec
raise ValueError('{}.__spec__ is not set'.format(name)) from None
ValueError: package.module.__spec__ is not set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/runpy.py", line 178, in run_module
mod_name, mod_spec, code = _get_module_details(mod_name)
  File "/usr/lib/python3.5/runpy.py", line 110, in _get_module_details
raise ImportError(msg.format(mod_name, type(ex), ex)) from ex
ImportError: Error while finding spec for 'package.module' (: package.module.__spec__ is not set)
[Exit 1]

Wolfgang: Do you want to propose a specific wording to add to the 
documentation? Maybe something like “runpy and the ‘python -m’ option require 
that after the module is imported, it should have a __spec__ attribute”. Where 
should this go? In the runpy, command line, and/or What’s New documentation?

FWIW, 2.7.11 gives an even stranger error; perhaps this is a different bug:

$ python2.7 -c 'import runpy, package.module; 
runpy.run_module("package.module")'
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/runpy.py", line 170, in run_module
mod_name, loader, code, fname = _get_module_details(mod_name)
  File "/usr/lib/python2.7/runpy.py", line 101, in _get_module_details
loader = get_loader(mod_name)
  File "/usr/lib/python2.7/pkgutil.py", line 464, in get_loader
return find_loader(fullname)
  File "/usr/lib/python2.7/pkgutil.py", line 474, in find_loader
for importer in iter_importers(fullname):
  File "/usr/lib/python2.7/pkgutil.py", line 424, in iter_importers
if fullname.startswith('.'):
AttributeError: 'object' object has no attribute 'startswith'
[Exit 1]

--
versions: +Python 3.6

___
Python tracker 

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



[issue27504] Missing assertion methods in unittest documentation

2016-07-12 Thread Mitchell Model

New submission from Mitchell Model:

In looking at the source for unittest.TestCase I was very surprised to see 
quite a few assertion methods that are not included in the module 
documentation. Every available assertion method should be included in the 
library documentation. Users should not have to look at the source to see 
what's available — in fact, why would it even occur to the typical user to do 
that?

Also, I think the phrase "provides several assert methods to check for and 
report failures" is an understatement — it provides MANY assert methods.

I think "assertion method" is a better term than "assert method".

--
assignee: docs@python
components: Documentation
messages: 270278
nosy: MLModel, docs@python
priority: normal
severity: normal
status: open
title: Missing assertion methods in unittest documentation
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue27503] support RUSAGE_THREAD as a constant in the resource module

2016-07-12 Thread R. David Murray

R. David Murray added the comment:

Enhancements only go into the next feature release, which is what happened.

--
nosy: +r.david.murray
resolution:  -> not a bug
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



[issue27497] csv module: Add return value to DictWriter.writeheader

2016-07-12 Thread R. David Murray

R. David Murray added the comment:

It isn't documented that writer.writeline returns anything, but what it 
actually returns is whatever the write method of the underlying file object 
returns.  Obviously (given the linked example), this fact is being used.  There 
is value in consistency, so I think we should make this change.

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



[issue27498] Regression in repr() of class object

2016-07-12 Thread Ned Deily

Changes by Ned Deily :


--
priority: normal -> release blocker

___
Python tracker 

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



[issue27503] support RUSAGE_THREAD as a constant in the resource module

2016-07-12 Thread Maxim Sobolev

New submission from Maxim Sobolev:

This is duplicate of the #10440, which has been added in 2010 into 3.x but 
never merged.

--
files: patch-Modules_resource.c
messages: 270275
nosy: Maxim Sobolev
priority: normal
severity: normal
status: open
title: support RUSAGE_THREAD as a constant in the resource module
type: enhancement
versions: Python 2.7
Added file: http://bugs.python.org/file43700/patch-Modules_resource.c

___
Python tracker 

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



[issue26446] Mention in the devguide that core dev stuff falls under the PSF CoC

2016-07-12 Thread Brett Cannon

Brett Cannon added the comment:

I figured Berker was/had when he did the review, but I can take care of it when 
I get around to it (prioritizing 3.6 features ATM).

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-12 Thread Yury Selivanov

Yury Selivanov added the comment:

Let's keep this issue open until we have the docs updated.

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3e44c449433a by Yury Selivanov in branch '3.5':
Issue #27392: Add loop.connect_accepted_socket().
https://hg.python.org/cpython/rev/3e44c449433a

New changeset 2f0716009132 by Yury Selivanov in branch 'default':
Merge 3.5 (issue #27392)
https://hg.python.org/cpython/rev/2f0716009132

--
nosy: +python-dev

___
Python tracker 

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



[issue27180] Doc/pathlib: Please describe the behaviour of Path().rename() is depends on the platform (same as os.rename())

2016-07-12 Thread STINNER Victor

STINNER Victor added the comment:

patch27180. LGTM.

--
nosy: +haypo

___
Python tracker 

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



[issue26446] Mention in the devguide that core dev stuff falls under the PSF CoC

2016-07-12 Thread STINNER Victor

STINNER Victor added the comment:

Brett: "Thanks for the patch, Evelyn! The latest one LGTM and I will commit it 
when I have time."

Ok, so are you going to push it?

--
nosy: +haypo

___
Python tracker 

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



[issue8538] Add FlagAction to argparse

2016-07-12 Thread STINNER Victor

STINNER Victor added the comment:

I'm sorry but there is no activity since 4 years, so I guess that the feature 
is not common enough to require a builtin support in argparse.

--
nosy: +haypo
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue27497] csv module: Add return value to DictWriter.writeheader

2016-07-12 Thread STINNER Victor

STINNER Victor added the comment:

It doesn't seem right to me.

The writer should be blocking: write *all* data, don't use partial write.

Supporting partial write (non-blocking files) requires more changes, and it 
isn't worth it.

Here the problem is that the function doesn't support partial write. Each time, 
it tries to write the full content.

What is your use case?

--
nosy: +haypo

___
Python tracker 

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



[issue27498] Regression in repr() of class object

2016-07-12 Thread Tim Graham

Changes by Tim Graham :


--
nosy: +Tim.Graham

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2016-07-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
Removed message: http://bugs.python.org/msg270265

___
Python tracker 

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



[issue27502] Python -m Module Vulnerable to Buffer Over Flow.

2016-07-12 Thread R. David Murray

R. David Murray added the comment:

Your screenshots don't show any evidence of a crash.  I don't see any buffer 
overflow here, just normal python error messages.

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



[issue15443] datetime module has no support for nanoseconds

2016-07-12 Thread Steve Holden

Steve Holden added the comment:

Just wanted to add a couple of comments here in case there's any interest. In 
our missions to make the world's market data available we deal with financial 
exchanges, many of whom are already recording event data at nanosecond 
resolution.

Further, I believe the decision to use a separate nanoseconds field to be 
essentially correct. While  it may well introduce some arithmetical complexity 
its value in backwards compatibility should be regarded as paramount. If I 
understand it correctly, the new nanosecond resolution times would continue to 
be correctly handled (module loss of nanosecond resolution) when handled as 
current microsecond date-times.

--

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2016-07-12 Thread Steve Holden

Steve Holden added the comment:

Just wanted to add a couple of comments here in case there's any interest. In 
our missions to make the world's market data available we deal with financial 
exchanges, many of whom are already recording event data at nanosecond 
resolution.

Further, I believe the decision to use a separate nanoseconds field to be 
essentially correct. While  it may well introduce some arithmetical complexity 
its value in backwards compatibility should be regarded as paramount. If I 
understand it correctly, the new nanosecond resolution times would continue to 
be correctly handled (module loss of nanosecond resolution) when handled as 
current microsecond date-times.

--
nosy: +holdenweb

___
Python tracker 

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



[issue27415] regression: BaseEventLoop.create_server does not accept port=None

2016-07-12 Thread Marcus Cobden

Changes by Marcus Cobden :


--
title: BaseEventLoop.create_server does not accept port=None -> regression: 
BaseEventLoop.create_server does not accept port=None

___
Python tracker 

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



[issue27502] Python -m Module Vulnerable to Buffer Over Flow.

2016-07-12 Thread Dhiraj

New submission from Dhiraj:

Hello Sir ,

The Module of Python " -m SimpleHTTPServer " is vulnerable to Buffer Over Flow.
Step :
I have prepared a python script which is sending more than 5000+ Values to the 
Module in GET Method , and as soon as , I run that Script , the Python -m 
SimpleHTTPServer  which is running on the Victim's system Generator’s a huge 
Line or Error where as Exception handling is not done Proper , as if the Server 
do not get crash ,  but if the fuzzing script is run again and again it gets 
Crashed , and Buffer Over Flow is been Taken place.
In our Scenario Kali Linux machine is victims system running the server module 
and Linux Mint is sending the fuzzing script.

Please have a look on the POC below.
I ll be happy to hear from the team.
Thank You

--
files: POC-Python.zip
messages: 270264
nosy: DhirajMishra
priority: normal
severity: normal
status: open
title: Python -m Module Vulnerable to Buffer Over Flow.
type: security
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file43699/POC-Python.zip

___
Python tracker 

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



[issue27498] Regression in repr() of class object

2016-07-12 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +kushal.das

___
Python tracker 

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



[issue27500] ProactorEventLoop cannot open connection to ::1

2016-07-12 Thread Sebastien Bourdeauducq

Sebastien Bourdeauducq added the comment:

The first offending commit is this one:
https://github.com/python/cpython/commit/03df54d549173e17e1cf9a767199de32a363aa6b

more specifically "return af, type, proto, '', (host, port)". For IPv6, it 
should be "(host, port, flow info, scope id)" instead of just "(host, port)".

--

___
Python tracker 

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



[issue25548] Show the address in the repr for class objects

2016-07-12 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm also echoing this... It breaks too many tests. I filed issue27498.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue27501] Create a collections.abc class that describes PEP 3118 buffer

2016-07-12 Thread Daniel Moisset

Changes by Daniel Moisset :


--
components: +Library (Lib)
type:  -> enhancement

___
Python tracker 

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



[issue27501] Create a collections.abc class that describes PEP 3118 buffer

2016-07-12 Thread Daniel Moisset

New submission from Daniel Moisset:

The buffer protocol is a low level C protocol, but even if it doesn't expose a 
specific python API, it's currently not possible to say "this object implements 
the buffer protocol" in Python

This might be useful for some applications, including PEP-484 typing hints. It 
would be useful to have a collections.abc.Buffer which already registers the 
types that already support the protocol (bytes, strings, array.array, struct, 
mmap, ctype arrays/pointers, etc)

--
messages: 270261
nosy: Daniel Moisset
priority: normal
severity: normal
status: open
title: Create a collections.abc class that describes PEP 3118 buffer

___
Python tracker 

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



[issue27499] PY_SSIZE_T_CLEAN conflicts with Py_LIMITED_API

2016-07-12 Thread Daniel Holth

Daniel Holth added the comment:

Oh, I can avoid this problem by setting Py_LIMITED_API to 0x3030 or greater.

--

___
Python tracker 

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



[issue27498] Regression in repr() of class object

2016-07-12 Thread Ethan Furman

Ethan Furman added the comment:

This change was done in issue25548.

--
nosy: +ethan.furman

___
Python tracker 

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



[issue27500] ProactorEventLoop cannot open connection to ::1

2016-07-12 Thread Sebastien Bourdeauducq

New submission from Sebastien Bourdeauducq:

The following code fails with "OSError: [WinError 10022] An invalid argument 
was supplied".

import asyncio
loop = asyncio.ProactorEventLoop()
asyncio.set_event_loop(loop)
loop.run_until_complete(asyncio.open_connection("::1", 4242))

This is a regression in 3.5.2. 3.5.1 does not have this bug. Connecting to 
127.0.0.1 does not cause the problem.

--
components: asyncio
messages: 270258
nosy: gvanrossum, haypo, sebastien.bourdeauducq, yselivanov
priority: normal
severity: normal
status: open
title: ProactorEventLoop cannot open connection to ::1
versions: Python 3.5

___
Python tracker 

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



[issue27285] Document the deprecation of pyvenv in favor of `python3 -m venv`

2016-07-12 Thread Steve Piercy

Steve Piercy added the comment:

Thanks, Ned. This was my first hg patch. I'm learning.

--

___
Python tracker 

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



[issue27496] unicodedata.name() doesn't have names for control characters

2016-07-12 Thread Eryk Sun

Changes by Eryk Sun :


--
versions: +Python 2.7, Python 3.6

___
Python tracker 

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



[issue27496] unicodedata.name() doesn't have names for control characters

2016-07-12 Thread Eryk Sun

Changes by Eryk Sun :


--
components: +Unicode
nosy: +ezio.melotti, haypo

___
Python tracker 

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



[issue27499] PY_SSIZE_T_CLEAN conflicts with Py_LIMITED_API

2016-07-12 Thread Daniel Holth

Daniel Holth added the comment:

Here it is. 
https://mail.python.org/pipermail/python-3000/2008-November/015344.html

On Sat, Nov 22, 2008 at 06:29, Barry Warsaw  wrote:
>
> On Nov 22, 2008, at 4:05 AM, Martin v. Löwis wrote:
>
>> I just noticed that the Python 3 C API still contains PY_SSIZE_T_CLEAN.
>>
>> This macro was a transition mechanism, to allow extensions to use
>> Py_ssize_t in PyArg_ParseTuple, while allowing other module continue
>> to use int.
>>
>> In Python 3, I would like the mechanism, making Py_ssize_t the only
>> valid data type for size in, say, s# parsers.
>>
>> Is it ok to still change that?
>
> Given that we just released the last planned candidate, I'd say it was too
> late to change this for Python 3.0.
>

But we can at least document that the macro is a gone as soon as 3.0
final is out the door.

-Brett

--

___
Python tracker 

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



[issue27498] Regression in repr() of class object

2016-07-12 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +rhettinger

___
Python tracker 

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



[issue27499] PY_SSIZE_T_CLEAN conflicts with Py_LIMITED_API

2016-07-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

First we should make PY_SSIZE_T_CLEAN mandatory for the term of at least two 
releases (or to the end of 2.7 support).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27496] unicodedata.name() doesn't have names for control characters

2016-07-12 Thread Zack Weinberg

Zack Weinberg added the comment:

It looks to me as if NameAliases.txt is the better reference for the C0 and C1 
controls.  It matches the UnicodeData.txt field 10 names for most entries where 
the field 1 name is "", but it has names for U+0080, U+0081, U+0084, 
and U+0099, which have no field 10 name.  The only catch is that NameAliases 
may have *several* names for the same character, with the same category tag, 
e.g.

0009;CHARACTER TABULATION;control
0009;HORIZONTAL TABULATION;control

It probably makes sense to consistently use the first listed.

--

___
Python tracker 

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



[issue27485] urllib.splitport -- is it official or not?

2016-07-12 Thread Brett Cannon

Brett Cannon added the comment:

Probably a rename is good. Question then becomes whether the old names should 
raise an DeprecationWarning for a release?

--
nosy: +brett.cannon

___
Python tracker 

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



[issue27498] Regression in repr() of class object

2016-07-12 Thread Guido van Rossum

New submission from Guido van Rossum:

In Python 3.6, the repr() of a class includes its memory address.

This is going to cause a lot of problems for tests in 3rd party code that 
expects the nice and clean  instead of .

I understand the desire to provide more clarity in case somehow two class 
objects created at different times have the same name -- but I'm not sure I 
like to rub the hex address in the user's face all the time.

Can we please roll this back or think about a better way to reveal this that 
won't break so many 3rd party tests?

--
messages: 270251
nosy: gvanrossum
priority: normal
severity: normal
status: open
title: Regression in repr() of class object
versions: Python 3.6

___
Python tracker 

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



[issue27499] PY_SSIZE_T_CLEAN conflicts with Py_LIMITED_API

2016-07-12 Thread Daniel Holth

New submission from Daniel Holth:

When compiling my cryptacular extension 
https://bitbucket.org/dholth/cryptacular I noticed -DPy_LIMITED_API 
-DPY_SSIZE_T_CLEAN creates a binary that does not actually use the limited api. 
This causes segfaults on Linux but does not appear to cause problems on Windows.

I found some emails suggestid PY_SSIZE_T_CLEAN was supposed to go away entirely?

--
components: Extension Modules
messages: 270252
nosy: dholth
priority: normal
severity: normal
status: open
title: PY_SSIZE_T_CLEAN conflicts with Py_LIMITED_API
versions: Python 3.5

___
Python tracker 

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



[issue27497] csv module: Add return value to DictWriter.writeheader

2016-07-12 Thread Zachary Ware

Zachary Ware added the comment:

This seems like a reasonable request, but could only be done in 3.6 as it would 
be a new feature.

--
keywords: +easy
nosy: +zach.ware
stage:  -> needs patch
versions:  -Python 3.5

___
Python tracker 

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



[issue27492] Enhance bytearray_repr with bytes_repr's logic

2016-07-12 Thread Xiang Zhang

Xiang Zhang added the comment:

I considered that too. But I was not sure what code could go into 
bytes_methods.c then, Python level methods, all common parts or only 
tp->methods? I'll try to factor the common part out later.

--

___
Python tracker 

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



[issue27497] csv module: Add return value to DictWriter.writeheader

2016-07-12 Thread Logan

New submission from Logan:

Currently, DictWriter.writeheader() is defined like:

def writeheader(self):
header = dict(zip(self.fieldnames, self.fieldnames))
self.writerow(header)

It would be useful to have it return the value of writerow():

def writeheader(self):
header = dict(zip(self.fieldnames, self.fieldnames))
return self.writerow(header)

This would useful because:
1) It would match the behavior of DictWriter.writerow
2) It would enable DictWriter.writeheader to be used in within a generator 
function (ala 
https://docs.djangoproject.com/en/1.9/howto/outputting-csv/#streaming-large-csv-files)

--
messages: 270248
nosy: lsowen
priority: normal
severity: normal
status: open
title: csv module: Add return value to DictWriter.writeheader
type: enhancement
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



[issue27496] unicodedata.name() doesn't have names for control characters

2016-07-12 Thread Eryk Sun

Eryk Sun added the comment:

Character names are in field 1 of UnicodeData.txt [1][2]. For controls the name 
is just "". In Tools/unicode/makunicodedata.py, the makeunicodename 
function skips names that start with "<". Instead of skipping the character, it 
could fall back on the Unicode 1.0 name (field 10), if it's defined. For 
controls, this is the ISO 6429 name:

(10) Old name as published in Unicode 1.0 or ISO 6429 names 
for control functions. This field is empty unless it is 
significantly different from the current name for the 
character. No longer used in code chart production. See 
Name_Alias. 

The names of control characters are also in NameAliases.txt, which gets 
processed as the unicode.aliases list of (name, char) tuples.

[1]: http://www.unicode.org/reports/tr44/#UnicodeData.txt
[2]: http://www.unicode.org/Public/8.0.0/ucd

--
nosy: +eryksun

___
Python tracker 

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



[issue27495] Pretty printing sorting for set and frozenset instances

2016-07-12 Thread Fred L. Drake, Jr.

Fred L. Drake, Jr. added the comment:

+1

It could reasonably be argued that not sorting is a bug for already-released 
3.x versions.

--

___
Python tracker 

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



[issue27496] unicodedata.name() doesn't have names for control characters

2016-07-12 Thread R. David Murray

R. David Murray added the comment:

That information is programatically generated from data files obtained from the 
unicode project, as far as I know.

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



[issue27493] logging module fails with unclear error when supplied a (Posix)Path

2016-07-12 Thread R. David Murray

R. David Murray added the comment:

It will be interesting to see how much logging itself needs to be aware of PEP 
519 once the support is added to posixpath.  ideally, to meet the goals of PEP 
519, the answer would be "not at all".

@richard: python uses duck typing: if it quacks like a duck, pretend it is a 
duck.  That means that the code (generally, there are exceptions) doesn't check 
for types, but just handles the object the way it normally would until it fails 
to quack, at which point you get an exception.  Sometimes we add code to turn 
such exceptions into clearer error messages, when the existing error *hides* 
what is really going on.  This would not be one of those cases though, even if 
supporting Path wasn't on the long term agenda: the existing error tells you 
that the module expects it to act like a string (support startswith, and other 
string methods).

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



[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-12 Thread R. David Murray

R. David Murray added the comment:

I think we need to preserve backward compatibility in the readmailcapfile 
function even though it isn't technically a public API (make lineno a keyword 
argument and the behavior dependent on its presence).  I haven't experimented 
with the patch yet, but it looks reasonable.

--

___
Python tracker 

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



[issue27496] unicodedata.name() doesn't have names for control characters

2016-07-12 Thread Zack Weinberg

New submission from Zack Weinberg:

unicodedata.name() doesn't have name information for the C0 and C1 control 
characters.  To see this, run

pprint.pprint(["U+{:04X} {}".format(n, unicodedata.name(chr(n), "")) 
for n in range(256)])

and you will observe  printed for U+ through U+001F and U+007F 
through U+009F.  These characters do have official Unicode names and they 
should be known to name().

I may see if I can come up with a patch for this one, in my copious free time.

--
components: Library (Lib)
messages: 270242
nosy: zwol
priority: normal
severity: normal
status: open
title: unicodedata.name() doesn't have names for control characters
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue27492] Enhance bytearray_repr with bytes_repr's logic

2016-07-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Bytes and bytearray share a much of code. I think it is possible to share the 
implementation of reprs. Just add two functions in bytes_methods.c: one counts 
the size of the repr and determines the quote, and other writes the content of 
the repr in preallocated buffer.

--
versions:  -Python 3.5

___
Python tracker 

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



[issue27473] bytes_concat seems to check overflow using undefined behaviour

2016-07-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> closed

___
Python tracker 

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



[issue27473] bytes_concat seems to check overflow using undefined behaviour

2016-07-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved

___
Python tracker 

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



[issue27473] bytes_concat seems to check overflow using undefined behaviour

2016-07-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 130d97217e36 by Serhiy Storchaka in branch '2.7':
Issue #27473: Fixed possible integer overflow in str, unicode and bytearray
https://hg.python.org/cpython/rev/130d97217e36

--

___
Python tracker 

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



[issue27495] Pretty printing sorting for set and frozenset instances

2016-07-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +rhettinger, serhiy.storchaka
type: behavior -> enhancement
versions:  -Python 3.5

___
Python tracker 

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



[issue27495] Pretty printing sorting for set and frozenset instances

2016-07-12 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +fdrake
stage:  -> patch review
versions:  -Python 3.2, 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



[issue27493] logging module fails with unclear error when supplied a (Posix)Path

2016-07-12 Thread Vinay Sajip

Vinay Sajip added the comment:

> We could possibly add PEP 519 support to the logging module for Python 3.6

Seems like a reasonable enhancement for 3.6.

--
stage:  -> needs patch
type:  -> enhancement
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



[issue26988] Add AutoNumberedEnum to stdlib

2016-07-12 Thread John Hagen

John Hagen added the comment:

I like the addition of UniqueEnum.  It's the default use case often.

--

___
Python tracker 

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



[issue27495] Pretty printing sorting for set and frozenset instances

2016-07-12 Thread Danilo J. S. Bellini

New submission from Danilo J. S. Bellini:

The pprint pretty printer in Python 3 sorts sets/frozensets only if their 
length don't fit in one single line/row for the given width, else it was just 
leaving repr(my_set_instance) alone, like:

>>> import string, pprint
>>> pprint.pprint(set(string.digits))
{'7', '5', '2', '4', '1', '9', '6', '3', '0', '8'}

That order is quite random in Python 3.2+. But on Python 2.6 and 2.7, the 
result is shown as:
set(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'])

So for using pprint in doctests (or anything alike) with sets/frozensets, the 
pretty printer isn't as useful in Python 3 than it is in Python 2. The pprint 
tests for non-nested set/frozenset were only using some small ranges for 
testing. I've written a patch to solve that.

--
components: Library (Lib)
files: pprint_small_set_sorted.patch
keywords: patch
messages: 270237
nosy: danilo.bellini
priority: normal
severity: normal
status: open
title: Pretty printing sorting for set and frozenset instances
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file43698/pprint_small_set_sorted.patch

___
Python tracker 

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



[issue27494] 2to3 parser failure caused by a comma after a generator expression

2016-07-12 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

___
Python tracker 

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



[issue27494] 2to3 parser failure caused by a comma after a generator expression

2016-07-12 Thread Jakub Stasiak

New submission from Jakub Stasiak:

Test file (test.py):

print(set(x for x in range(2),))

Python runs it nicely:

% python2 test.py 
set([0, 1])
% python3 test.py
{0, 1}

2to3 parser (on both Python 2.7.11 and 3.5.2) chokes on it though:

% 
/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/bin/2to3
 test.py 
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Can't parse test.py: ParseError: bad input: type=8, 
value=u')', context=('', (1, 30))
RefactoringTool: No files need to be modified.
RefactoringTool: There was 1 error:
RefactoringTool: Can't parse test.py: ParseError: bad input: type=8, 
value=u')', context=('', (1, 30))

% 
/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/bin/2to3
 test.py 
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Can't parse test.py: ParseError: bad input: type=8, value=')', 
context=('', (1, 30))
RefactoringTool: No files need to be modified.
RefactoringTool: There was 1 error:
RefactoringTool: Can't parse test.py: ParseError: bad input: type=8, value=')', 
context=('', (1, 30))


For reference: https://github.com/smarkets/flake8-strict/issues/9 (project 
using lib2to3 parser)

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 270236
nosy: jstasiak
priority: normal
severity: normal
status: open
title: 2to3 parser failure caused by a comma after a generator expression
type: crash
versions: Python 2.7, Python 3.5

___
Python tracker 

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



[issue27493] logging module fails with unclear error when supplied a (Posix)Path

2016-07-12 Thread Richard

Richard added the comment:

Yeah, figured as much. But thanks:)

I'm kind of new to Python and was having some problems determining whether this 
is as it should be, or if it should be improved.
After all, I could not find any documentation that states what the permitted 
variable-types are (for pretty much any function, actually), yet print() does 
cast the Path()s to a string...

Kind of used to the documentation format on php.net :P

--

___
Python tracker 

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



[issue27493] logging module fails with unclear error when supplied a (Posix)Path

2016-07-12 Thread Berker Peksag

Berker Peksag added the comment:

logging module doesn't support Path objects. You need to wrap

STATUSLOG_PATH = Path('~/logFiles/Reseller/').expanduser()

with str().

We could possibly add PEP 519 support to the logging module for Python 3.6. 
What do you think, Vinay?

--
nosy: +berker.peksag, vinay.sajip

___
Python tracker 

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



[issue27493] logging module fails with unclear error when supplied a (Posix)Path

2016-07-12 Thread Richard

New submission from Richard:

No idea if I should be reporting this here, but it came with the default 
installation, so here goes:

On a mac, I supplied a basicConfig object to the logging class that contains a 
PosixPath instance for the "filename" attribute.
consequently, it fails with the error message "'PosixPath' object has no 
attribute 'startswith'" without specifying where the issue lies.

offending value:
STATUSLOG_PATH   = Path('~/logFiles/Reseller/').expanduser()

Relevant part of the traceback (which didn't print by default):
  File 
"/Users/rhendrikse/Documents/PythonScripts/Reseller/Reseller/application/application.py",
 line 41, in __setup_logger
logging.basicConfig(level=logging.DEBUG, format=DEFS.RUNLOG_FORMAT, 
filename=DEFS.RUNLOG_PATH)
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/__init__.py",
 line 1744, in basicConfig
h = FileHandler(filename, mode)
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/__init__.py",
 line 998, in __init__
self.baseFilename = os.path.abspath(filename)
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/posixpath.py", 
line 357, in abspath
if not isabs(path):
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/posixpath.py", 
line 64, in isabs
return s.startswith(sep)
AttributeError: 'PosixPath' object has no attribute 'startswith'

--
components: Library (Lib)
messages: 270233
nosy: rhendrikse
priority: normal
severity: normal
status: open
title: logging module fails with unclear error when supplied a (Posix)Path
versions: Python 3.5

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-07-12 Thread INADA Naoki

INADA Naoki added the comment:

> asyncio uses loop.create_future() to create sockets.  I'd suggest you to 
> create two base test classes: one that monkeypatches loop.create_future to 
> return pure python Future in its setUp method; an another, that makes 
> create_future to return a C version of the Future.

windows_events.py has some classes extends futures.Future.
Task extends Future.
There are some `isinstance(future, futures.Future)`.

So monkeypatching `baseevent.create_future` seems not enough.
I want a way to completely reload asyncio and test_asyncio packages with and 
without C future.

--

___
Python tracker 

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



[issue27492] Enhance bytearray_repr with bytes_repr's logic

2016-07-12 Thread Xiang Zhang

New submission from Xiang Zhang:

Right now bytearray_repr's implementation mimics old string_repr, but it has a 
drawback: It arbitrarily checks overflow using four times the bytearray 
object's length, but the representation length of the value can range from 1 to 
4. I think we can use bytes_repr's logic which calculates the actual output 
length.

--
components: Interpreter Core
files: bytearray_repr.patch
keywords: patch
messages: 270231
nosy: serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: Enhance bytearray_repr with bytes_repr's logic
type: enhancement
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file43697/bytearray_repr.patch

___
Python tracker 

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



[issue27481] Replace TypeError with ValueError in doc regarding "embedded NUL character"

2016-07-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: commit 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



[issue27481] Replace TypeError with ValueError in doc regarding "embedded NUL character"

2016-07-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 420030a5e854 by Serhiy Storchaka in branch '3.5':
Issue #27481: Docummented that ValueError is now raised instead of TypeError
https://hg.python.org/cpython/rev/420030a5e854

New changeset 00b9c734af87 by Serhiy Storchaka in branch 'default':
Issue #27481: Docummented that ValueError is now raised instead of TypeError
https://hg.python.org/cpython/rev/00b9c734af87

--
nosy: +python-dev

___
Python tracker 

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



[issue27481] Replace TypeError with ValueError in doc regarding "embedded NUL character"

2016-07-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. Thanks Xiang.

--

___
Python tracker 

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