[issue22995] Restrict default pickleability

2016-01-07 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: So yeah, I guess Cython is doing something magical to boost the instance's type's basicsize, but I can't tell what from the Python prompt. It also clearly doesn't affect the un/picklability of the instance, so I think the entire check is probably misguided.

[issue26045] Improve error message for http.client when posting unicode string

2016-01-07 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: +gvanrossum ___ Python tracker ___ ___

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: Looks like that Windows buildbot is now green. Of the stable bots only OpenIndiana is red, and it's unrelated. -- ___ Python tracker

[issue19251] bitwise ops for bytes of equal length

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: I'm very skeptical of this. I expect it would cause quite a few surprises for people who aren't used to bitmask operations on integers, let alone on (byte) strings. -- nosy: +gvanrossum ___ Python tracker

[issue19251] bitwise ops for bytes of equal length

2016-01-07 Thread Andrew Barnert
Andrew Barnert added the comment: For what it's worth, I looked at some old code (a clean re-implementation of a crypto algorithm in Python, used as a unit test for production code in C++) and found this: class BytesBits(bytes): # from a quick test, 1.12us in NumPy, 1.39us in C, 2.55us

[issue26046] Typo in documentation of unittest

2016-01-07 Thread Emanuel Barry
Emanuel Barry added the comment: Think you can submit a patch? -- keywords: +easy nosy: +ebarry stage: -> needs patch title: Typo -> Typo in documentation of unittest ___ Python tracker

[issue26046] Typo

2016-01-07 Thread David Sterry
New submission from David Sterry: In https://docs.python.org/2/library/unittest.html#basic-example the word "details" should be "detail". -- assignee: docs@python components: Documentation messages: 257731 nosy: David Sterry, docs@python priority: normal severity: normal status: open

[issue26026] True%2 is True

2016-01-07 Thread Hristo Venev
Hristo Venev added the comment: One last thing: type(a%b) is A, type(b%a) is int. -- ___ Python tracker ___

[issue22088] base64 module still ignores non-alphabet characters

2016-01-07 Thread Martin Panter
Martin Panter added the comment: This new patch applies to Python 3. As well as the above changes, I updated the doc strings based on the changes in 92760d2edc9e (Issue 1753718, Issue 20782), mainly clarifying the data types functions accept and return. Further fixes: * In Python 3,

[issue24870] Optimize ascii and latin1 decoder with surrogateescape and surrogatepass error handlers

2016-01-07 Thread INADA Naoki
INADA Naoki added the comment: FYI, I found a workaround. https://github.com/PyMySQL/PyMySQL/pull/409 _table = [chr(i) for i in range(128)] + [chr(i) for i in range(0xdc80, 0xdd00)] def decode_surroundescape(s): return s.decode('latin1').translate(_table) In [15]: data = b'\xff' * 1024 *

[issue24870] Optimize ascii and latin1 decoder with surrogateescape and surrogatepass error handlers

2016-01-07 Thread STINNER Victor
STINNER Victor added the comment: > In [18]: %timeit decode_surroundescape(data) > 10 loops, best of 3: 40 ms per loop Cool! Good job. -- ___ Python tracker

[issue26032] Use scandir() to speed up pathlib globbing

2016-01-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Library (Lib) dependencies: +File descriptor leaks in os.scandir(), regular files handled as directories in the glob module versions: -Python 3.5 ___ Python tracker

[issue26029] Broken sentence in extending documentation

2016-01-07 Thread Upendra Kumar
Upendra Kumar added the comment: I am submitting the patch with small change suggested by you. Thank you. -- keywords: +patch nosy: +upendra-k14 Added file: http://bugs.python.org/file41524/building_additional.patch ___ Python tracker

[issue26045] Improve error message for http.client when posting unicode string

