[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-18 Thread Xiang Zhang

Xiang Zhang added the comment:

David, issue2466_ismount_py2.7_port.patch does the py2.7 port. I also back port 
other ismount test cases not existing in py2.7.

--
nosy: +xiang.zhang
Added file: http://bugs.python.org/file44145/issue2466_ismount_py2.7_port.patch

___
Python tracker 

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



[issue22021] shutil.make_archive() root_dir do not work

2016-08-18 Thread bananaapple

bananaapple added the comment:

Hello Berker Peksag,

1. For now, I realize the comment of David.

This is not a bug of make_archive() implementation.

However, I think documentation is not clear to understand at the first time 
reading it.

Maybe it should be rephrased.

2. Actually, what I am looking in this function is able to output the archive 
to another directory rather than current directory.

But, this functionality is not provided.

I think this functionality will be useful if implemented.

What do you think about this?

Thank you for your explaination.

--

___
Python tracker 

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



[issue22021] shutil.make_archive() root_dir do not work

2016-08-18 Thread Berker Peksag

Changes by Berker Peksag :


--
versions: +Python 3.5, Python 3.6 -Python 3.4

___
Python tracker 

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



[issue27598] Add SizedIterable to collections.abc and typing

2016-08-18 Thread Neil Girdhar

Neil Girdhar added the comment:

Great patch.  Shouldn't Sequence be a "Reversible, Collection"?

--

___
Python tracker 

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



[issue22021] shutil.make_archive() root_dir do not work

2016-08-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Agree with David, this is working as designed (and matching the behavior of say 
"tar -C"). But the documentation is not clear if not confusing.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue22021] shutil.make_archive() root_dir do not work

2016-08-18 Thread Berker Peksag

Berker Peksag added the comment:

Hi bananaapple, there are two things that need to be addressed:

1. We need to decide whether this is a bug in make_archive() implementation or 
not. See msg223572 and msg223668 for details. I personally agree with David's 
analysis in msg223668.

We can rephrase make_archive() documentation to clarify what root_dir exactly 
does.

2. If this is a bug in make_archive() implementation, we need to add a test 
case. You can take a look at Lib/test/test_shutil.py.

--
nosy: +berker.peksag

___
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-08-18 Thread Vedran Čačić

Vedran Čačić added the comment:

I don't think the problem is with (Auto)Enum at all. Problem is in a different 
place, and this is just a symptom.

Problem is that people make too many assumptions about `class` suite. Yes, type 
is default metaclass. But not every class should be constructed by type's rules 
- Python provides a very detailed and powerful mechanism for specifying a 
different set of rules, should you need it. This is what metaclass keyword 
argument should be all about. And that is the true reason why metaclass 
conflict is an issue: every metaclass is a DSL specification, and the same 
suite cannot be interpreted according to two different DSLs at the same time.

But since there's a widespread myth that users don't like to type, implementors 
use a trick, "class Spam(metaclass=SpamMeta): pass", and say to their users: 
"there, just inherit from Spam like you inherit from ordinary classes". That 
way, we spare them a few keystrokes, sparing them also of opportunity to learn 
that metaclasses _do_ change the semantics of what they see indented after the 
colon.

I wonder what Raymond's poll result would be if a normal way to write such code 
would expose the metaclass

class Color(metaclass=AutoEnum):
blue
yellow

? Raymond has many valid objections, but they all apply to "ordinary" classes, 
instances of type. Color is not an instance of type, or at least conceptually 
it isn't. type (as a metaclass in Python) means a blueprint, a way to construct 
new instances via __call__, and every instance of it has that behavior, some of 
which even customize it by defining __new__ and/or __init__. type is also 
special because its power of creation is transitive: its instances know how to 
produce their instances in almost the same way it does.

But nothing of it is mandatory, and in fact it just stands in the way when we 
try to define Enum (or singletons, or database models, or... whatever that is 
not really a Python type). We do inherit from type because it's easier, and 
then usurp and override its __call__ behavior to do something almost entirely 
different. (Don't you feel something is wrong when your __new__ method doesn't 
construct a new object at all?:) It's completely possible, but it's not the 
only way.

