[issue21951] tcl test change crashes AIX

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch can be simpler. And there is yet one similar bug, for unicode strings.

--
Added file: http://bugs.python.org/file36544/asobj_empty_sequence_2.patch

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



[issue20912] [zipfile.py]: Make zip directory attributes more friendly for MS-Windows

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If there are no objections I'll commit the patch soon.

--

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



[issue21228] Missing enumeration of HTTPResponse Objects methods of urllib.request.urlopen's http.client.HTTPResponse?

2014-09-05 Thread Martin Panter

Martin Panter added the comment:

With this patch, there is no longer any implication that the returned object 
implements the “addinfourl” interface. Perhaps that should be added back. Or 
maybe add it to the HTTPResponse class documentation itself? There is a comment 
that says the methods are there “for compatibility with old-style urllib 
responses”, although it seems to me they also make the class compatible with 
Python 3’s new “urllib”:

http://hg.python.org/cpython/file/c499cc2c4a06/Lib/http/client.py#l772

It is good to document the “msg” attribute and its inconsistency, since I have 
found this is required to implement your own BaseHandler.default_open(). 
However I’m not so sure if it is necessary to document the “url” attribute. Why 
not encourage using geturl() instead, since it is already documented, at least 
for non-HTTP responses?

I also saw a comment against the “msg” attribute which mentions deprecating 
something, but it is not clear what:
http://hg.python.org/cpython/file/c499cc2c4a06/Lib/urllib/request.py#l1187

--

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



[issue22215] embedded NUL character exceptions

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If there are no objections I'll commit the patch soon.

--

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



[issue18960] First line can be executed twice

2014-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dd1e21f17b1c by Serhiy Storchaka in branch '2.7':
Issue #1: Backported fixes from Python 3 (issue #18960).
http://hg.python.org/cpython/rev/dd1e21f17b1c

--

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



[issue22221] ast.literal_eval confused by coding declarations

2014-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dd1e21f17b1c by Serhiy Storchaka in branch '2.7':
Issue #1: Backported fixes from Python 3 (issue #18960).
http://hg.python.org/cpython/rev/dd1e21f17b1c

--
nosy: +python-dev

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



[issue22226] Refactor dict result handling in Tkinter

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If there are no objections I'll commit the patch soon.

--

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



[issue22221] ast.literal_eval confused by coding declarations

2014-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 13cd8ea4cafe by Serhiy Storchaka in branch '3.4':
Issue #1: Add tests for compile() with source encoding cookie.
http://hg.python.org/cpython/rev/13cd8ea4cafe

New changeset 9d335a54d728 by Serhiy Storchaka in branch 'default':
Issue #1: Add tests for compile() with source encoding cookie.
http://hg.python.org/cpython/rev/9d335a54d728

--

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



[issue22219] python -mzipfile fails to add empty folders to created zip

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If there are no objections I'll commit the patch soon.

--

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



[issue15513] Correct __sizeof__ support for pickle

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If there are no objections I'll commit the patch soon.

--

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



[issue22221] ast.literal_eval confused by coding declarations

2014-09-05 Thread Serhiy Storchaka

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


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

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



[issue22215] embedded NUL character exceptions

2014-09-05 Thread STINNER Victor

STINNER Victor added the comment:

 If there are no objections I'll commit the patch soon.

Replacing TypeError with ValueError is fine. TypeError was a bad choice. If an 
application relies on TypeError to check for null character, it's easy to 
replace except TypeError: with except (TypeError, ValueError): to stay 
compatible with Python  3.5.

Instead of NUL character (and NUL byte), I had prefer null character (and 
null byte):
http://en.wikipedia.org/wiki/Null_character

I talking about the error message because you changed it in a few places.

--
nosy: +haypo

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



[issue22215] embedded NUL character exceptions

2014-09-05 Thread STINNER Victor

STINNER Victor added the comment:

You may also take a look at these 2 issues: #13617 and #21147 (not directly 
related to this oe).

--

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



[issue5309] distutils doesn't parallelize extension module compilation

2014-09-05 Thread Jonas Wagner

Changes by Jonas Wagner jonas.wag...@epfl.ch:


--
nosy: +Sjlver

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



[issue5309] distutils doesn't parallelize extension module compilation

2014-09-05 Thread Jonas Wagner

Jonas Wagner added the comment:

Is there a reason this has not landed? The patch works perfectly for me, except 
for one issue:

@@ -268,6 +275,9 @@
 if self.undef:
 self.undef = self.undef.split(',')
 
+if self.parallel:
+self.parallel = int(self.parallel)
+
 if self.swig_opts is None:
 self.swig_opts = []
 else:

If self.parallel is True, this will set self.parallel to 1, causing it to use 
one worker instead of n (where n is the number of processors).

An updated patch is attached.

--
Added file: http://bugs.python.org/file36545/build_ext_parallel4.patch

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



