[issue20580] IDLE should support platform-specific default config defaults

2014-02-28 Thread Westley Martínez

Changes by Westley Martínez :


--
nosy: +westley.martinez

___
Python tracker 

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



[issue17128] OS X system openssl deprecated - installer should build local libssl

2014-02-28 Thread Christian Heimes

Christian Heimes added the comment:

Thanks to Hynek we were able to dig deeper into Apple's modifications. OpenSSL 
on OSX uses TEA (TrustEvaluationAgent) to verify cert chains. TEA is pretty 
much undocumented on the internet but perhaps we can use it to verify certs 
with OpenSSL 1.x, too?

http://opensource.apple.com/source/OpenSSL098/OpenSSL098-35.1/src/crypto/x509/x509_vfy_apple.c

--

___
Python tracker 

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



[issue20781] BZ2File doesn't decompress some .bz2 files correctly

2014-02-28 Thread James Dominy

James Dominy added the comment:

Ah, I did some digging. It turns out pbzip2 is installed on the system in 
question, and more annoyingly, /usr/bin/bzip2 is a symlink to pbzip2. I didn't 
realise the file was compressed by pbzip2.

Thanks for the help.

--

___
Python tracker 

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



[issue17128] OS X system openssl deprecated - installer should build local libssl

2014-02-28 Thread Ned Deily

Ned Deily added the comment:

Crys, as Ronald noted above: "Now that I look at that code again: we can't 
extract that code and use it to patch upstream OpenSSL, the 
TrustEvaluationAgent framework is a private framework and hence off limits."  
It doesn't seem like a good idea to be trying to base security on a private, 
undocumented framework and one that can change from OS X release to OS X 
release: our binary installers for OS X are designed to support multiple OS X 
versions.  I think the certsync approach is safer and more robust.  The other 
approach would be to directly use Apple's crypto APIs rather than OpenSSL but 
that would be a lot of work and a lot of testing and would also be more coupled 
to specific OS X releases.

--

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2014-02-28 Thread koobs

koobs added the comment:

Attaching patch against default

--
keywords: +patch
type:  -> compile error
Added file: http://bugs.python.org/file34253/python-issue20767.diff

___
Python tracker 

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



[issue20803] struct.pack_into writes 0x00 for pad bytes

2014-02-28 Thread Andrew P. Lentvorski, Jr.

New submission from Andrew P. Lentvorski, Jr.:

This code did something unexpected to me:
>>> a = bytearray('1234')
>>> a
bytearray(b'1234')
>>> struct.pack_into('xBxB', a, 0, 0x59, 0x5A)
>>> a
bytearray(b'\x00Y\x00Z')


The unexpected part was that the 'x' pad byte formatter actually *overwrote* 
the bytes to 0 rather than leaving them alone.

Not necessarily a bug, but the fact that the pad byte writes 0x00 rather than 
being untouched/ignored should be documented.

--
components: Interpreter Core
messages: 212416
nosy: bsder
priority: normal
severity: normal
status: open
title: struct.pack_into writes 0x00 for pad bytes
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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread Vlastimil Zíma

New submission from Vlastimil Zíma:

Sentinels lose their identity when they are pickled, meaning they are no longer 
equal to sentinel with the same name.


>>> from mock import sentinel
>>> import pickle
>>> sentinel.foo == sentinel.foo
True
>>> pickle.loads(pickle.dumps(sentinel.foo)) == sentinel.foo
False


I found this bug using Python 2.7.3 and python-mock 1.0.1. Since mock 1.0 is 
part of Python 3.3 and 3.4 it affects these versions (tested in 3.3.3).

This behavior is tricky to find out if encountered in tests and sentinels can 
not be used in tests of code which uses pickle and possibly other 
serializations.

--
components: Tests
messages: 212417
nosy: Vlastimil.Zíma
priority: normal
severity: normal
status: open
title: Sentinels identity lost when pickled (unittest.mock)
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue20246] buffer overflow in socket.recvfrom_into

2014-02-28 Thread koobs

koobs added the comment:

Can somebody backport the fixes for the test breakages to 3.1 and 3.2 please, 
it seems they were forgotten.

The original CVE fix includes changes to test_socket.py so I cant imagine 
security-only-fix policy applies.

Thanks!

--

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2014-02-28 Thread STINNER Victor

STINNER Victor added the comment:

>  The question is whether it should be extended to the other *BSDs as well.

The change is not needed on Linux (if Clang 3.4 is used to compile extensions 
too)?

--
nosy: +haypo

___
Python tracker 

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



[issue14302] Rename Scripts directory to bin and move python.exe to bin

2014-02-28 Thread Martin Dengler

Martin Dengler added the comment:

Is this state "closed" per 
https://mail.python.org/pipermail/distutils-sig/2013-October/022855.html or 
"languishing"  per 
https://mail.python.org/pipermail/python-dev/2012-March/117946.html ?

I would add a belated "me too" to the "2. Change 'Scripts' to 'bin'" part for 
consistency, but it seems that the decision has been that the consistency 
benefits don't outweigh the breakage.

I would have thought that a directory junction (mklink /j Scripts bin) would 
have obviated the installer breakage concern in 
https://mail.python.org/pipermail/distutils-sig/2013-October/022855.html , 
especially given that wheels, which would not be subject to this concern, are 
coming along nicely.

Is there any appetite to revisit this decision?

--

___
Python tracker 

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



[issue20042] Python Launcher, Windows, fails on scripts w/ non-latin names

2014-02-28 Thread Martin Dengler

Changes by Martin Dengler :


--
nosy: +mdengler

___
Python tracker 

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



[issue20805] Error in 3.3 Tutorial

2014-02-28 Thread Gene Anderson

New submission from Gene Anderson:

In the tutorial for Python 3.3 the content for 9.3.4 Method Objects seems to 
have an error.  In the following lines:

xf = x.f
while True:
print(xf())

... it seems to me that based on the x object's method f(), the command should 
be 