Maybe class is just too tainted a keyword. There was a thread on python-ideas, 
that we should have a new keyword, "make". "make m n(...)" would be a clearer 
way to write what's currently written "class n(..., metaclass=m)", with a much 
more prominent position for the metaclass, obviating the need for "just inherit 
from Spam" trick, and dissociating in people's minds the connections of 
arbitrary metaobjects with type. ("class" keyword could be just a shortcut for 
"make type" in that syntax.) But of course, a new keyword is probably too much 
to ask. (A mild effect can be gained by reusing keywords "class" and "from", 
but it looks much less nice.)

However, there is _another_ underused way metaclasses can communicate with the 
external world of users of their instances: keyword arguments. I wonder if 
Raymond's objections would be as strong if the autovivification was explicitly 
documented?

class Color(Enum, style='declarative'):
blue
yellow

Of course we can bikeshed about exact keyword argument names and values, but my 
point is that there is an unused communication channel for converting typical 
Python user's surprise "why does this code even work" into "hey, what does that 
style='declarative' mean?"

--
nosy: +veky

___
Python tracker 

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



[issue27598] Add SizedIterable to collections.abc and typing

2016-08-18 Thread Guido van Rossum

Guido van Rossum added the comment:

LGTM, but I'm on vacation through Monday.

--

___
Python tracker 

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



[issue22021] shutil.make_archive() root_dir do not work

2016-08-18 Thread bananaapple

bananaapple added the comment:

Or, Is there anything I could help?

I am glad to help fixing this issue.

--

___
Python tracker 

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



[issue22021] shutil.make_archive() root_dir do not work

2016-08-18 Thread bananaapple

bananaapple added the comment:

Sorry to bother.

But This patch is still not accepted.

I still suffer this issue.

Is anyone willing to review this patch?

Thanks

--
nosy: +bananaapple

___
Python tracker 

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