[issue22215] embedded NUL character exceptions

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Victor. Here is a patch which is synchronized with the tip and 
addresses your comment about a null character.

--
Added file: 
http://bugs.python.org/file36546/valueerror_embedded_nul_character_2.patch

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



[issue13617] Reject embedded null characters in wchar* strings

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please answer my comments Victor?

--
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3

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



[issue5309] distutils doesn't parallelize extension module compilation

2014-09-05 Thread Stefan Behnel

Stefan Behnel added the comment:

Yes, please. The sequential build in distutils is very annoying.

(too late for Py3.4, though, I guess...)

--
nosy: +scoder
versions: +Python 3.5 -Python 3.4

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



[issue21147] sqlite3 doesn't complain if the request contains a null character

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added a comment on Rietveld.

--
components: +Extension Modules
nosy: +serhiy.storchaka
stage:  - needs patch
type:  - behavior
versions: +Python 2.7, Python 3.4

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



[issue22220] Ttk extensions test failure

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Looks as all builds since #415 are successful.

--

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



[issue22340] Fix Python 3 warnings in Python 2 tests

2014-09-05 Thread STINNER Victor

New submission from STINNER Victor:

Running Python 2 test suite with python -3 -Wd displays a lot of 
DeprecationWarning warnings. Just one example:

/home/haypo/prog/python/2.7/Lib/test/test_ssl.py:2368: DeprecationWarning: 
urllib.urlopen() has been removed in Python 3.0 in favor of urllib2.urlopen()

Attached patch fix most of them (maybe all).

--
components: Tests
files: fix_py3k_warn.patch
keywords: patch
messages: 226418
nosy: haypo
priority: normal
severity: normal
status: open
title: Fix Python 3 warnings in Python 2 tests
versions: Python 2.7
Added file: http://bugs.python.org/file36547/fix_py3k_warn.patch

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



[issue22341] Python 3 crc32 documentation clarifications

2014-09-05 Thread Martin Panter

New submission from Martin Panter:

This is regarding the Python 3 documentation for binascii.crc32(), 
https://docs.python.org/dev/library/binascii.html#binascii.crc32. It 
repeatedly recommends correcting the sign by doing crc32()  0x, but it 
is not immediately clear why. Only after reading the Python 2 documentation 
does one realise that the value is always unsigned for Python 3, so you only 
really need the workaround if you want to support earlier Pythons.

I also suggest documenting the initial CRC input value, which is zero. 
Suggested wording:

binascii.crc32(data[, crc])
Compute CRC-32, the 32-bit checksum of “data”, starting with the given “crc”. 
The default initial value is zero. The algorithm is consistent with the ZIP 
file checksum. Since the algorithm is designed for use as a checksum algorithm, 
it is not suitable for use as a general hash algorithm. Use as follows:

print(binascii.crc32(bhello world))
# Or, in two pieces:
crc = binascii.crc32(bhello, 0)
crc = binascii.crc32(b world, crc)
print('crc32 = {:#010x}'.format(crc))

I would simply drop the notice box with the workaround, because I gather that 
the Python 3 documentation generally omits Python 2 details. (There are no “new 
in version 2.4 tags” for instance.) Otherwise, clarify if “packed binary 
format” is a reference to the “struct” module, or something else.

Similar fixes are probably appropriate for zlib.crc32() and zlib.alder32().

Also, what is the relationship between binascii.crc32() and zlib.crc32()? I 
vaguely remember reading that “zlib” is not always available, so I tend to use 
“binascii” instead. Is there any advantage in using the “zlib” version? The 
“hashlib” documentation points to “zlib” without mentioning “binascii” at all.

--
assignee: docs@python
components: Documentation
messages: 226419
nosy: docs@python, vadmium
priority: normal
severity: normal
status: open
title: Python 3 crc32 documentation clarifications
versions: Python 3.4

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



[issue21866] zipfile.ZipFile.close() doesn't respect allowZip64

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Benjamin for explanation.

Here is a patch which adds all three required checks in the close() method and 
adds a check for files count in write methods. Implementing other checks in 
write methods is too laborious.

As far as test_zipfile64 is disabled, for manual testing you need temporary 
comment out the support.requires() statement and run only selected tests:

./python -m test.regrtest -v -m OtherTests test_zipfile64

--
keywords: +patch
stage: needs patch - patch review
Added file: http://bugs.python.org/file36548/zipfile64_additional_checks.patch

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



[issue22340] Fix Python 3 warnings in Python 2 tests

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Why test_support.check_py3k_warnings is not used in test_calltips.py? Or may be 
change the test to 1+0, 1//0 or 1.0/0.0?

--
nosy: +serhiy.storchaka, terry.reedy

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



[issue13968] Support recursive globs

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you make a review Nick?

--

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



[issue22187] commands.mkarg() buggy in East Asian locales

2014-09-05 Thread mirabilos

mirabilos added the comment:

Just for the record, please do not assume all shells behave like GNU bash.

--
nosy: +mirabilos

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