print(x.f())

At least it did when I tried to run it without the endless loop.  I'm pretty 
new at this Python stuff, though, so I could be wrong.

--
messages: 212421
nosy: Andesheng
priority: normal
severity: normal
status: open
title: Error in 3.3 Tutorial
versions: Python 3.3

___
Python tracker 

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



[issue20805] Error in 3.3 Tutorial

2014-02-28 Thread Gene Anderson

Gene Anderson added the comment:

I failed to mention that the associated web address for the documentation is:

http://docs.python.org/3.3/tutorial/classes.html#method-objects

--

___
Python tracker 

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



[issue14302] Rename Scripts directory to bin and move python.exe to bin

2014-02-28 Thread Mark Hammond

Mark Hammond added the comment:

I get the impression the first link just punted and the second supports the 
fact many people would see it as an improvement.

So a patch that both works and addresses the concerns would probably be most 
welcome!

--

___
Python tracker 

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



[issue20806] os.times document points to wrong section of non-Linux manual

2014-02-28 Thread Geoffrey Spear

New submission from Geoffrey Spear:

The documentation for os.times directs the reader: "See the Unix manual page 
times(2) or the corresponding Windows Platform API documentation."

However, the POSIX manual page in question is times(3P), and on OS X and BSD 
systems it's times(3). Falling back to "man times" without specifying a manual 
section also doesn't work, since this finds the bash builtin rather than the 
library function.

--
assignee: docs@python
components: Documentation
messages: 212424
nosy: docs@python, geoffreyspear
priority: normal
severity: normal
status: open
title: os.times document points to wrong section of non-Linux manual
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue20779] Add pathlib.chown method

2014-02-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Well, I don't know yet, but if we ever want chown() in pathlib, I think it 
should be higher-level and accept symbolic uids as well.

--
nosy: +neologix

___
Python tracker 

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



[issue20805] Error in 3.3 Tutorial

2014-02-28 Thread Peter Otten

Peter Otten added the comment:

No, that's not an error. Given a class MyClass and an instance x of that class

>>> class MyClass:
... def f(self): return 42
... 
>>> x = MyClass()

you usually invoke a method like so:
>>> x.f()
42

But it is also possible to break that in two steps
(1) get the "bound method" and store it in a variable for later use:

>>> xf = x.f

(2) call the "bound method" as often as you like:
>>> xf()
42
>>>

"bound method" means that the method "remembers" the instance it is associated 
with (x in the above example).

Gene, while you are still learning the language please ask on the python-tutor 
mailing list first before resorting to the bug tracker.

--
nosy: +peter.otten

___
Python tracker 

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



[issue20568] Pass --default-install to ensurepip in the Windows installers

2014-02-28 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Sorry, I had not noticed this issue so far. The patch looks fine, please apply.

--

___
Python tracker 

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



[issue20807] 3.4 cherry pick: 82ec02db7fe6 & ec42ab5e0cb3 Windows installer fixes

2014-02-28 Thread Nick Coghlan

New submission from Nick Coghlan:

Larry, these two commits are the fixes for issue 20757 (making sure Windows 
uninstallation still works even if the user has independently updated pip) and 
issue 20568 (making sure the bare "pip" command is installed on Windows).

Their NEWS entries are in the 3.4.1 section on default, so that will likely 
need some tweaks.

--
assignee: larry
components: Windows
messages: 212431
nosy: larry, loewis, ncoghlan
priority: release blocker
severity: normal
stage: commit review
status: open
title: 3.4 cherry pick: 82ec02db7fe6 & ec42ab5e0cb3 Windows installer fixes
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue20807] 3.4 cherry pick: 82ec02db7fe6 & ec42ab5e0cb3 Windows installer fixes

2014-02-28 Thread STINNER Victor

STINNER Victor added the comment:

Changesets 82ec02db7fe6 and ec42ab5e0cb3 (to get the link).

--
nosy: +haypo

___
Python tracker 

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



[issue20568] Pass --default-install to ensurepip in the Windows installers

2014-02-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ec42ab5e0cb3 by Nick Coghlan in branch 'default':
Close #20568: install unversioned pip command on Windows
http://hg.python.org/cpython/rev/ec42ab5e0cb3

--
nosy: +python-dev
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue17128] OS X system openssl deprecated - installer should build local libssl

2014-02-28 Thread Ronald Oussoren

Ronald Oussoren added the comment:

AFAIK OpenSSL has hooks that can be called when a certificate needs to be 
validated. If I my memory is correct this could be used to validate 
certificates using a public API (basically doing the same as Apple's patch, but 
using public APIs for the system and OpenSSL).

This has one significant risk though: as we've found at a couple of times (such 
as with the _scproxy extension) Apple's API don't necessary play along nicely 
when you use execv without fork or fork without execv :-(. I have no idea if 
Apple's preferred crypto APIs suffer from this problem.

--

___
Python tracker 

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



[issue20757] 3.4rc2 Traceback on Windows pip uninstall

2014-02-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 82ec02db7fe6 by Nick Coghlan in branch 'default':
Close #20757: return success for skipped pip uninstall
http://hg.python.org/cpython/rev/82ec02db7fe6

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue7503] multiprocessing AuthenticationError "digest sent was rejected" when pickling proxy

2014-02-28 Thread Richard Oudkerk

Changes by Richard Oudkerk :


--
assignee:  -> sbt

___
Python tracker 

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



[issue20803] struct.pack_into writes 0x00 for pad bytes

2014-02-28 Thread R. David Murray

R. David Murray added the comment:

Contrawise, I would have found it very surprising if it had not padded with 
null bytes, but yes, the docs could be explicit about it by saying that 'x' 
padding means inserting null bytes.

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread R. David Murray

R. David Murray added the comment:

Since the point of a sentinel is *object identity*, there is no way that you 
can get the "same" sentinel back after a pickle.  This is fundamental to the 
nature of pickle.