2016-01-07 Thread Martin Panter
Martin Panter added the comment: After reading through the linked thread, there are a few error message proposals: Guido: "use data.encode('utf-8') if you want the data to be encoded in UTF-8". (Then of course the server might not like it.) Andrew Barnert: A UnicodeEncodeError (or subclass

[issue26045] Improve error message for http.client when posting unicode string

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: Any solution that encodes Unicode in a way that works for some characters but fails for others has the same problem that Unicode had in Python 3. Unfortunately we're stuck with such a solution (Latin-1) and for backwards compatibility reasons we can't

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: Oops, sorry about that. I will see if I can figure out how to repro this -- on my own Mac it succeeds. In the mean time if you could have a look yourself (since you can repro it on your own computer) I'd be grateful. Initial hunches: maybe a

[issue1633941] for line in sys.stdin: doesn't notice EOF the first time

2016-01-07 Thread Dan Kegel
Dan Kegel added the comment: Still present in python 2.7.9, but fixed in python 3.4.3. Also, in python 3.4.3, output is immediate, there seems to be no input buffering. -- nosy: +dankegel ___ Python tracker

[issue5501] Update multiprocessing docs re: freeze_support

2016-01-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset f08d4712a055 by Berker Peksag in branch '3.5': Issue #5501: Clarify that invoking freeze_support() on non-Windows platforms has no effect https://hg.python.org/cpython/rev/f08d4712a055 New changeset 2902f32d1ae9 by Berker Peksag in branch

[issue25672] set SSL_MODE_RELEASE_BUFFERS

2016-01-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset b5b0394ed20b by Benjamin Peterson in branch 'default': merge 3.5 (closes #25672) https://hg.python.org/cpython/rev/b5b0394ed20b -- nosy: +python-dev resolution: -> fixed stage: commit review -> resolved status: open -> closed

[issue26017] Update https://docs.python.org/3/installing/index.html to always quote arguments

2016-01-07 Thread Senthil Kumaran
Senthil Kumaran added the comment: Here is the patch with the changes suggested by Brett. Having created this patch, I had second thoughts on this change. Folks who use pip often, usually use it without any quotes, like `pip install requests`, `pip install CherryPy`. Pinned down versions are

[issue26044] Name mangling overrides externally defined names

2016-01-07 Thread Ethan Furman
Ethan Furman added the comment: Nice work with the debugging. but what you have proved is that Python is behaving exactly as designed [0]. While true that the current implementation does have the pitfall you have discovered, removing it is not worth the cost in complexity. The proper "fix"

[issue26036] Unnecessary arguments on smtpd.SMTPServer

2016-01-07 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

[issue26042] Consider dropping magic number for more detailed .pyc file name

2016-01-07 Thread Brett Cannon
New submission from Brett Cannon: The reason the magic number exists in .pyc files is because back in Python 2 we only had a single .pyc file per module, which meant if you suddenly switched versions of Python you needed a way to know that the .pyc file was wrong for the running version of

[issue26027] Support Path objects in the posix module

2016-01-07 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +brett.cannon ___ Python tracker ___ ___

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4043e08e6e52 by Guido van Rossum in branch '3.4': Add another try/except PermissionError to avoid depending on listdir order. Fix issues #24120 and #26012. https://hg.python.org/cpython/rev/4043e08e6e52 New changeset 8a3b0c1fb3d3 by Guido van

[issue24120] pathlib.(r)glob stops on PermissionDenied exception

2016-01-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4043e08e6e52 by Guido van Rossum in branch '3.4': Add another try/except PermissionError to avoid depending on listdir order. Fix issues #24120 and #26012. https://hg.python.org/cpython/rev/4043e08e6e52 New changeset 8a3b0c1fb3d3 by Guido van

[issue26031] Add stat caching option to pathlib

2016-01-07 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +brett.cannon ___ Python tracker ___ ___

[issue26043] ON DELETE CASCADE does not work when using sqlite3 library

2016-01-07 Thread Vitaminus Maximus
New submission from Vitaminus Maximus: Let me provide a completely reproducible code, which demonstrates the issue: >>> import sqlite3 >>> cnx = sqlite3.connect("mytest.db") >>> cnx.isolation_level = None >>> cursor = cnx.cursor() >>> cnx.execute("BEGIN") >>>

[issue22995] Restrict default pickleability

2016-01-07 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Your explanation still doesn't entirely make sense to me yet because the crash is happening in what seems to be a Cython implementation class, not a generated class based on a .pyx in some other project using Cython. I tried to search the Cython Trac but

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: Should be fixed for real now. -- status: open -> closed ___ Python tracker ___

[issue22995] Restrict default pickleability

2016-01-07 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: You asked what reductor(4) returns in Python 3.5.0: > /usr/lib/python3.5/copy.py(176)deepcopy() -> rv = reductor(4) (Pdb) reductor(4) (, (,), None, None, None) And this is completely reasonable: (Pdb) p rv (, (,), None, None, None) (Pdb) p rv[0](*rv[1])

[issue22995] Restrict default pickleability

2016-01-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm not well known with Cython. Can it replace Python class with extension class on fly? There is a declaration of the NameAssignment class in Cython/Compiler/FlowControl.pxd. We need Cython expert. -- ___ Python

[issue26042] Consider dropping magic number for more detailed .pyc file name

2016-01-07 Thread Eric Snow
Eric Snow added the comment: That's an interesting thought. My intuition is that it wouldn't be worth doing. It would certainly trade one development overhead for another, so it's a bit of a wash there, I think. Are there other spots in the stdlib that rely on the magic number? Is it used

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Martin Panter
Martin Panter added the comment: Thanks, your latest change seems to have fixed it on my Linux computer, and most of the buildbots. However now there is a failure on :

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

2016-01-07 Thread Andrew Barnert
Changes by Andrew Barnert : Added file: http://bugs.python.org/file41527/patch4a.diff ___ Python tracker ___

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: I think I understand the Windows failure. I uncommented some tests that were previously broken due to the symlink loop and/or PermissionError, but one of these has a different expected outcome if symlinks don't work. I've pushed a hopeful fix for that (no

[issue26045] Improve error message for http.client when posting unicode string

2016-01-07 Thread Emil Stenström
New submission from Emil Stenström: This issue is in response to this thread on python-ideas: https://mail.python.org/pipermail/python-ideas/2016-January/037678.html Note that Cory did a lot of encoding background work here:

[issue26042] Consider dropping magic number for more detailed .pyc file name

2016-01-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about zipimport? It doesn't use __pycache__ directories, but just try to read *.pyc file, then *.py file. The launcher on Windows also check magic number (it contains a mapping from magic numbers to Python versions). -- nosy: +serhiy.storchaka

[issue26042] Consider dropping magic number for more detailed .pyc file name

2016-01-07 Thread Brett Cannon
Brett Cannon added the comment: I figured it was a wash. Closing as "won't fix". As for zipimport, it's busted thanks to the fact that it doesn't work with __pycache__ directories. Yet another reason it needs to be rewritten. -- resolution: -> wont fix status: open -> closed

[issue22995] Restrict default pickleability

2016-01-07 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I added some debugging to the if(required) clause. This is interesting: basicsize 16 slotnames 0 basicsize 16 tp_basicsize 80 basicsize 16 tp_basicsize comes in at 16 bytes. tp_dictoffset and tp_weaklistoffset must both be 0, and while slotnames is not