[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2016-08-18 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dd0f1fa809c5 by R David Murray in branch 'default':
Rewrap long lines in Misc/NEWS.
https://hg.python.org/cpython/rev/dd0f1fa809c5

--

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-18 Thread R. David Murray

R. David Murray added the comment:

Thanks, Robin.

The patch doesn't apply on 2.7.  I'll leave this open to see if anyone wants to 
do the 2.7 port.

--
nosy: +r.david.murray
stage: commit review -> needs patch
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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cbc78ca21977 by R David Murray in branch '3.5':
#2466: ismount now recognizes mount points user can't access.
https://hg.python.org/cpython/rev/cbc78ca21977

New changeset db9126139969 by R David Murray in branch 'default':
Merge: #2466: ismount now recognizes mount points user can't access.
https://hg.python.org/cpython/rev/db9126139969

--
nosy: +python-dev

___
Python tracker 

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



[issue27598] Add SizedIterable to collections.abc and typing

2016-08-18 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

I submit a simple solution in line with __subclasshook__ of other ABCs.
I added several tests, it looks like it is doing everything right.

Please review.

--
keywords: +patch
Added file: http://bugs.python.org/file44144/collection.diff

___
Python tracker 

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



[issue26944] android: test_posix fails

2016-08-18 Thread R. David Murray

Changes by R. David Murray :


--
stage: commit review -> patch review

___
Python tracker 

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



[issue26944] android: test_posix fails

2016-08-18 Thread R. David Murray

R. David Murray added the comment:

Haypo: we are testing that our function wrapper (getgroups) returns something 
that we can parse as matching the results from the 'id' command.  This gives us 
a much more meaningful test than just testing that getgroups returns 
*something*.  That is, we are testing that it returns integers, and that they 
"look right".

In that light, I propose an alternate patch.

--
nosy: +r.david.murray
Added file: http://bugs.python.org/file44143/test_getgroups_3.patch

___
Python tracker 

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



[issue27731] Opt-out of MAX_PATH on Windows 10

2016-08-18 Thread Eryk Sun

Eryk Sun added the comment:

> anything running under the python.exe will get it for free.

py.exe may as well get the manifest setting, but it's not critical. It isn't 
common to store scripts in deeply nested paths. The same goes for the distlib 
launchers that pip uses for entry points since they have to open themselves.

--
nosy: +eryksun, vinay.sajip

___
Python tracker 

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



[issue12713] argparse: allow abbreviation of sub commands by users

2016-08-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 97b28115bd08 by Vinay Sajip in branch 'default':
Closes #12713: Allowed abbreviation of subcommands in argparse.
https://hg.python.org/cpython/rev/97b28115bd08

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-08-18 Thread John Hagen

John Hagen added the comment:

Ethan, thank you so much for all of your work.  Looking forward to any future 
collaboration.

--

___
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-08-18 Thread Ethan Furman

Ethan Furman added the comment:

Thank you, Raymond, David, Barry, John, etc. for your feedback.

While I really like AutoEnum I can see that that much magic doesn't need to 
exist in the stdlib.

Unfortunately, the alternatives aren't very pretty, so I'll leave the 
AutoNumberEnum as a recipe in the docs, and not worry about an 'auto' special 
value.

For those that love AutoEnum, it will be in the aenum third-party package.

--
resolution: fixed -> rejected
stage: resolved -> 

___
Python tracker 

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



[issue27796] Expose DirEntry constructor

2016-08-18 Thread Brendan Moloney

New submission from Brendan Moloney:

As per a discussion on python-ideas [1], the consensus is that we should allow 
users to create a DirEntry object themselves. This would just take a path and 
call stat on it and cache the result of that stat call.

Nick Coghlan mentioned possibly allowing a pre-existing stat result to 
optionally be passed into the constructor [2].

[1] https://mail.python.org/pipermail/python-ideas/2016-August/041716.html
[2] https://mail.python.org/pipermail/python-ideas/2016-August/041713.html

--
messages: 273063
nosy: moloney
priority: normal
severity: normal
status: open
title: Expose DirEntry constructor
type: enhancement
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



[issue26689] Add `has_flag` method to `distutils.CCompiler`

2016-08-18 Thread Sylvain Corlay

Sylvain Corlay added the comment:

Any chance to get this in for 3.6?

--

___
Python tracker 

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



[issue27731] Opt-out of MAX_PATH on Windows 10

2016-08-18 Thread Steve Dower

Steve Dower added the comment:

> Will it apply to third-party C extensions loaded into Python?

Yes, anything running under the python.exe will get it for free.

(Non-standard entry points will need to add the flag themselves.)

--

___
Python tracker 

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



[issue25958] Implicit ABCs have no means of "anti-registration"

2016-08-18 Thread Guido van Rossum

Changes by Guido van Rossum :


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



[issue27731] Opt-out of MAX_PATH on Windows 10

2016-08-18 Thread STINNER Victor

STINNER Victor added the comment:

Steve Dower added the comment:
> No, the flag that we add to the binary is backwards compatible. Earlier
versions will just ignore it.

Cool.

--

___
Python tracker 

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



[issue26488] hashlib command line interface

2016-08-18 Thread STINNER Victor

STINNER Victor added the comment:

> There are so many existing tools that already do this I don't really see
why Python needs to become yet another one.  What is the value in doing
this?

Portability. You described UNIX. There is no such tool by default on
Windows for example (as Avid said).

--

___
Python tracker 

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



[issue13516] Gzip old log files in rotating handlers

2016-08-18 Thread Mark Grandi

Mark Grandi added the comment:

While I will say that is slightly easier than subclassing, it still requires a 
function, or a variation of that to be present in every project that wants to 
have a RotatingHandler + compression, and extra lines if you use 
logging.config.dictConfig, as you will need to reference an external function 
rather than just specifying the filename = *.gz

I don't see this this simple feature would add much maintainer overhead, as 
lzma.open, bz2.open and gz.open are all pretty simple to use and are all 
already in the stdlib

--

___
Python tracker 

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



[issue26984] int() can return not exact int instance

2016-08-18 Thread Mark Dickinson

Mark Dickinson added the comment:

> Could you please make a review Mark?

Sorry, Serhiy. I missed this. I've got some time off coming up, so I plan to 
look at this in the next few days.

--

___
Python tracker 

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



[issue26488] hashlib command line interface

2016-08-18 Thread Aviv Palivoda

Aviv Palivoda added the comment:

The use case that made me think about this feature was when I was working on a 
Windows PC and needed to calculate an md5 of a file. I agree that in a unix 
environment there are existing tools but on windows you usually don't have them.

--

___
Python tracker 

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



[issue26488] hashlib command line interface

2016-08-18 Thread Gregory P. Smith

Gregory P. Smith added the comment:

There are so many existing tools that already do this I don't really see why 
Python needs to become yet another one.  What is the value in doing this?

Just use the openssl command.  "openssl sha256 myfile"  Or any of the md5sum, 
sha1sum and other plethora of commands people also have installed.

Overall the change looks pretty good (i left a couple comments on the patch), 
i'm not going to object to it going in.  But I don't know why we're bothering.

--

___
Python tracker 

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



[issue27731] Opt-out of MAX_PATH on Windows 10

2016-08-18 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This is great! Will it apply to third-party C extensions loaded into Python?

--
nosy: +pitrou

___
Python tracker 

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



[issue25785] TimedRotatingFileHandler missing rotations

2016-08-18 Thread Vinay Sajip

Changes by Vinay Sajip :


--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue26488] hashlib command line interface