--
nosy: +michael.foord, r.david.murray

___
Python tracker 

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



[issue20805] Error in 3.3 Tutorial

2014-02-28 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20792] IDLE: Extend tests for PathBrowser

2014-02-28 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

test_DirBrowserTreeItem (idlelib.idle_test.test_pathbrowser.PathBrowserTest) 
... ok
test_PathBrowserTreeItem (idlelib.idle_test.test_pathbrowser.PathBrowserTest) 
... ok

--
Ran 2 tests in 0.008s

OK


As suggested in msg212348 and msg212363,i have removed the proposed changes to 
variable names (see msg212343)

Added tests as described in msg212343
Added a working test dialog for visual testing the PathBrowserDialog.(This 
feature was not working as far as i know)

--
Added file: http://bugs.python.org/file34254/pathbrowser2.patch

___
Python tracker 

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



[issue20806] os.times document points to wrong section of non-Linux manual

2014-02-28 Thread R. David Murray

R. David Murray added the comment:

section 2 is the linux man page (system calls).  On the other hand, on a 
freebsd 6.4 system I have access to, 'man times' does show the man 3 page.

Since linux normally ships with the posix man pages as well, we should probably 
change the the section reference to 3p.

I also notice that os/2 is mentioned in the python3 entry for os.times, but 
os/2 is no longer supported.

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



[issue20731] Python 3.3.4: SyntaxError with correct source code encoding # -*- coding: latin-1 -*-

2014-02-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ade5e4922a54 by Martin v. Löwis in branch '3.3':
Issue #20731: Properly position in source code files even if they
http://hg.python.org/cpython/rev/ade5e4922a54

--
nosy: +python-dev

___
Python tracker 

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



[issue20731] Python 3.3.4: SyntaxError with correct source code encoding # -*- coding: latin-1 -*-

2014-02-28 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Thanks for the patch, this is applied to 3.3 and 3.4.

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



[issue19021] AttributeError in Popen.__del__

2014-02-28 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

I've testing this patch on Ubuntu, and it seems to fix the problem.  My quick 
testing doesn't show any new problems, but we'll only know for sure once the 
new Python 3.4 package hits the archive and folks start updating to it.  So far 
so good though.

Larry, please consider cherry picking this into 3.4.0 final.

--

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread Vlastimil Zíma

Vlastimil Zíma added the comment:

I don't question pickle, but I'd expect sentinels to keep their equality when 
they are pickled or copied.

--

___
Python tracker 

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



[issue20650] asyncio.BaseEventLoop.run_in_executor docs have awkward wording

2014-02-28 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20650] asyncio.BaseEventLoop.run_in_executor docs have awkward wording

2014-02-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2dd7b9618596 by Brett Cannon in branch 'default':
Issue #20650: Tweak some awkward wording.
http://hg.python.org/cpython/rev/2dd7b9618596

--
nosy: +python-dev

___
Python tracker 

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



[issue19021] AttributeError in Popen.__del__

2014-02-28 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Nosying Doko, since I think he may want to get this fix into Debian, if Larry 
does not cherry pick it into 3.4.0 final.

--
nosy: +doko

___
Python tracker 

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



[issue20808] 3.4 cherry pick: 6a1711c96fa6 (Popen.__del__ traceback)

2014-02-28 Thread Barry A. Warsaw

New submission from Barry A. Warsaw:

This commit fixes the traceback we're seeing on Ubuntu with Python 3.4, in 
Popen.__del__ on interpreter shutdown.

--
assignee: larry
components: Interpreter Core
messages: 212443
nosy: barry, doko, larry
priority: release blocker
severity: normal
stage: commit review
status: open
title: 3.4 cherry pick: 6a1711c96fa6 (Popen.__del__ traceback)
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue20808] 3.4 cherry pick: 6a1711c96fa6 (Popen.__del__ traceback)

2014-02-28 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

http://bugs.python.org/issue19021

--

___
Python tracker 

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



[issue20731] Python 3.3.4: SyntaxError with correct source code encoding # -*- coding: latin-1 -*-

2014-02-28 Thread STINNER Victor

STINNER Victor added the comment:

Regressions on buildbots, examples:

http://buildbot.python.org/all/builders/x86%20OpenIndiana%203.3/builds/1458
http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.3/builds/1546
http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.3/builds/464
etc.

--
nosy: +haypo

___
Python tracker 

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



[issue20725] Fail to build on Windows x64 with VS Express

2014-02-28 Thread Zachary Ware

Zachary Ware added the comment:

Since I can't reproduce, I'm going to go ahead and close the issue.  If you can 
reproduce it after following the steps I laid out in my previous message, 
please re-open this issue.

--
components: +Windows
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
type:  -> compile error

___
Python tracker 

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



[issue20778] ModuleFinder.load_module skips incorrect number of bytes in pyc files

2014-02-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 432cb56db05d by Brett Cannon in branch '3.3':
Issue #20778: Fix modulefinder to work with bytecode-only modules.
http://hg.python.org/cpython/rev/432cb56db05d

New changeset b6e999c8907c by Brett Cannon in branch 'default':
merge for issue #20778
http://hg.python.org/cpython/rev/b6e999c8907c

--
nosy: +python-dev

___
Python tracker 

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



[issue20778] ModuleFinder.load_module skips incorrect number of bytes in pyc files

2014-02-28 Thread Brett Cannon

Brett Cannon added the comment:

Fixed in Python 3.3.6 and 3.4.1.

Bohuslav, could you sign the contributor agreement at 
http://www.python.org/psf/contrib/contrib-form/ ? While I didn't directly use 
your patch this time I noticed you are already in Misc/ACKS so it would be 
helpful if you could sign the document.

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20778] ModuleFinder.load_module skips incorrect number of bytes in pyc files

2014-02-28 Thread Bohuslav "Slavek" Kabrda

Bohuslav "Slavek" Kabrda added the comment:

Brett, I signed it just yesterday, it probably wasn't processed yet. Hopefully 
it will be in few days. Thanks for patching this!

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

___
Python tracker 

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



[issue20778] ModuleFinder.load_module skips incorrect number of bytes in pyc files

2014-02-28 Thread Bohuslav "Slavek" Kabrda

Bohuslav "Slavek" Kabrda added the comment:

Whoops, reopened by accident. Closing again.

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



[issue10984] argparse add_mutually_exclusive_group should accept existing arguments to register conflicts

2014-02-28 Thread Shriramana Sharma

Changes by Shriramana Sharma :


--
nosy: +jamadagni

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread R. David Murray

R. David Murray added the comment:

Sentinels are not equal unless they are the *same object*, just as for any 
python object that does not have a defined __eq__.  And as I said, this is part 
of the point of sentinels.

--

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread Michael Foord

Michael Foord added the comment:

Maybe making sentinels unpickleable would be a better solution. On the other 
hand I'd love to be able to [properly] customise object creation when 
unpickling. It would solve various other problems I've had from time to time. 
But that's well outside the scope of this bug.

--

___
Python tracker 

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



[issue20786] inspect.getargspec() returns wrong answer with property.__delete__()

2014-02-28 Thread Yury Selivanov

Yury Selivanov added the comment:

Larry, Nick, what do you think?
I'd like this to be fixed in 3.4.0...

--

___
Python tracker 

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



[issue20807] 3.4 cherry pick: 82ec02db7fe6 & ec42ab5e0cb3 Windows installer fixes

2014-02-28 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +yselivanov

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread R. David Murray

R. David Murray added the comment:

In case anyone is wondering, I'm leaving this open in case Michael thinks it is 
a good idea to add some sort of documentation note about this.  I'm not sure it 
is, because this is fundamental to the way Python works.  On the other hand, I 
can't think of any specific manual or tutorial section we could direct someone 
to to get an explanation of what is going on.

This one comes close: 
http://docs.python.org/2/faq/programming.html#how-can-my-code-discover-the-name-of-an-object
 but doesn't tell the whole story since it doesn't cover pickle.

--

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread R. David Murray

R. David Murray added the comment:

Our posts crossed.

Making them unpickleable sounds like it might be sensible.  Since the sentinel 
*can't* survive pickling/unpickling and still perform its documented function, 
it seems better to raise an error if someone tries.

--

___
Python tracker 

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



[issue19570] distutils' Command.ensure_dirname fails on Unicode

2014-02-28 Thread Matt Riedemann

Matt Riedemann added the comment:

For what it's worth, I'm building openstack docs on master (icehouse-3) for 
ceilometer, nova, cinder, heat, glance, keystone, and neutron (plus the 
clients) using sphinx 1.2.1 without this problem (unless I'm just not aware of 
it?).  Anyway, I came across that from this github change for openstack's 
global-requirements:

https://github.com/openstack/requirements/commit/0e8862e958813a031fe7398440e8a3866b42a8e4

--
nosy: +mriedem

___
Python tracker 

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



[issue20809] isabspath fails if path is None

2014-02-28 Thread <--This Guy

New submission from <--This Guy:

So far I've noticed this is only reproducible when running quickly with 
python2.7. Still, the error message seems like it would be confusing to new 
users to Python.

user@host:~/foo/bar/project$ sudo python setup.py install
DEBUG: Adding /foo/bar/project to system path.
ERROR: Python module settings not found
ERROR: Python module settings not found
 # basically, more DistUtilsExtra errors...
running install
DEBUG: Adding /foo/bar/project to system path.
running build
running build_py
running build_scripts
running build_i18n
DEBUG: Desktop files: ['project.desktop.in']
intltool-update -p -g ryode
running build_icons
running build_help
running install_lib
copying build/lib/__init__.py -> /usr/local/lib/python2.7/site-packages
copying build/lib/ryode/__init__.py -> 
/usr/local/lib/python2.7/site-packages/ryode
byte-compiling /usr/local/lib/python2.7/site-packages/__init__.py to 
__init__.pyc
byte-compiling /usr/local/lib/python2.7/site-packages/ryode/__init__.py to 
__init__.pyc
running install_scripts
copying build/scripts-2.7/project -> /usr/local/bin
changing mode of /usr/local/bin/project to 775
running install_data
copying build/share/applications/project.desktop -> 
/usr/local/share/applications
running install_egg_info
Removing /usr/local/lib/python2.7/site-packages/project-0.1-py2.7.egg-info
Writing /usr/local/lib/python2.7/site-packages/project-0.1-py2.7.egg-info
Traceback (most recent call last):
  File "setup.py", line 144, in 
cmdclass={'install': InstallAndUpdateDataDirectory}
  File 
"/usr/local/lib/python2.7/site-packages/python_distutils_extra-2.38-py2.7.egg/DistUtilsExtra/auto.py",
 line 100, in setup
distutils.core.setup(**attrs)
  File "/usr/local/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
  File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
  File "setup.py", line 116, in run
target_data = '/' + os.path.relpath(self.install_data, self.root) + '/'
  File "/usr/local/lib/python2.7/posixpath.py", line 437, in relpath
start_list = [x for x in abspath(start).split(sep) if x]
  File "/usr/local/lib/python2.7/posixpath.py", line 367, in abspath
if not isabs(path):
  File "/usr/local/lib/python2.7/posixpath.py", line 61, in isabs
return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'

--
components: Build
messages: 212457
nosy: jordannh
priority: normal
severity: normal
status: open
title: isabspath fails if path is None
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



[issue10984] argparse add_mutually_exclusive_group should accept existing arguments to register conflicts

2014-02-28 Thread Shriramana Sharma

Shriramana Sharma added the comment:

I also wish to see argparse allowing me to define a group of arguments that 
conflict with another argument or another group of arguments and FWIW I feel 
the help output should be like:

prog [ --conflicter | [ --opt1 ] [ --opt2 ] ]