[issue5309] distutils doesn't parallelize extension module compilation

2014-09-05 Thread Jonas Wagner

Jonas Wagner added the comment:

With this patch, and on Ubuntu 14.04, occasionally modules fail to build with 
the following error:

*** WARNING: renaming _testbuffer since importing it failed: dlopen: cannot 
load any more object with static TLS

I'm not 100% sure if this is really due to the patch... but I've never seen it 
before. I'll try investigate a bit more.

--

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



[issue22342] Fix typo in PEP 380 -- Syntax for Delegating to a Subgenerator

2014-09-05 Thread Gael Robin

New submission from Gael Robin:

The first line of the Refactoring Principle subsection of the Rationale section 
contains the following typo :

It should be possible to take an section of code

should be

It should be possible to take a section of code

--
assignee: docs@python
components: Documentation
messages: 226425
nosy: Gael.Robin, docs@python
priority: normal
severity: normal
status: open
title: Fix typo in PEP 380 -- Syntax for Delegating to a Subgenerator
type: enhancement

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



[issue22187] commands.mkarg() buggy in East Asian locales

2014-09-05 Thread R. David Murray

R. David Murray added the comment:

That is true, but sh-alikes (posix standard) are the only ones we support in 
commands.  subprocess (which commands was folded in to in python3) also 
supports windows cmd to the extent we've managed, but that's all we are 
committed to support.

--

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



[issue22302] Windows os.path.isabs UNC path bug

2014-09-05 Thread Steve Dower

Steve Dower added the comment:

Antoine almost certainly thought about this with pathlib and may know about the 
change, or at least have some decent context on it.

I'm more inclined to think that os.path.isabs(r\\server) should also return 
False, since it's not a path that can be opened directly unless you add more 
path before or after it.

Indeed, pathlib seems to support my understanding:

 Path('//server').is_absolute()
False
 Path('//server/share').is_absolute()
True
 Path('//server/share/').is_absolute()
True
 Path('//server/share/file').is_absolute()
True

If the regression appeared in 3.4, it should be easy enough to look at what 
changed.

--
nosy: +pitrou, steve.dower

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



[issue22299] resolve() on Windows makes some pathological paths unusable

2014-09-05 Thread Steve Dower

Steve Dower added the comment:

Patch attached. (Kinda feel like this was too simple...)

--
keywords: +patch
Added file: http://bugs.python.org/file36549/22299_1.patch

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



[issue22302] Windows os.path.isabs UNC path bug

2014-09-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Under Windows, pathlib's absolute means a fully qualified path as defined in 
http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx

 PureWindowsPath(c:).is_absolute()
False
 PureWindowsPath(/).is_absolute()
False
 PureWindowsPath(c:/).is_absolute()
True

