[issue7359] mailbox cannot modify mailboxes in system mail spool

2016-02-07 Thread Mahmoud Hashemi
Mahmoud Hashemi added the comment: Got bit by this, and since it's not a bug, here's "not" a fix: http://boltons.readthedocs.org/en/latest/mboxutils.html#boltons.mboxutils.mbox_readonlydir Been in production for a while, working like a charm. Might there be interest in

[issue25341] File mode wb+ appears as rb+

2015-10-08 Thread Mahmoud Hashemi
Changes by Mahmoud Hashemi <mahm...@hatnote.com>: -- nosy: +mahmoud ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25341> ___ _

[issue24172] Errors in resource.getpagesize module documentation

2015-05-13 Thread Mahmoud Hashemi
New submission from Mahmoud Hashemi: The resource module's description of resource.getpagesize is woefully misguiding. Reproduced in full for convenience: resource.getpagesize() Returns the number of bytes in a system page. (This need not be the same as the hardware page size

[issue24019] str/unicode encoding kwarg causes exceptions

2015-04-23 Thread Mahmoud Hashemi
Mahmoud Hashemi added the comment: I would urge you all take a stronger look at usability, rather than parroting the current state of the design and docs. Python gained renown over the years for its ability to stay flexible while maturing. Focusing on purity and ignoring the needs

[issue24019] str/unicode encoding kwarg causes exceptions

2015-04-21 Thread Mahmoud Hashemi
Mahmoud Hashemi added the comment: Python already has one approach that fails to decode non-bytestrings: the .decode() method. This is about removing unicode barriers to entry and making the str constructor in Python 3 as succinctly useful as possible. There are several problems the helper

[issue24019] str/unicode encoding kwarg causes exceptions

2015-04-21 Thread Mahmoud Hashemi
Mahmoud Hashemi added the comment: Martin, it sounds that way because that is what is being proposed: Merging and simplifying the two modes. Given the existence of .decode() on bytestrings, the only objects that generally need decoding in Python 2 and 3, the existence of str/unicode's second

[issue24019] str/unicode encoding kwarg causes exceptions

2015-04-20 Thread Mahmoud Hashemi
New submission from Mahmoud Hashemi: The encoding keyword argument to the Python 3 str() and Python 2 unicode() constructors is excessively constraining to the practical use of these core types. Looking at common usage, both these constructors' primary mode is to convert various objects

[issue23479] str.format() breaks object duck typing

2015-02-18 Thread Mahmoud Hashemi
New submission from Mahmoud Hashemi: While porting some old code, I found some interesting misbehavior in the new-style string formatting. When formatting objects which support int and float conversion, old-style percent formatting works great, but new-style formatting explodes hard. Here's

[issue23479] str.format() breaks object duck typing

2015-02-18 Thread Mahmoud Hashemi
Changes by Mahmoud Hashemi mahm...@hatnote.com: -- nosy: +Mark.Williams ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23479 ___ ___ Python-bugs

[issue23479] str.format() breaks object duck typing

2015-02-18 Thread Mahmoud Hashemi
Mahmoud Hashemi added the comment: Well, thank you for the prompt and helpful replies everyone. Can't say I didn't wish the default behavior were more intuitive, but at least I think I have an idea how to work this. Thanks again! -- resolution: not a bug - status: closed - open

[issue17911] traceback: add a new thin class storing a traceback without storing local variables

2015-02-10 Thread Mahmoud Hashemi
Mahmoud Hashemi added the comment: Hey all, great to see this being worked on so diligently for so long. Having worked in this area for a while (at home and at PayPal), we've got a few learnings to share: 1) linecache is textbook not-threadsafe. For example, https://hg.python.org/cpython

[issue13787] PyCode_New not round-trippable (TypeError)

2012-01-17 Thread Mahmoud Hashemi
Mahmoud Hashemi mak...@gmail.com added the comment: Yes, I knew it was an issue with crossed wires somewhere. The Python 2 code doesn't translate well to Python 3 because the function signature changed to add kwargonlycount. And I guess the argument order is substantially different, too

[issue12949] Documentation of PyCode_New() lacks kwonlyargcount argument

2012-01-14 Thread Mahmoud Hashemi
Changes by Mahmoud Hashemi mak...@gmail.com: -- nosy: +mahmoud ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12949 ___ ___ Python-bugs-list

[issue13787] PyCode_New not round-trippable (TypeError)

2012-01-14 Thread Mahmoud Hashemi
New submission from Mahmoud Hashemi mak...@gmail.com: On Python 3.1.4, attempting to create a code object will apparently result in a TypeError (must be str, not tuple), even when you're creating a code object from another, working code object: # co_what.py def foo(): return 'bar' co

[issue13787] PyCode_New not round-trippable (TypeError)

2012-01-14 Thread Mahmoud Hashemi
Mahmoud Hashemi mak...@gmail.com added the comment: And here's the working Python 2 version (works fine on Python 2.7, and likely a few versions prior). -- Added file: http://bugs.python.org/file24240/co_what2.py ___ Python tracker rep