where --conflicter conflicts with --opt1 and --opt2 but those two don't 
conflict with each other and all are optional.

--

___
Python tracker 

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



[issue20809] isabspath fails if path is None

2014-02-28 Thread <--This Guy

Changes by <--This Guy :


--
keywords: +patch
Added file: 
http://bugs.python.org/file34255/issue20809-nontype-object-has-no-attribute-startswith.patch

___
Python tracker 

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



[issue20793] locale.setlocale()

2014-02-28 Thread René Fleschenberg

René Fleschenberg added the comment:

I see. Thanks for the information.

--

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread Peter Otten

Peter Otten added the comment:

>From looking at the sentinel code it appears a sentinel's identity is 
>controlled by its name alone, i. e.

sentinel.foo is sentinel.foo

If that's the desired behaviour it is well possible to make that indentity 
survive pickling. I have attached a demo script using the simplest approach -- 
registering the class with copyreg.
If you like the general idea I'm willing to look up the alternative (a 
__getstate__() or __reduce__() method), too ;)

--
nosy: +peter.otten
Added file: http://bugs.python.org/file34256/pickle_sentinels.py

___
Python tracker 

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



[issue20727] Improved roundrobin itertools recipe

2014-02-28 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread R. David Murray

R. David Murray added the comment:

Personally I think that's a bad idea.  Anything that implies that object 
identity can survive pickle/unpickle is IMO bad, since pickle is a 
serialization protocol and in real life (as opposed to tests) the process that 
does the unpickle is almost always not the process that does the pickle.

--

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread Peter Otten

Peter Otten added the comment:

I have no experience with unittest.mock, so I'm in no position to contradict... 
Vlastimil, could you give your use case?

--

___
Python tracker 

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



[issue20810] literal re fails to match

2014-02-28 Thread Jonathan Epstein

New submission from Jonathan Epstein:

All 3 of these regex's should match, but in practice only m2 does.  Found deep 
in the bowels of debugging a larger problem.


import re

mainProjectsPath = '/groups/larvalolympiad/larvalolympiad/Projects/'

m1 = re.match('larvalolympiad',mainProjectsPath)
m2 = re.match('.*larvalolympiad.*',mainProjectsPath)
m3 = re.match('/larvalolympiad/',mainProjectsPath)

print(m1)
print(m2)
print(m3)

--
components: Regular Expressions
messages: 212463
nosy: Jonathan.Epstein, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: literal re fails to match
type: behavior
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue20810] literal re fails to match

2014-02-28 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +yselivanov

___
Python tracker 

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



[issue20809] isabspath receiving path value on None in ditdutils.dist.py

2014-02-28 Thread Steve Holden

Steve Holden added the comment:

I hope the title change is helpful. It's not clear from the report what module 
is being installed, or even whether that is a relevant factor.

--
nosy: +holdenweb
title: isabspath fails if path is None -> isabspath receiving path value on 
None in ditdutils.dist.py

___
Python tracker 

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



[issue20809] isabspath receiving path value of None in ditdutils.dist.py

2014-02-28 Thread Steve Holden

Steve Holden added the comment:

Typo, sorry

--
title: isabspath receiving path value on None in ditdutils.dist.py -> isabspath 
receiving path value of None in ditdutils.dist.py

___
Python tracker 

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



[issue20809] isabspath receiving path value of None in distutils.dist.py

2014-02-28 Thread Steve Holden

Steve Holden added the comment:

Further typo, sorry again.

--
title: isabspath receiving path value of None in ditdutils.dist.py -> isabspath 
receiving path value of None in distutils.dist.py

___
Python tracker 

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



[issue20809] isabspath receiving path value of None in distutils.dist.py

2014-02-28 Thread Steve Holden

Steve Holden added the comment:

The submitted patch does not approach the issue, since the real question is WHY 
is the function being passed a None argument in the first place. Without 
extensive testing there would be no guarantees that this change would not 
result in breakage elsewhere.

--

___
Python tracker 

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



[issue20810] literal re fails to match

2014-02-28 Thread Eric V. Smith

Eric V. Smith added the comment:

re.match requires a match at the beginning of the string. From the docs: "If 
zero or more characters at the beginning of string match the regular expression 
pattern, ...".

If you switch to re.search, they'll all match:

>>> re.search('larvalolympiad',mainProjectsPath)
<_sre.SRE_Match object at 0xffed54f0>

>>> re.match('.*larvalolympiad.*',mainProjectsPath)
<_sre.SRE_Match object at 0xffed5870>

>>> re.search('/larvalolympiad/',mainProjectsPath)
<_sre.SRE_Match object at 0xffed54f0>

--
nosy: +eric.smith

___
Python tracker 

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



[issue20810] literal re fails to match

2014-02-28 Thread Eric V. Smith

Changes by Eric V. Smith :


--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue20810] literal re fails to match

2014-02-28 Thread Jonathan Epstein

Jonathan Epstein added the comment:

Sorry, this was dumb.  Thanks for your patience.

On Fri, Feb 28, 2014 at 2:23 PM, Eric V. Smith wrote:

>
> Eric V. Smith added the comment:
>
> re.match requires a match at the beginning of the string. From the docs:
> "If zero or more characters at the beginning of string match the regular
> expression pattern, ...".
>
> If you switch to re.search, they'll all match:
>
> >>> re.search('larvalolympiad',mainProjectsPath)
> <_sre.SRE_Match object at 0xffed54f0>
>
> >>> re.match('.*larvalolympiad.*',mainProjectsPath)
> <_sre.SRE_Match object at 0xffed5870>
>
> >>> re.search('/larvalolympiad/',mainProjectsPath)
> <_sre.SRE_Match object at 0xffed54f0>
>
> --
> nosy: +eric.smith
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue20035] Suppress 'os.environ was modified' warning on Tcl/Tk tests

2014-02-28 Thread Zachary Ware

Zachary Ware added the comment:

Terry J. Reedy added the comment:
> However, rather than require a tearDowmnodule for every module that imports
​> ​tkinter, lets fix the root problem.

I agree that that would be the ideal solution.

> I thought of having the environment change warning function ignore changes to
​> ​TCL/TK/TIX_LIBRARY, but even better would be to not change them. Rename 
_fix 
> to ​_dirs and redefine its mission as setting and holding three module
> attributes: ​tcldir, tkdir, and tixdir. They would be set from either the 
> environment or the ​alternate search code. Any other modules that need the
> info should get it from ​_dirs rather the environment.

Unfortunately, environment variables are the easiest way to tell Tcl/Tk where 
to find init.tcl/tk.tcl.  Digging around in tclBasic.c and tkWindow.c, it looks 
like it should be possible to provide our own values for where to find the 
libraries, but it doesn't look especially easy.  It looks like it has to be 
done somewhere between Tcl_CreateInterp() and Tcl_Init(), which means it has to 
be done in _tkinter.c.

> I believe this part of _fix is buggy.
> +if "TCL_LIBRARY" not in os.environ:
> +for name in os.listdir(prefix):
> +if name.startswith("tcl"):
> +tcldir = os.path.join(prefix,name)
> +if os.path.isdir(tcldir):
> +os.environ["TCL_LIBRARY"] = tcldir
> Both base/tcl and base/../tcktk/lib contain (for 3.4) directories named tcl8
> and​ tcl8.6. Since only tcl8.6 works, the code above depends on listdir
> presenting it​ second. The 'if name' clause could be augmented with
> 'and name[-2] == '.'.

Actually, setting TCL_LIBRARY to either one (full path to tcl8 or tcl8.6) or, 
in fact, the same path without any version qualifier at all, works (tested by 
manually setting the variables before calling tkinter.Tk()).  It looks like Tcl 
checks for a folder with the right version number on its own.

Also, from testing with installed 2.7, 3.3, and 3.4rc1, it looks like we only 
really need to set TCL_LIBRARY anyway: setting TK_LIBRARY and TIX_LIBRARY to 
'.', properly setting TCL_LIBRARY, and then calling tkinter.Tk(), the expected 
toplevel window pops up and root.tk.eval('package require Tix') returns the 
expected version number from Tix.

I'm convinced that my initial patches in this issue are the wrong way to attack 
the problem.  I'll look into changing _tkinter.c to do the job of tkinter._fix 
without changing environment variables, hopefully we can just do away with _fix 
entirely.

--

___
Python tracker 

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



[issue20809] isabspath receiving path value of None in distutils.dist.py

2014-02-28 Thread Ned Deily

Ned Deily added the comment:

The particular error you see is caused by code in the setup.py file of the 
project you are installing. I suggest you figure out what's going on there:

File "setup.py", line 116, in run
target_data = '/' + os.path.relpath(self.install_data, self.root) + '/'

--
nosy: +ned.deily
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue6598] calling email.utils.make_msgid frequently has a non-trivial probability of generating colliding ids

2014-02-28 Thread Varun Sharma

Changes by Varun Sharma :


--
nosy: +varun

___
Python tracker 

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



[issue19085] Add tkinter basic options tests

2014-02-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Net, Vajrasky and Zachary for your help for testing.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue1508475] transparent gzip compression in urllib

2014-02-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Victor, the patch looks good and would be a welcome enhancement.

There should be an option for turning this on and off (perhaps, I want the 
zipped content and want to unzip later or in a different thread).

Consider adding support for "deflate" as well.

--
nosy: +rhettinger

___
Python tracker 

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



[issue20501] fileinput module will read whole file into memory when using fileinput.hook_encoded

2014-02-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

My bad. I had cleaned patch before committing to 3.x, but forgot to revert and 
correct it in 2.7. Thank you Vajrasky an Zachary.

> Does it mean: "UTF-7 is an unlikely locale encoding"?

Sorry for my bad English. I meant that UTF-7 is used here because it is 
unlikely that it is locale encoding. Is "an" needed here?

> I would actually vote for using writeTmp, and make a new issue for making 
> writeTmp use a context manager.

I think that explicit two-line code is better than calling superfluous 
function. We don't need generated filename, we write only one chunk of code, we 
use context manager, so the code is only two lines long.

> inside a `try ... except UnicodeDecodeError: self.fail('Read to end of 
> file')` block.

May be, but in 2.7 a traceback doesn't contain info about original exception 
and this can hide necessary details in case of failure.

--

___
Python tracker 

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



[issue19021] AttributeError in Popen.__del__

2014-02-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Note that the changeset 6a1711c96fa6 introdused several errors (mostly tests 
failures), so it needs other changesets to fix it. Related changesets which 
should be cherry picked: 6a1711c96fa6, fa160c8145e5, efaf12106d68, 
7ecee9e0dc58, 10ea3125d7b8, 488ccbee6ee6.

--

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread Vlastimil Zíma

Vlastimil Zíma added the comment:

I encountered this problem when I tested code with cache, something like

def test_foo(self):
cache.set('a_key', sentinel.status) # Performs pickle
self.assertEqual(
cache.get('a_key'), # Performs unpickle
sentinel.status)

I spent some time searching for reason why the test failed. Since both 
sentinels represent themselves as 'sentinel.status', I was quite surprised by 
assertion failure. Only after I looked at the code I realized where is the 
problem. Two sentinels are equal if and only if they are identical.

On my way home I realized this probably is and needs to be a feature of 
sentinels. Consider testing this function:

def foo(value, do_copy):
if do_copy:
return bar(copy(value))
else:
return bar(value)

You would like to know whether `bar` was called with value or its copy. 
Sentinel is in a test for such function a great option to make sure `value` is 
not copied in process. This is especially usefull is you write tests for 
wrapper-like function which should only pass arguments (or a subset) to other 
interface.