The fact that //server isn't considered absolute is a bug in pathlib, since 
//server/ is:

 PureWindowsPath(//foo).is_absolute()
False
 PureWindowsPath(//foo/).is_absolute()
True

I agree that it's not really important, since both aren't actual paths (in the 
sense that they may not point to anything, AFAIK).

--

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



[issue22302] Windows os.path.isabs UNC path bug

2014-09-05 Thread Steve Dower

Steve Dower added the comment:

My experience says the main reason people want to know whether the path is 
absolute is to figure out whether to do `Path.cwd() / path` or not. According 
to that MSDN page, they shouldn't because the path starts with // (that is, 
the last character and the existence of the share name are irrelevant here).

Both pathlib and ntpath are reasonably consistent in determining the drive of 
the path:
 splitdrive('server\\')[0]
'server\\'
 splitdrive('server')[0]
''
 Path('server\\').parts[0]
'server'
 Path('server').parts[0]
'\\'

I assume the bug in the last statement is what Antoine is referring to.

The difference in results then comes from how they determine roots.
 splitdrive('server\\')[1]
''
 splitdrive('server')[1]
'server'
 Path('//server/').root
'\\'
 Path('//server').root
'\\'

Pathlib always has a root, but splitdrive doesn't.

I'm not sure exactly which one to fix where, but hopefully that helps someone 
else figure it out.

--

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



[issue22299] resolve() on Windows makes some pathological paths unusable

2014-09-05 Thread eryksun

eryksun added the comment:

It should only skip _ext_to_normal for an already extended path, i.e. a path 
that starts with ext_namespace_prefix. Otherwise it needs to call 
_ext_to_normal. For example:

Strip the prefix in this case:

 os.path._getfinalpathname('C:\\Windows')   
'?\\C:\\Windows'

but not in this case:

 
os.path._getfinalpathname(r'\\?\GLOBALROOT\Device\HarddiskVolume1\Windows')
'?\\C:\\Windows'

--

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



[issue22302] Windows os.path.isabs UNC path bug

2014-09-05 Thread Steve Dower

Steve Dower added the comment:

Just did a double-take, but that output for Path('server\\').parts[0] is 
actually correct...

 Path('server\\').parts[0]
'server'
 print(Path('server\\').parts[0])
\\server\\

--

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



[issue22299] resolve() on Windows makes some pathological paths unusable

2014-09-05 Thread Steve Dower

Steve Dower added the comment:

Ah, thought it was too simple. I didn't realise that _getfinalpathname adds the 
prefix.

New patch soon.

--

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



[issue22302] Windows os.path.isabs UNC path bug

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It looks to me that rather handling of //server/ is buggy than //server. 
//server is just the same as /server or ///server. But //server/ looks 
as an UNC path with empty () mount point. This is invalid path and we can't 
create valid path from this path by adding components. Perhaps 
PureWindowsPath(//server/) should raise an exception.

--
nosy: +serhiy.storchaka

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



[issue22299] resolve() on Windows makes some pathological paths unusable

2014-09-05 Thread Steve Dower

Steve Dower added the comment:

Strips the prefix if it wasn't in the original path - otherwise, keeps it.

--
Added file: http://bugs.python.org/file36550/22299_2.patch

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



[issue22302] Windows os.path.isabs UNC path bug

2014-09-05 Thread eryksun

eryksun added the comment:

Isn't this bug about the root of a share case with ntpath.isabs in 3.x and 
2.7 (splitdrive was backported)? For example:

 os.path.isabs(//server/share)
False
 os.path.splitdrive('//server/share') 
('//server/share', '')

vs.

 os.path.isabs('//server/share/') 
True
 os.path.splitdrive('//server/share/')
('//server/share', '/')

I think '//server/share' is an absolute path, and pathlib agrees. Network 
shares do not maintain a current directory the way drives do (i.e. the hidden 
environment variable trick). There's no such thing as a share-relative path, 
nor would there be any way to even write such a path, as compared to 
C:drive/relative/path.

--
versions: +Python 2.7, Python 3.5

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



[issue22340] Fix Python 3 warnings in Python 2 tests

2014-09-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Please just change '1/0' to '1//0'.  Any expression that raises something other 
than NameError or AttributeError will do. .get_entity evals user code and Idle 
previously crashed when other exceptions were not caught. Thanks, Serhiy, for 
catching this.

The other warned code appears to be essential to the corresponding test. I 
presume Serhiy checked this also.

--
assignee:  - haypo
stage:  - patch review
type:  - behavior

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



[issue4945] json checks True/False by identity, not boolean value

2014-09-05 Thread Serhiy Storchaka

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


--
versions: +Python 3.5 -Python 3.3

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



[issue900092] hotshot.stats.load fails with AssertionError

2014-09-05 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
versions: +Python 2.7 -Python 2.6

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



[issue22340] Fix Python 3 warnings in Python 2 tests

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The rest of the patch LGTM.

--

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



[issue17651] Errno checking replaced by concrete classes inherited from OSError

2014-09-05 Thread Serhiy Storchaka

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


--
stage:  - needs patch
versions: +Python 3.5 -Python 3.4

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



[issue22187] commands.mkarg() buggy in East Asian locales

2014-09-05 Thread Jakub Wilk

Jakub Wilk added the comment:

I think what mirabilos meant (and what I should have mentioned in my initial 
message) is that even sh-alikes don't necessarily behave the same way as bash:

$ bash test.sh 
乗

$ ksh test.sh 
乗

$ dash test.sh 
test.sh: 2: test.sh: Syntax error: Unterminated quoted string

$ mksh test.sh 
test.sh[2]: no closing quote

$ posh test.sh 
test.sh:2: no closing quote

--
Added file: http://bugs.python.org/file36551/test.sh

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



[issue22302] Windows os.path.isabs UNC path bug

2014-09-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Serhiy, you may be right. I'd suggest opening a python-dev discussion to gather 
more feedback.

--

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



[issue22299] resolve() on Windows makes some pathological paths unusable

2014-09-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

As far as I can say, the patch looks fine to me. Thanks, Steve.

--
stage: needs patch - patch review

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



[issue22302] Windows os.path.isabs UNC path bug

2014-09-05 Thread eryksun

eryksun added the comment:

 //server is just the same as /server or ///server.

Repeated slashes aren't collapsed at the start of a Windows path. Here's what I 
get in Windows 7:

 os.listdir('/server')   
[]
 os.listdir('//server')
Traceback (most recent call last):
  File stdin, line 1, in module
FileNotFoundError: [WinError 53] The network path was not found: '//server'
 os.listdir('///server')
Traceback (most recent call last):
  File stdin, line 1, in module
FileNotFoundError: [WinError 161] The specified path is invalid: '///server'

--

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



[issue22340] Fix Python 3 warnings in Python 2 tests

2014-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0675b3a55941 by Victor Stinner in branch '2.7':
Issue #22340: Fix Python 3 warnings in Python 2 tests
http://hg.python.org/cpython/rev/0675b3a55941

--
nosy: +python-dev

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



[issue8840] truncate() semantics changed in 3.1.2

2014-09-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Can this be closed or what?

--
versions: +Python 3.5 -Python 3.2, Python 3.3

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



[issue22340] Fix Python 3 warnings in Python 2 tests

2014-09-05 Thread STINNER Victor

STINNER Victor added the comment:

Ok, I replaced 1/0 with 1//0 in IDLE tests.

I also changed the context manager in test_collections, the sets module is just 
deprecated, it's not a Python 3 specific warning.

Thanks for the review Serhiy.

--
resolution:  - fixed
status: open - closed

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



[issue15934] flaky test in test_ftplib

2014-09-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Surely a test issue can be closed after two years?

--

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



[issue22226] Refactor dict result handling in Tkinter

2014-09-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I made two style comments, one an expansion of a previous comment.  I believe 
all other previous comments were handled ok.

--

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



[issue22340] Fix Python 3 warnings in Python 2 tests

2014-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 407653078135 by Victor Stinner in branch '2.7':
Issue #22340: Fix test_collections if the sets module was already imported
http://hg.python.org/cpython/rev/407653078135

--

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



[issue896330] pyconfig.h is not placed in --includedir

2014-09-05 Thread Lauri Tirkkonen

Lauri Tirkkonen added the comment:

Patch attached to set CONFINCLUDEDIR to --includedir. There's additionally some 
hardcoded assumptions in sysconfig and distutils.sysconfig about the include 
paths, of which this patch fixes some.

What it doesn't address is sysconfig.get_path with 'include' or 'platinclude'. 
There 'include', however, were already broken if python was configured with 
--includedir ('platinclude' was correct because it was hardcoded, and 
pyconfig.h always installed to the same place). I think those should also be 
fixable by getting the correct directories from _sysconfigdata instead of 
hardcoding possible 'installation schemes' and trying some de-facto paths based 
on those. I suspect this is also a problem for library paths, but this issue is 
only concerned with includedir.

I suspect the problem that 'CONFINCLUDEDIR' was trying to solve is separating 
platform-dependent headers from platform-independent ones, but it doesn't 
actually solve that problem correctly: pyconfig.h does not go in --includedir 
AND the hardcoded include path for pyconfig.h doesn't go in python-config 
--includes output.

--
keywords: +patch
nosy: +lotheac
Added file: http://bugs.python.org/file36552/pyconfig-includedir.patch

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



[issue22192] dict_values objects are hashable

2014-09-05 Thread Ben Roberts

Ben Roberts added the comment:

Going to close this down - implementing rich comparisons for values() does feel 
like the correct solution... but I don't think it's possible to implement 
__eq__ in better than nlogn time (and possibly space).

So nothing can realistically be done, yeah.

--
resolution:  - rejected
status: open - closed

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



[issue8840] truncate() semantics changed in 3.1.2

2014-09-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The docstring is unchanged from before the behavior change and to me still has 
problems a. to d. listed in msg106698.  The manual entry seems too longs to 
just copy, but I would not know know to condense it.

--

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



[issue22343] Install bash activate script on Windows when using venv

2014-09-05 Thread Kevin Christopher Henry

New submission from Kevin Christopher Henry:

When I use venv to create a new virtual environment in Windows I'm given two 
activate scripts, a .bat file and a .ps1 file (which is consistent with the 
documentation).

However, bash (and probably the other shells as well) works just fine in 
Windows under Cygwin. Since you have these scripts anyway, please include them 
in the Windows virtual environment (as virtualenv did).

--
components: Windows
messages: 226452
nosy: marfire
priority: normal
severity: normal
status: open
title: Install bash activate script on Windows when using venv
type: enhancement
versions: Python 3.4

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



[issue22342] Fix typo in PEP 380 -- Syntax for Delegating to a Subgenerator

2014-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4b03ae00a76b by Benjamin Peterson in branch 'default':
use correct article (closes #22342)
http://hg.python.org/peps/rev/4b03ae00a76b

--
nosy: +python-dev
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue20643] Strange dot in documentation (after generator.close)

2014-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bc4e26755a13 by Serhiy Storchaka in branch '3.4':
Issue #20643: Removed unneeded (and wrong) class directives.
http://hg.python.org/cpython/rev/bc4e26755a13

New changeset 060e347c9a23 by Serhiy Storchaka in branch 'default':
Issue #20643: Removed unneeded (and wrong) class directives.
http://hg.python.org/cpython/rev/060e347c9a23

New changeset 6dba9db360d0 by Serhiy Storchaka in branch '2.7':
Issue #20643: Fixed references to the next() method (distinguish from the
http://hg.python.org/cpython/rev/6dba9db360d0

--
nosy: +python-dev

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



[issue22302] Windows os.path.isabs UNC path bug

2014-09-05 Thread Akima

Akima added the comment:

As eryksun pointed out, I created this bug report to report on one issue; that 
\\server\share isn't being consider absolute by os.path.isabs when it should be 
considered absolute.

I found this bug when I was writing a basic config file parsing module.  One of 
the options in the config (named log_dir) required an absolute path to a 
directory where my program could dump log files.  It has to be absolute because 
the working directory of the program changes.  A user entered a path 
\\pollux\logs as the log_dir value in their config file and my program rejected 
it informing the user that it wasn't absolute (because I checked the path using 
isabs).  I've worked around this bug in my program, but it is clearly a problem 
that needs fixing.

Steve: with regard to what isabs should return when given the string 
r\\server: does it really matter whether it returns True or False?  As you 
said; \\server isn't a real path.  It's invalid.  If you ask python if it's 
absolute (using os.path.isabs) and you expect a boolean response, no matter 
whether the response is True or False, the response will be meaningless.  
Consider this:

Python 3.2.3 (default, Feb 27 2014, 21:31:18) 
[GCC 4.6.3] on linux2
Type help, copyright, credits or license for more information.
 import os.path
 os.path.isabs(monkeyfart!££)
False
 

I just asked isabs if monkeyfart!££ was absolute and it told me it's not an 
absolute path, it's relative!  It's infact, not even a path.  There is no 
os.path.isrelative function.  If we want to know if a path is relative we use 
the isabs function and decide the path is relative if the result is False.  If 
you give the function a junk-string which isn't even a path (eg \\server  or  
monkeyfart!££ ) then you can only expect a junk response.  If we decide that 
all invalid paths provide to isabs should return False then what we are saying 
is all invalid paths provided to isabs should be considered relative paths.  
What use is that to anyone?  Really, the programmer should ensure that the path 
is valid before trying to find out if it's relative or absolute.

To summarize: I think it's important that isabs works correctly when given a 
*valid* path (like \\server\share).  When it's given a string which is an 
invalid path (like \\server), its behaviour should be undefined.

--

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



[issue20643] Strange dot in documentation (after generator.close)

2014-09-05 Thread Serhiy Storchaka

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


--
assignee: docs@python - serhiy.storchaka
resolution:  - fixed
stage: patch review - resolved
status: open - closed
versions: +Python 3.5 -Python 3.3

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



[issue22344] Reorganize unittest.mock docs into linear manner

2014-09-05 Thread py.user

New submission from py.user:

Now, it's very inconvenient to learn this documentation. It's not compact 
(could be reduced in 2 or even 3 times). It repeats itself: many examples 
copy-pasted unchangeably. And it cites to terms that placed under those cites, 
so people should start at the bottom to anderstand what it's talking about on 
the top.

Remember Zen If the implementation is hard to explain, it's a bad idea.

- Move the MagicMock description to the point between Mock and PropertyMock 
descriptions
- Remove copy-paste examples
- Rename print to print() and StringIO to io
- Split the Autospecing section to several chunks

--
assignee: docs@python
components: Documentation
messages: 226456
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: Reorganize unittest.mock docs into linear manner
type: enhancement
versions: Python 3.4

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



[issue22345] https://docs.python.org/release/1.4/ returns 403

2014-09-05 Thread Zbyszek Jędrzejewski-Szmek

New submission from Zbyszek Jędrzejewski-Szmek:

This is the last link on https://www.python.org/doc/versions/.

--
assignee: docs@python
components: Documentation
messages: 226457
nosy: docs@python, zbysz
priority: normal
severity: normal
status: open
title: https://docs.python.org/release/1.4/ returns 403

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



[issue22345] https://docs.python.org/release/1.4/ returns 403

2014-09-05 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
assignee: docs@python - benjamin.peterson
nosy: +benjamin.peterson

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



[issue22345] https://docs.python.org/release/1.4/ returns 403

2014-09-05 Thread Benjamin Peterson

Changes by Benjamin Peterson benja...@python.org:


--
resolution:  - fixed
status: open - closed

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



[issue22299] resolve() on Windows makes some pathological paths unusable

2014-09-05 Thread Kevin Norris

Kevin Norris added the comment:

I'm a little concerned about this fix.  In particular, if I understand the 
design of the patch correctly, it is intended to produce this behavior:

Path('C:/foo').resolve() != Path('//?/C:/foo').resolve()

Since both paths are valid and both paths refer to the same file, some 
developers may find this result counterintuitive.  The Path.resolve() docs do 
not expressly forbid it, however.

How many developers assume Path.resolve() is always the same for the same file?

--

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



[issue22344] Reorganize unittest.mock docs into linear manner

2014-09-05 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +michael.foord
versions: +Python 3.5

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



[issue13968] Support recursive globs

2014-09-05 Thread Nick Coghlan

Nick Coghlan added the comment:

Mostly looks good to me, just two comments:

1. Is there a reason the helper function is glob2 rather than either _glob2 
or else something more self-documenting?

2. match a files in the docs and docstrings doesn't read correctly. match 
any files, perhaps?

--

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



[issue22339] Incorrect behavior when subclassing enum.Enum

2014-09-05 Thread Ethan Furman

Ethan Furman added the comment:

My apologies for the confusion, and thanks for tracking it down.

I'll get the patch in, but I'm curious how you actually use these Enums?  Is 
this a way to easily handle multiple aliases?

--

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



[issue900092] hotshot.stats.load fails with AssertionError

2014-09-05 Thread Brian Curtin

Changes by Brian Curtin br...@python.org:


--
nosy:  -brian.curtin

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



[issue19280] Add a datatype to represent mime types to the email module

2014-09-05 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
nosy: +vadmium

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



[issue22339] Incorrect behavior when subclassing enum.Enum

2014-09-05 Thread Kiss György

Kiss György added the comment:

 Is this a way to easily handle multiple aliases?

You mean this MultiValueEnum implementation? (If not I don't understand the 
question, could you elaborate?)

No, this is the opposite of aliases, because an alias is when the same value 
have multiple names, but this is when the values are used to lookup the same 
name.

I use it when very similar values have the same meaning like:

class Suit(MultiValueEnum):
CLUBS ='♣', 'c', 'C', 'clubs', 'club'
DIAMONDS = '♦', 'd', 'D', 'diamonds', 'diamond'
HEARTS =   '♥', 'h', 'H', 'hearts', 'heart'
SPADES =   '♠', 's', 'S', 'spades', 'spade'


Also it can be used for ECP testing (Equivalence class testing) like this:

from http.client import responses
class ResponseEnum(MultiValueEnum):
GOOD = [status for status in responses if 200 = status = 299]
BAD = [status for status in responses if not (200 = status = 299)]

I did not think about this use case, but I think it's very interesting and 
useful.

--

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



[issue22299] resolve() on Windows makes some pathological paths unusable

2014-09-05 Thread eryksun

eryksun added the comment:

Maybe for an extended path it could try _getfinalpathname without the prefix. 
If it isn't a valid path or the result isn't the same as _getfinalpathname 
including the prefix, then skip calling _ext_to_normal. For example:

def resolve(self, path):
s = str(path)
if not s:
return os.getcwd()
if _getfinalpathname is not None:
prefix, t = self._split_extended_path(s)
s = _getfinalpathname(s)
if prefix:
try:
if _getfinalpathname(t) != s:
return s
except FileNotFoundError:
return s
return self._ext_to_normal(s)
# Means fallback on absolute
return None

The 'foo.' path in this issue would keep the prefix:

 Path('//?/C:/foo.').resolve()
WindowsPath('//?/C:/foo.')
 Path('//?/UNC/server/C$/foo.').resolve()
WindowsPath('//?/UNC/server/C$/foo.')

But regular paths would remove the prefix:

 Path('//?/C:/bar').resolve()
WindowsPath('C:/bar')
 Path('//?/UNC/server/C$/bar').resolve() 
WindowsPath('//server/C$/bar')

On a related note, _split_extended_path only looks for uppercase UNC, which 
makes the above resolve method fail:

 Path('//?/unc/server/C$/bar').resolve()
WindowsPath('//?/UNC/server/C$/bar')

--

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



[issue22346] asyncio documentation does not mention provisional status

2014-09-05 Thread Thomas Kluyver

New submission from Thomas Kluyver:

From PEP 411:


A package will be marked provisional by a notice in its documentation page and 
its docstring. The following paragraph will be added as a note at the top of 
the documentation page:

The X package has been included in the standard library on a provisional 
basis. Backwards incompatible changes (up to and including removal of the 
package) may occur if deemed necessary by the core developers.


PEP 3156 says that asyncio is in provisional status until Python 3.5, but the 
main asyncio page in the docs does not even mention this, let alone having the 
new warning:
https://docs.python.org/3/library/asyncio.html

I freely admit this is nitpicking, but if the idea of provisional status is to 
be taken seriously, I think asyncio, as a very high profile new package, should 
set a good example of it.

--
assignee: docs@python
components: Documentation, asyncio
messages: 226463
nosy: docs@python, gvanrossum, haypo, takluyver, yselivanov
priority: normal
severity: normal
status: open
title: asyncio documentation does not mention provisional status
versions: Python 3.4

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



[issue22346] asyncio documentation does not mention provisional status

2014-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f8f3e83c9528 by Guido van Rossum in branch 'default':
Add PEP-411-compliant note about asyncio being provisional. Fixes issue #22346.
http://hg.python.org/cpython/rev/f8f3e83c9528

--
nosy: +python-dev

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



[issue22346] asyncio documentation does not mention provisional status

2014-09-05 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks!

--
resolution:  - fixed
status: open - closed

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



[issue22343] Install bash activate script on Windows when using venv

2014-09-05 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +ncoghlan, vinay.sajip

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



[issue1043134] Add preferred extensions for MIME types

2014-09-05 Thread Martin Panter

Martin Panter added the comment:

See also https://bugs.python.org/issue6626#msg91205, which mentions using a 
list of tuples instead of a dictionary, which sounds like it might help with 
this issue. Doing it that way you might be able avoid some duplication in the 
lists.

--
nosy: +vadmium

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



[issue22347] mimetypes.guess_type(//example.com) misinterprets host name as file name

2014-09-05 Thread Martin Panter

New submission from Martin Panter:

The documentation says that guess_type() takes a URL, but:

 mimetypes.guess_type(http://example.com;)
('application/x-msdownload', None)

I suspect the MS download is a reference to *.com files (like DOS's 
command.com). My current workaround is to strip out the host name from the URL, 
since I cannot imagine it would be useful for determining the content type. I 
am also stripping the fragment part. An argument could probably be made for 
stripping the “;parameters” and “?query” parts as well.

 # Workaround for mimetypes.guess_type(//example.com)
... # interpreting host name as file name
... url = urlparse(http://example.com;)
 url = net.url_replace(url, netloc=, fragment=)
 url
'http://'
 mimetypes.guess_type(url, strict=False)
(None, None)

--
components: Library (Lib)
messages: 226467
nosy: vadmium
priority: normal
severity: normal
status: open
title: mimetypes.guess_type(//example.com) misinterprets host name as file 
name
type: behavior
versions: Python 3.4

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



[issue22339] Incorrect behavior when subclassing enum.Enum

2014-09-05 Thread Ethan Furman

Ethan Furman added the comment:

Right.  We can still use the alias machinery to accomplish this task for us, 
and avoid the metaclass hacking:

-- python2 sample code 
# -*- coding: utf-8 -*-
from enum import Enum

class MultiValueEnum(Enum):
def __new__(cls, *values):
obj = object.__new__(cls)
obj._value_ = values[0]
obj._all_values = values
for alias in values[1:]:
cls._value2member_map_[alias] = obj
return obj
def __repr__(self):
return %s.%s: %s % (
 self.__class__.__name__,
 self._name_,
 ', '.join(['%s' % v for v in self._all_values])
 )

class Suits(MultiValueEnum):
CLUBS ='♣', 'c', 'C', 'clubs', 'club'
DIAMONDS = '♦', 'd', 'D', 'diamonds', 'diamond'
HEARTS =   '♥', 'h', 'H', 'hearts', 'heart'
SPADES =   '♠', 's', 'S', 'spades', 'spade'

print(Suits.HEARTS)
print(repr(Suits.HEARTS))
print(Suits('d'))
print(Suits('club'))
print(Suits('S'))
print(Suits('hearts'))



And the output:

Suits.HEARTS
Suits.HEARTS: '♥', 'h', 'H', 'hearts', 'heart'
Suits.DIAMONDS
Suits.CLUBS
Suits.SPADES
Suits.HEARTS



I'm still going to fix the bug, though.  :)

Oh, the above does not fix the IncorrectAliasBehavior class, but honestly I'm 
not sure what you are trying to accomplish there.

--
stage:  - patch review
type: enhancement - behavior

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



[issue11588] Add necessarily inclusive groups to argparse

2014-09-05 Thread paul j3

paul j3 added the comment:

Attached is a patch for 3.5.0 dev that adds UsageGroups.  Now different 'kinds' 
are implemented as subclasses, which are accessed via the registry:

 _XorUsageGroup - replicate action of MutuallyExclusiveGroups
 _AndUsageGroup - an inclusive group
 _OrUsageGroup -  an 'any' group
 _NorUsageGroup - NotOr - also works as Not
 _NandUsageGroup - NotAnd

Open issues:

- what difference should the 'required' parameter make?
- how should 'errors' in nested groups propagate?
- formatting of error messages
- formatting the usage line with these groups
- any additional 'help' display
- framework for custom test and/or subclasses
- documentation, sample scripts, and formal testing

--
Added file: http://bugs.python.org/file36553/usage_2.patch

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



[issue22339] Incorrect behavior when subclassing enum.Enum

2014-09-05 Thread Kiss György

Kiss György added the comment:

Oh, wow. I never really understood what _find_new_ did, now I do.

 I'm not sure what you are trying to accomplish there.
Exactly that, I'm just not as good. Oh well at least I found a bug! :) Thanks 
for the enlightenment!

If the patch goes in, I also would like one more minor change. On line 457, the 
missing value is represented as simple str(). In case of user defined types, it 
would make debugging easier if repr() would be used instead. I attached the 
patch.

--
Added file: http://bugs.python.org/file36554/enum.patch2

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



[issue13968] Support recursive globs

2014-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Nick.

 1. Is there a reason the helper function is glob2 rather than either
 _glob2 or else something more self-documenting?

Only consistency with other helper functions (glob0, glob1).

 2. match a files in the docs and docstrings doesn't read correctly. match
 any files, perhaps?

Of course. This is just a typo.

--

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



[issue13968] Support recursive globs

2014-09-05 Thread Serhiy Storchaka

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


Added file: http://bugs.python.org/file36555/glob_recursive_6.patch

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