2016-08-18 Thread Aviv Palivoda

Aviv Palivoda added the comment:

Hi, is there anything more I need to do on this patch? If not do you think this 
can be added in 3.6?

--

___
Python tracker 

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



[issue24905] Allow incremental I/O to blobs in sqlite3

2016-08-18 Thread Aviv Palivoda

Aviv Palivoda added the comment:

Thanks for the review Serhiy. Attached is the updated patch after the changes.

--
Added file: http://bugs.python.org/file44142/blob2.patch

___
Python tracker 

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



[issue25958] Implicit ABCs have no means of "anti-registration"

2016-08-18 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

On my machine 8 tests are always skipped:
test_devpoll test_kqueue test_msilib test_ossaudiodev
test_startfile test_winreg test_winsound test_zipfile64
All others tests pass OK.

The main part of the work is by Andrew Barnert, I only introduced small changes 
due to previous changes in Reversible and few minor things in response to 
previous comments.

Guido, thank you for applying the patch!

--

___
Python tracker 

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



[issue13516] Gzip old log files in rotating handlers

2016-08-18 Thread Vinay Sajip

Vinay Sajip added the comment:

You don't need a subclass - you can specify your own function to do it, as in 
the cookbook example:

https://docs.python.org/3/howto/logging-cookbook.html#using-a-rotator-and-namer-to-customize-log-rotation-processing

--

___
Python tracker 

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



[issue13516] Gzip old log files in rotating handlers

2016-08-18 Thread Mark Grandi

Mark Grandi added the comment:

I just ran into this myself, and would challenge the notion that just because 
few people complain about the fact that built in compression isn't built in for 
logging handlers (such as TimedRotatingFileHandler), that it isn't a needed 
feature. This is such a common feature in pretty much everything that it would 
be nice to have it built in rather than having a custom RotatingHandler 
subclass that just compresses the logs and does nothing else in every project I 
work with.

While not python, i searched github for logback/slf4j (java logging framework) 
entries for their equivilent of TimedRotatingFileHandler and I found quite a 
few results:

https://github.com/search?utf8=%E2%9C%93=fileNamePattern%2F%3E*.gz+language%3AXML=Code=searchresults

you don't even have to change the API of it, it could act the same way as the 
tarfile module, where if the 'filename' argument ends in one of "bz2", "gz" or 
'xz" then it is compressed with that compression type, and if not, then it 
doesn't compress it (what it does now)

and, that is how logback/slf4j does it as well 
(http://logback.qos.ch/manual/appenders.html#fwrpFileNamePattern)

--
nosy: +markgrandi

___
Python tracker 

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



[issue25958] Implicit ABCs have no means of "anti-registration"

2016-08-18 Thread Guido van Rossum

Guido van Rossum added the comment:

Pushed, let's see what the buildbots say.

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

___
Python tracker 

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



[issue25958] Implicit ABCs have no means of "anti-registration"

2016-08-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 72b9f195569c by Guido van Rossum in branch 'default':
Anti-registration of various ABC methods.
https://hg.python.org/cpython/rev/72b9f195569c

--
nosy: +python-dev

___
Python tracker 

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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-08-18 Thread STINNER Victor

Changes by STINNER Victor :


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

___
Python tracker 

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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-08-18 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks for your work too! ;) I agree to close.

--

___
Python tracker 

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



[issue27587] Issues, reported by PVS-Studio static analyzer

2016-08-18 Thread STINNER Victor

STINNER Victor added the comment:

issue27587_pystate_addmodule_v2.diff LGTM.

--

___
Python tracker 

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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-08-18 Thread STINNER Victor

STINNER Victor added the comment:

Thanks Xiang Zhang. The fix is obvious and simple, but it wasn't easy to 
identify it ;-) I pushed the fix to Python 3.5 and default (3.6).