After reading through comments and thinking about the problem I have following 
opinions:
 * Sentinels should not actually survive pickle/unpickle. 
 * Prevent sentinels from being pickled is a good idea, it is a valid way to 
tell developer he does something he shouldn't. This might also apply to 
copying, which would result in the same problem.
 * It should be noted in documentation that sentinels are equal only if 
identical. Since they represent themselves by their name it is hard to guess 
the name is only for the representation. Also I find the documentation snippet

>>> assert result is sentinel.some_object

somewhat misleading as you don't usually use 'is' for comparison and it 
provides no information about equality.

--

___
Python tracker 

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



[issue19021] AttributeError in Popen.__del__

2014-02-28 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Feb 28, 2014, at 09:42 PM, Serhiy Storchaka wrote:

>Note that the changeset 6a1711c96fa6 introdused several errors (mostly tests
>failures), so it needs other changesets to fix it. Related changesets which
>should be cherry picked: 6a1711c96fa6, fa160c8145e5, efaf12106d68,
>7ecee9e0dc58, 10ea3125d7b8, 488ccbee6ee6.

Interestingly enough, the test failures don't seem to break the build, but do
seem to break the "DEP 8" tests, which are run on the built package and must
pass before the package is promoted to the primary archive.  It takes quite a
while to build Python for Ubuntu (since we do several builds, e.g. debug
builds, etc. along with all the tests), so I've just noticed this.

Thanks for listing the additional revisions that need to be cherry picked.  I
will investigate for Ubuntu, but it does convince me more that Larry should
attempt to pull these into 3.4.0.

--

___
Python tracker 

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



[issue20811] str.format for fixed width float can return a string longer than the maximum specified

2014-02-28 Thread aubmoon

New submission from aubmoon:

"{:+10.8}".format(0.12345678)

returns

'+0.12345678' (11 chars)

should return

'+.12345678' (10 chars)

--
messages: 212478
nosy: aubmoon
priority: normal
severity: normal
status: open
title: str.format for fixed width float can return a string longer than the 
maximum specified
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue20811] str.format for fixed width float can return a string longer than the maximum specified

2014-02-28 Thread Ned Deily

Ned Deily added the comment:

I think you are misunderstanding the meaning of the width component (e.g. the 
10 in your example) of a format specification.  As described in the 
documentation, width is a decimal integer defining the *minimum* field width, 
not the *maximum* field width.  As necessary, the generated field will be as 
long as necessary to represent the item as requested by the format spec, but it 
will be at least "width" characters long.

http://docs.python.org/3.3/library/string.html#format-specification-mini-language

--
nosy: +ned.deily
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20501] fileinput module will read whole file into memory when using fileinput.hook_encoded

2014-02-28 Thread Zachary Ware

Zachary Ware added the comment:

For the UTF-7 comment, I'd go with something like "locale encoding is probably 
not UTF-7" or "UTF-7 is a convenient, seldom used encoding", or something to 
that effect.

About writeTmp vs. context manager: as you wish.  It would still be good to 
convert writeTmp to use a context manager though, but that is a separate issue. 
 Just cleaning up 2.7 to match 3.x is enough to make me happy :)

For the explicit failure message, perhaps the best we can do in 2.7 is a 
comment saying that the most likely failure is a UnicodeDecodeError due to the 
entire file being read when it shouldn't have been.  That can be deduced from 
the separate comments you already have there (and especially from the issue 
link), but I think it may be better to just come right out and say it.  If 
exception chaining means the original exception is kept with a self.fail call 
in 3.x, I think 3.x should get the explicit failure message, though.  I don't 
feel too strongly about it, though; I'll leave it to you to change or not as 
you like :)

--

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-02-28 Thread R. David Murray

R. David Murray added the comment:

Yes, exactly, you don't use is for equality comparison.  It tests object 
identity, which is why it makes sense to use it with a sentinel.

The 'name' of the sentinel is purely a way to store and retrieve particular 
sentinel objects.  The sentinel itself does not have a name.

Good point about copy...the copy protocol and the pickle protocol are closely 
related, so preventing a sentinel from being pickled may prevent it from being 
copied as well.  It is an interesting question how surprising people will find 
it for a sentinel to throw an error if an attempt is made to copy it, but if 
the test is using a sentinel, presumably it expects the sentinel to survive 
unchanged, so an error on copy is probably a reasonable result.  You could 
imagine someone wanting to use a sentinel to test that copy happens by making 
sure they get back a different object, though, so it is not entirely clear cut. 
 However, I expect that to be *much* less common than wanting to use it to 
prove that an object is preserved (not copied).

--

___
Python tracker 

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



[issue10984] argparse add_mutually_exclusive_group should accept existing arguments to register conflicts

2014-02-28 Thread paul j3

paul j3 added the comment:

In http://bugs.python.org/issue11588 (Add "necessarily inclusive" groups to 
argparse) I propose a generalization to these testing groups that would solve 
your 'conflicter' case as follows:

usage = 'prog [ --conflicter | [ --opt1 ] [ --opt2 ] ]'
parser = argparse.ArgumentParser(usage=usage)
conflicter = parser.add_argument("--conflicter", action='store_true')
opt1 = parser.add_argument("--opt1", action='store_true')
opt2 = parser.add_argument("--opt2", action='store_true')

@parser.crosstest
def test(parser, seen_actions, *args):
if conflicter in seen_actions:
if 0

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



[issue20811] str.format for fixed width float can return a string longer than the maximum specified

2014-02-28 Thread aubmoon

aubmoon added the comment:

Admittedly maximum is not correct; however, minimum is not right either.
The 10 is the desired (or target) width. Fixed width prints are commonly
used with very legacy systems that die a painful death when fixed width
strings are parsed by index and a field has spilled over a column. The
point is that the format returns a string that is longer than the desired
length when a perfectly valid version meets both the format and desired
length (making it more correct). The desired length should only be exceeded
when no solutions can be found. Note the below statement parses without
error. For this reason I feel this is a valid but minor issue. By using a
regular expression or slicing the desired result can be achieved, but with
extra code.
Thanks for the quick response!

-Mark

>>> float('+.12345678')

On Friday, February 28, 2014, Ned Deily  wrote:

>
> Ned Deily added the comment:
>
> I think you are misunderstanding the meaning of the width component (e.g.
> the 10 in your example) of a format specification.  As described in the
> documentation, width is a decimal integer defining the *minimum* field
> width, not the *maximum* field width.  As necessary, the generated field
> will be as long as necessary to represent the item as requested by the
> format spec, but it will be at least "width" characters long.
>
>
> http://docs.python.org/3.3/library/string.html#format-specification-mini-language
>
> --
> nosy: +ned.deily
> resolution:  -> invalid
> stage:  -> committed/rejected
> status: open -> closed
>
> ___
> Python tracker >
> 
> ___
>

--

___
Python tracker 

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



[issue20810] literal re fails to match

2014-02-28 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage:  -> committed/rejected

___
Python tracker 

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



[issue20811] str.format for fixed width float can return a string longer than the maximum specified

2014-02-28 Thread Ned Deily

Ned Deily added the comment:

OK, so the issue is that Python float literals in the range 0.0 < x < 1.0 can 
be spelled without a "0" before the decimal point but the built-in format 
method for floats appears to always output the leading "0" even in cases where 
doing so cause the string to unnecessarily exceed the requested field width.  
It does seem to be a bit of an edge case.  But I don't see anything in the 
current documentation or in PEP 3101 that addresses this case one way or 
another.  Eric, what's your take on this?

--
nosy: +eric.smith
resolution: invalid -> 
stage: committed/rejected -> 
status: closed -> open

___
Python tracker 

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



[issue20812] Explicitly cover application migration in the 2->3 guide

2014-02-28 Thread Nick Coghlan

New submission from Nick Coghlan:

A thread on python-ideas made me realised the migration guide is currently 
missing a section: migrating integrated applications.

This needs to cover:

- "caniusepython3" to check dependencies for compatibility
- if dependencies are ready, and Python 2 compatibility can be dropped 
completely, the 2to3 based migration path
- if dependencies aren't ready yet, the Python 2 -> 2/3 source on Python 2 -> 
2/3 source on Python 3 -> Python 3 migration path
- if dependencies are ready but Python 2 compatibility is still needed, the 
Python 2 only -> 2/3 source on Python 2 or 3 -> Python 3 only migration path

--
messages: 212485
nosy: brett.cannon, ncoghlan
priority: high
severity: normal
stage: needs patch
status: open
title: Explicitly cover application migration in the 2->3 guide
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue20813] Backport revised 2to3 guide to older branches

2014-02-28 Thread Nick Coghlan

New submission from Nick Coghlan:

Brett's updated 2to3 guide is currently only on the default branch. This means 
that the /3/ web docs won't be updated until 3.4 is released later this month 
and the /2/ web docs and the compiled help files shipped with the Windows 
installers for 2.7.x and 3.3.x won't be updated at all.

I don't see a good reason to leave it that way, so I think we should backport 
the updated version wholesale both to get the revised guide available ASAP, and 
also to ensure the /2/ web docs and the shipped compiled HTML docs are updated.

--
keywords: easy
messages: 212486
nosy: brett.cannon, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Backport revised 2to3 guide to older branches
type: enhancement
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue20812] Explicitly cover application migration in the 2->3 guide

2014-02-28 Thread R. David Murray

R. David Murray added the comment:

I'm not sure what your last two points are saying, but my take on both of them 
is the main codebase should move to shared source Python2/Python3 if possible.  
That's what I'm doing for my own projects.  Testing the Python3 compatibility 
depends on whether or not you can write your tests to not depend on the 
non-ported components, but often that is possible.

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



[issue20813] Backport revised 2to3 guide to older branches

2014-02-28 Thread Nick Coghlan

Nick Coghlan added the comment:

We should add the new content in issue 20812 before doing the backport.

--
dependencies: +Explicitly cover application migration in the 2->3 guide

___
Python tracker 

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



[issue20246] buffer overflow in socket.recvfrom_into

2014-02-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c25e1442529f by Stefan Krah in branch '3.1':
Issue #20246: Fix test failures on FreeBSD. Patch by Ryan Smith-Roberts.
http://hg.python.org/cpython/rev/c25e1442529f

New changeset e82dcd700e8c by Stefan Krah in branch '3.2':
Issue #20246: Fix test failures on FreeBSD. Patch by Ryan Smith-Roberts.
http://hg.python.org/cpython/rev/e82dcd700e8c

--

___
Python tracker 

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



[issue20812] Explicitly cover application migration in the 2->3 guide

2014-02-28 Thread Nick Coghlan

Nick Coghlan added the comment:

Expanded version:

For developers of integrated applications that currently still have
some dependencies on Python 2, the preferred migration path is to use
tools like python-modernize or python-future to shift first into the
large common subset of Python 2 and Python 3, and then only later
switch fully to Python 3. This approach permits application developers
to take the following path:

1. Python 2 only (status quo)
2. Python 2/3 compatible on Python 2 (waiting for dependencies)
3. Python 2/3 compatible on Python 3 (dependencies ported or replaced)
4. Python 3 only (drop Python 2 support)

Brett Cannon's "caniusepython3" tool
(https://pypi.python.org/pypi/caniusepython3/) is designed to automate
the dependency analysis to see if all declared dependencies are Python
3 compatible (or have suitable alternatives available). However, if
you're using system packages for dependency management, some data
transformations will be needed to convert them to a form that the tool
understands.
=

>From https://mail.python.org/pipermail/python-ideas/2014-March/026343.html

--

___
Python tracker 

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



[issue20246] buffer overflow in socket.recvfrom_into

2014-02-28 Thread koobs

koobs added the comment:

Thank you Stefan

--

___
Python tracker 

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