Python 2.7 doesn't crash, the bare "raise" statement raises the exception: 
TypeError('exceptions must be old-style classes or derived from BaseException, 
not NoneType',). I suggest to not touch Python 2.7 and close the issue.

--

___
Python tracker 

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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-08-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ba45fbb16499 by Victor Stinner in branch '3.5':
Fix SystemError in "raise" statement
https://hg.python.org/cpython/rev/ba45fbb16499

--
nosy: +python-dev

___
Python tracker 

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



[issue27792] bool % int has inconsistent return type.

2016-08-18 Thread Mark Dickinson

Mark Dickinson added the comment:

FWIW, I'd suggest not changing this in 3.5; only in 3.6. It's a fairly harmless 
bug that's been with us throughout the 3.x series so far (and even back into 
2.x, if you start looking at behaviour with subclasses of `long`).

--

___
Python tracker 

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



[issue25958] Implicit ABCs have no means of "anti-registration"

2016-08-18 Thread Guido van Rossum

Guido van Rossum added the comment:

The patch LGTM. Do all the tests pass? Who should be attributed in the commit 
message and the Misc/NEWS item?

--

___
Python tracker 

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



[issue27792] bool % int has inconsistent return type.

2016-08-18 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
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-08-18 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Ethan, the suggestion has come up several times about using a dummy value such 
as the empty tuple to do autonumbering, thus looking more Pythonic.  I'm not a 
huge fan of the empty tuple, and I'm still not sure whether we need this, but I 
wonder if it would be possible to not have a new base class, but to put the 
smarts in the value to which the enums were assigned.  E.g. is this possible (a 
separate question than whether it's good :):

from enum import Enum, auto

class Color(Enum):
red = auto
green = auto
blue = auto

Apologies if this has already been suggested; this tracker thread is too long 
to read the whole thing. :(

--

___
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-08-18 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Temporarily, marking this as open so that more people can see the new comments.

For John, I'm not sure what I can say that will help you.  The goal of the 
standard libraries modules is to provide tools the use language we have, not to 
invent a new language the isn't really Python or Pythonic.  In the absence of 
an "enum" keyword, you have a number of ways to work within the language.

In this case (wanting auto numbering but not caring what the values are), you 
already have several ways to do it.  I your issue is not where the use case is 
met; instead, you just don't like how their spelled (because it isn't exactly 
how it it looks in C).

This already works:  Animal = Enum('Animal', ['ant', 'bee', 'cat', 'dog']).  
This is very flexible and lets you read the constants from many possible 
sources.

If you're attracted to multiline input, that is already possible as well:

Animal = Enum('Animal', '''
ant
bee
cat
dog
''')

It is clear that you're bugged by writing Animal twice, but that is how Python 
normally works and it is a very minor nuisance (it only occurs once when the 
enum is defined).  Note, you already are rewriting "Animal" every time you use 
the enum value (presumably many times):  board_ark(Animal.ant, Animal.bee)

This whole feature request boils down to wanting a currently existing feature 
to be spelled a little differently, in a way that doesn't look like normal 
Python.  Elsewhere, we resisted the temptation to alter the language 
look-and-feel to accommodate small spelling tweaks for various modules (i.e. we 
pass in normal strings to the regex module even though that sometimes requires 
double escaping, we pass in the class name to namedtuples even though that uses 
the class name twice, the xpath notation in passed into XML tools as strings 
even though parts of it look like regular langauge, we don't abuse the | 
operator to link together chains of itertools, etc)

Since the enum module already provides one way to do it, I recommend that we 
stick with that one way.  Creating too many variants does not help users.  
Using the core language in odd ways also does not help users.

--
status: closed -> open

___
Python tracker 

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



[issue27598] Add SizedIterable to collections.abc and typing

2016-08-18 Thread Guido van Rossum

Guido van Rossum added the comment:

I thought about this some more. It won't work because when a class method
is called via super(), 'cls' is still set to the derived class (and in
general for class methods that's the right thing to do, just as it is for
regular methods that self is still the actual object). If you read my
previous long comment you'll understand that all the __subclasshook__
methods carefully return NotImplemented immediately if their 'cls' argument
is not the class where they are defined. So it won't work.

I also don't see the use case (you're not supposed to do this at home,
basically).

--

___
Python tracker 

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



[issue27598] Add SizedIterable to collections.abc and typing

2016-08-18 Thread Guido van Rossum

Guido van Rossum added the comment:

Why don't you give it a try? I'd be happy to review a patch from you.

--

___
Python tracker 

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



[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2016-08-18 Thread Antti Haapala

Antti Haapala added the comment:

Unfortunately it seems that it is not that straightforward. The descriptor 
object doesn't know the name of the property. The error is raised in 
`property_descr_set`. However the error itself can be propagated from setting 
another property.

--

___
Python tracker 

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



[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2016-08-18 Thread Emanuel Barry

Emanuel Barry added the comment:

The approach I'd take would be to change how {get,set,del}attr handle 
AttributeError; possibly by automatically filling in the information and giving 
a nicer error message. This would fix this as a side-effect (somewhat; some 
bits of code would need to change). How does that sound to core devs?

--
nosy: +ebarry

___
Python tracker 

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



[issue27795] Cygwin compile errors

2016-08-18 Thread R. David Murray

R. David Murray added the comment:

Yes, we know :(  There are a lot of issues in this tracker about mingw and 
cygwin.  If you can help review them, that would be fantastic.

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



[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2016-08-18 Thread R. David Murray

R. David Murray added the comment:

If someone submits a patch in time, we'd probably accept it.

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



[issue27793] Double underscore variables in module are mangled when used in class

2016-08-18 Thread R. David Murray

R. David Murray added the comment:

This is working as designed 
(https://docs.python.org/3/tutorial/classes.html#private-variables):

"This mangling is done without regard to the syntactic position of the 
identifier, as long as it occurs within the definition of a class."

If you want to advocate changing that you'll have to start a thread on 
python-ideas, but I don't think the benefit would be worth the cost.

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



[issue27795] Cygwin compile errors

2016-08-18 Thread Kaeptm Blaubaer

New submission from Kaeptm Blaubaer:

If I try to compile Python 3.5 with Cygwin, I get a lot of errors.

--
components: Build, Windows
messages: 273031
nosy: Kaeptm Blaubaer, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Cygwin compile errors
type: compile error
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



[issue27792] bool % int has inconsistent return type.

2016-08-18 Thread Mark Dickinson

Mark Dickinson added the comment:

Ah, it looks as though this is already fixed in master, and it's probably not 
worth fixing for 3.5. Closing.

--
status: open -> closed

___
Python tracker 

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



[issue27792] bool % int has inconsistent return type.

2016-08-18 Thread Mark Dickinson

Mark Dickinson added the comment:

Whoops; no, it's not fixed. 3.6 introduced a fast path that has the side-effect 
of fixing this issue for the `True % 2` case, but not for all cases:

>>> False % 2
False
>>> True % 2
1
>>> class MyInt(int): pass
... 
>>> type(MyInt(0) % 6)

>>> type(MyInt(1) % 6)


--
resolution: out of date -> 
status: closed -> open

___
Python tracker 

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



[issue27727] Update Tools/freeze to use .vcxproj files

2016-08-18 Thread Kaeptm Blaubaer

Kaeptm Blaubaer added the comment:

That's right, in checkextensions_win32.py a .vcxproj parsing algorithm must be 
added, and in extensions_win32.ini the values must be updated, for example the 
builtin extensions from .dsp to .vcxproj

--
versions: +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



[issue27792] bool % int has inconsistent return type.

2016-08-18 Thread Mark Dickinson

Changes by Mark Dickinson :


--
resolution:  -> out of date

___
Python tracker 

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



[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2016-08-18 Thread Antti Haapala

New submission from Antti Haapala:

Today we had an internal server error in production. I went to see the sentry 
logs for the error, and was dismayed: the error was `AttributeError: can't set 
attribute`, and the faulting line was `setattr(obj, attr, value)` that happens 
in a for-loop that uses computed properties coming from who knows.

Well, I quickly ruled out that it was because the code was trying to set a 
value to a read-only property descriptor, the only problem was to find out 
*which of all these read-only properties* was it trying to set:

Python 3.6.0a3+ (default, Aug 11 2016, 11:45:31) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo:
... @property
... def bar(self): pass
... 
>>> setattr(Foo(), 'bar', 42)
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: can't set attribute

Could we change this for Python 3.6 so that the message for this could include 
the name of the property just like `AttributeError: has no attribute 'baz'` 
does?

--
messages: 273027
nosy: ztane
priority: normal
severity: normal
status: open
title: setattr a read-only property; the AttributeError should show the 
attribute that failed
type: enhancement

___
Python tracker 

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



[issue27587] Issues, reported by PVS-Studio static analyzer

2016-08-18 Thread Berker Peksag

Berker Peksag added the comment:

Here is an updated patch.

--
Added file: 
http://bugs.python.org/file44141/issue27587_pystate_addmodule_v2.diff

___
Python tracker 

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



[issue27776] PEP 524: Make os.urandom() blocking on Linux

2016-08-18 Thread Nick Coghlan

Nick Coghlan added the comment:

I have a few requests for clarification and confirmation as review comments, 
but overall +1 from me.

(I'd still like a warning when we need to block in order to make life easier 
for system administrators attempting to debug any apparent system hangs, but as 
per the security-sig discussion, I can pursue that in a follow-up RFE and a 
separate patch, while this patch implements the PEP precisely as accepted)

--
nosy: +ncoghlan

___
Python tracker 

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



[issue27793] Double underscore variables in module are mangled when used in class

2016-08-18 Thread avraf

New submission from avraf:

import re

__no_spaces_pattern   = r'\S+'
__match_chars_until_space = re.compile(__no_spaces_pattern).match
__match_chars_from_last_space = re.compile(__no_spaces_pattern + '$').match

def __get_chars_until_space(name):
return __match_chars_until_space(name).group()

def __get_chars_from_last_space(name):
return __match_chars_from_last_space(name).group()

__random_unique_five_digit_number = 12345
__random_id_generator = lambda: __random_unique_five_digit_number


class Person(object):
def __init__(self, name):
self.name = name

@property
def first_name(self):
return __get_chars_until_space(self.name)

@property
def last_name(self):
return __get_chars_from_last_space(self.name)


I get this error when importing and running in another file.
It seems python mangles every occurrence of double underscores seen in a class. 
Even if the double underscores variable appears in the body of a method and 
belongs to the module.

This behavior is very unexpected.

Traceback (most recent call last):
  File "beef.py", line 5, in 
print bob.first_name
  File 
"/home/dude/style/static_private_methods/real_static_private_functions.py", 
line 22, in first_name
return __get_chars_until_space(self.name)
NameError: global name '_Person__get_chars_until_space' is not defined

--
messages: 273023
nosy: avraf
priority: normal
severity: normal
status: open
title: Double underscore variables in module are mangled when used in class
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue27778] PEP 524: Add os.getrandom()

2016-08-18 Thread Nick Coghlan

Nick Coghlan added the comment:

Given docs (with the Linux-only platform support disclaimer), +1 for this as an 
initial implementation.

Providing it on Solaris as well can be a separate patch, but it's less 
important there (since /dev/urandom and os.urandom() are already blocking APIs)

--
nosy: +ncoghlan

___
Python tracker 

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



[issue27573] code.interact() should print an exit message

2016-08-18 Thread Armin Rigo

Armin Rigo added the comment:

...ah, upon closer inspection, we don't use the ``interact()`` method anyway.  
We already copied and tweaked this method: one problem was that it gives no way 
to run without printing at least one '\n' of banner at the beginning.  Then a 
more important tweak was made when we added multiline input with `pyrepl` by 
default.  So feel free to ignore my request.

(Multiline input is great, btw, if you use the interactive Python a lot.  That 
would be a completely different patch---if I thought that there's a good chance 
of it not languishing forever on this bug tracker, which I honestly don't think 
is the case...)

--

___
Python tracker 

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



[issue27573] code.interact() should print an exit message

2016-08-18 Thread Armin Rigo

Armin Rigo added the comment:

I'm fine with `exitmsg`.  I guess it would be a flag (not `None` as you wrote), 
defaulting to `True`?

--

___
Python tracker 

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



[issue27792] bool % int has inconsistent return type.

2016-08-18 Thread Mark Dickinson

New submission from Mark Dickinson:

Seen on reddit [1]: 

>>> True % 1
0
>>> True % 2
True

I believe that we should be returning an int in both these cases; this looks 
like a longobject.c fast path gone wrong.

[1] 
https://www.reddit.com/r/learnpython/comments/4y5bh1/can_someone_explain_why_true_1_0_but_true_2_true/

--
messages: 273020
nosy: mark.dickinson
priority: normal
severity: normal
stage: needs patch
status: open
title: bool % int has inconsistent return type.
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



[issue26984] int() can return not exact int instance

2016-08-18 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee:  -> mark.dickinson

___
Python tracker 

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



[issue27573] code.interact() should print an exit message

2016-08-18 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On Thu, Aug 18, 2016 at 08:19:25AM +, Armin Rigo wrote:
> Can we make the exit message optional?

Sure. What API do you prefer? I'm thinking to just give interact() an 
optional "exitmsg" argument, similar to banner:

def interact(banner=None, readfunc=None, local=None, exitmsg=None):

and similar for InteractiveConsole.interact.

If you're happy with that, I should be able to get the change done over 
this coming weekend.

--

___
Python tracker 

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



[issue27744] Add AF_ALG (Linux Kernel crypto) to socket module

2016-08-18 Thread Christian Heimes

Christian Heimes added the comment:

Thanks for your review, Victor. I have addressed most of your remarks.

* algset() is now called sendmsg_afalg(). It behaves more like a specialized 
version of sendmsg() and can optionally handle an array of iovec.

* I had to add another variant of setsockopt that sends NULL, int instead of 
(char*)int, sizeof(int) to get the AEAD GCM tests working. AEAD expects 
ALG_SET_AEAD_AUTHSIZE as (NULL, taglen). algo.setsockopt(SOL_ALG, 
ALG_SET_AEAD_AUTHSIZE, (None, taglen)) sends optval=NULL, optlen=taglen.

* Added tests for AES-CBC decryption, AEAD AES-GCM and DRBG.

--
Added file: 
http://bugs.python.org/file44140/AF_ALG-kernel-crypto-support-for-socket-module-1.patch

___
Python tracker 

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



[issue27746] ResourceWarnings in test_asyncio

2016-08-18 Thread Xiang Zhang

Xiang Zhang added the comment:

>From my observations, this is due to transport is forgotten to close in 
>test_connect_accepted_socket. Upload a patch to add the close function.

--
keywords: +patch
nosy: +xiang.zhang
Added file: http://bugs.python.org/file44139/issue27746.patch

___
Python tracker 

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



[issue27573] code.interact() should print an exit message

2016-08-18 Thread Armin Rigo

Armin Rigo added the comment:

Can we make the exit message optional?  Otherwise PyPy will need to patch 
code.py to add the option to not display this message when used as the normal 
REPL (yes, PyPy uses the plain code.py as its built-in REPL).

--
nosy: +arigo

___
Python tracker 

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



[issue27749] multprocessing errors on Windows: WriteFile() argument 1 must be int, not None; OSError: handle is closed

2016-08-18 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +davin

___
Python tracker 

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



[issue16764] Make zlib accept keyword-arguments

2016-08-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Serhiy, the message added in Misc/NEWS should be in Library section not Core 
> and Builtins section.

Done. And addressed Victor's reasonable comment. Thanks!

--

___
Python tracker 

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



[issue27506] make bytes/bytearray translate's delete a keyword argument

2016-08-18 Thread Xiang Zhang

Xiang Zhang added the comment:

Martin, I write the v3 patch to apply the comments. It preserves *table* as 
mandatory and move the test_translate to BaseBytesTest to remove duplicates.

--
title: make bytes/bytearray delete a keyword argument -> make bytes/bytearray 
translate's delete a keyword argument
Added file: 
http://bugs.python.org/file44138/bytes_translate_delete_as_keyword_arguments_v3.patch

___
Python tracker 

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



[issue16764] Make zlib accept keyword-arguments

2016-08-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ab0039b8a80e by Serhiy Storchaka in branch 'default':
Issue #16764: Move NEWS entry to correct section and remove too strict test.
https://hg.python.org/cpython/rev/ab0039b8a80e

--

___
Python tracker 

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



[issue27598] Add SizedIterable to collections.abc and typing

2016-08-18 Thread Neil Girdhar

Neil Girdhar added the comment:

@gvanrossum is there any reason that subclasshook is implemented by overriding 
instead of cooperation?  E.g.,:

class Sized(metaclass=ABCMeta):

@classmethod
def __subclasshook__(cls, C):
return (super().__subclasshook__(C) and 
any("__len__" in B.__dict__ for B in C.__mro__))


etc.  And then Collection does not need to implement subclasshook since its 
base classes cooperate?

--
nosy: +neil.g

___
Python tracker 

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