[issue25913] base64.a85decode adobe flag incorrectly utilizes <~ as a marker causing error

2016-02-20 Thread Martin Morrison
Martin Morrison added the comment: 3.patch looks good to me. -- ___ Python tracker <http://bugs.python.org/issue25913> ___ ___ Python-bugs-list mailing list Unsub

[issue25913] base64.a85decode adobe flag incorrectly utilizes <~ as a marker causing error

2015-12-22 Thread Martin Morrison
Martin Morrison added the comment: The proposed patch does stop requiring the leading <~, but still trims the first two characters off the data set. This will no doubt fail in cases where there is no leading marker. I think it will need to explicitly handle the case where the leading mar

[issue21999] shlex: bug in posix more handling of empty strings

2014-07-17 Thread Martin Morrison
Changes by Martin Morrison : Added file: http://bugs.python.org/file35984/shlex.2.7.patch ___ Python tracker <http://bugs.python.org/issue21999> ___ ___ Python-bugs-list m

[issue21999] shlex: bug in posix more handling of empty strings

2014-07-17 Thread Martin Morrison
New submission from Martin Morrison: Minimal testcase of the problem situation is tokenising (with posix mode on): ''), Specifically, an empty string, followed by a non-word character, followed by a non-space character. In this case, the token buffer is empty and due to a missing

[issue17950] Dynamic classes contain non-breakable reference cycles

2013-05-13 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz, pconnell ___ Python tracker <http://bugs.python.org/issue17950> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17927] Argument copied into cell still referenced by frame

2013-05-12 Thread Martin Morrison
Martin Morrison added the comment: The latest diff (cellfree4.diff) applies correctly to 3.3 (one hunk fails, but it's just the one where you've removed a blank line). The tests also pass successfully with the diff applied. -- ___ Pyth

[issue17927] Argument copied into cell still referenced by frame

2013-05-10 Thread Martin Morrison
Martin Morrison added the comment: Our usage of Python would certainly benefit from the backport. We are embedding Python 3.3 in a system with requirements that lead us to disable the gc in most cases, so cycles are an obvious problem for us. Cycles created inadvertently, such as this, are

[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2013-05-02 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue7475> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17170] string method lookup is too slow

2013-05-01 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue17170> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1195571] simple callback system for Py_FatalError

2013-04-23 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz, pconnell ___ Python tracker <http://bugs.python.org/issue1195571> ___ ___ Python-bugs-list mailing list Unsub

[issue9141] Allow objects to decide if they can be collected by GC

2013-04-23 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz, pconnell ___ Python tracker <http://bugs.python.org/issue9141> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16427] Faster hash implementation

2013-04-23 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue16427> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13533] Would like Py_Initialize to play friendly with host app

2013-04-23 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz, pconnell ___ Python tracker <http://bugs.python.org/issue13533> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17646] traceback.py has a lot of code duplication

2013-04-22 Thread Martin Morrison
Martin Morrison added the comment: Attached another diff, which includes new test cases to cover all functions that weren't covered before - expect print_last. I couldn't see a way of getting sys.last_* set to test that function (it seems to require an "unhandled exception&

[issue17618] base85 encoding

2013-04-21 Thread Martin Morrison
Martin Morrison added the comment: On 21 Apr 2013, at 17:38, Serhiy Storchaka wrote: > Serhiy Storchaka added the comment: > > As for interface, I think 'adobe' flag should be false by default. It makes > encoder simpler. ascii85 encoder in Go's standard libr

[issue17804] streaming struct unpacking

2013-04-20 Thread Martin Morrison
Martin Morrison added the comment: On 20 Apr 2013, at 23:01, Martin Morrison wrote: > - I'm not a fan of separate iter_ functions (and there seemed to be a general > move away from them elsewhere in Python3; obviously here we have to maintain > backwards compat though). Per

[issue17804] streaming struct unpacking

2013-04-20 Thread Martin Morrison
Martin Morrison added the comment: I like the idea of this. Two comments: - I'm no expert on the C API, but in s_iter_unpack do you not need to check for failure of PyType_GenericAlloc before calling PyObject_GetBuffer? - I'm not a fan of separate iter_ functions (and there seem

[issue17646] traceback.py has a lot of code duplication

2013-04-20 Thread Martin Morrison
Martin Morrison added the comment: On 20 Apr 2013, at 18:55, Serhiy Storchaka wrote: > Serhiy Storchaka added the comment: > > Could print_exception() in Lib/idlelib/run.py reuse new traceback functions? Actually, cleaning up code like that in Idle and the code module and import.c w

[issue17800] Expose __del__ when tp_del is populated from C code

2013-04-20 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue17800> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17646] traceback.py has a lot of code duplication

2013-04-20 Thread Martin Morrison
Martin Morrison added the comment: On 20/04/2013 03:54, Benjamin Peterson wrote: > It would be great to have a test for that. :) I was afraid you'd say that. ;-) I'll look at adding test cases to cover the functions not currently covered (seems most of the print functions aren&

[issue14621] Hash function is not randomized properly

2013-04-20 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz, pconnell ___ Python tracker <http://bugs.python.org/issue14621> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14531] Backtrace should not attempt to open file

2013-04-20 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue14531> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9634] Add timeout parameter to Queue.join()

2013-04-20 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue9634> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17408] second python execution fails when embedding

2013-04-20 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz, pconnell ___ Python tracker <http://bugs.python.org/issue17408> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1635741] Interpreter seems to leak references after finalization

2013-04-20 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz, pconnell ___ Python tracker <http://bugs.python.org/issue1635741> ___ ___ Python-bugs-list mailing list Unsub

[issue17646] traceback.py has a lot of code duplication

2013-04-19 Thread Martin Morrison
Martin Morrison added the comment: print_tb() wasn't passing the file argument through to print_list() - now fixed. I also verified none of the other functions had a similar bug. -- Added file: http://bugs.python.org/file29944/issue17646-4

[issue14805] Support display of both __cause__ and __context__

2013-04-19 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue14805> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12535] Chained tracebacks are confusing because the first traceback is minimal

2013-04-19 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue12535> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16741] `int()`, `float()`, etc think python strings are null-terminated

2013-04-19 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue16741> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2013-04-19 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue11549> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17646] traceback.py has a lot of code duplication

2013-04-19 Thread Martin Morrison
Martin Morrison added the comment: How embarrassing - I guess that'll teach me to try to doctor the diff file. :-) I've now regenerated the diff, and re-run all the testing, etc. Apologies for the churn. -- Added file: http://bugs.python.org/file29943/issue17

[issue17468] Generator memory leak

2013-04-19 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +pconnell ___ Python tracker <http://bugs.python.org/issue17468> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1647489] zero-length match confuses re.finditer()

2013-04-18 Thread Martin Morrison
Martin Morrison added the comment: This is still an issue today: >>> import re >>> [m.groups() for m in re.finditer(r'(^z*)|(\w+)', 'abc')] [('', None), (None, 'bc')] -- nosy: +isoschiz __

[issue3693] Obscure array.array error message

2013-04-18 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue3693> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17062] An os.walk inspired replacement for pkgutil.walk_packages

2013-04-18 Thread Martin Morrison
Martin Morrison added the comment: I threw together a function that implements this. The only variation from the proposed signature was adding the onerror argument supported by the other similar functions in the module. -- keywords: +patch nosy: +isoschiz Added file: http

[issue17646] traceback.py has a lot of code duplication

2013-04-18 Thread Martin Morrison
Martin Morrison added the comment: Sorry, that is an unrelated change I was experimenting with, which I accidentally forgot to take out. Please see the new uploaded diff. -- Added file: http://bugs.python.org/file29933/issue17646-2.diff ___ Python

[issue17646] traceback.py has a lot of code duplication

2013-04-18 Thread Martin Morrison
Changes by Martin Morrison : Removed file: http://bugs.python.org/file29929/issue17646-2.diff ___ Python tracker <http://bugs.python.org/issue17646> ___ ___ Python-bug

[issue11182] remove unused undocumented pydoc.Scanner class

2013-04-18 Thread Martin Morrison
Martin Morrison added the comment: Attached patch does exactly as described. Seems to be unused, and still passes all pydoc tests. -- keywords: +patch nosy: +isoschiz Added file: http://bugs.python.org/file29932/issue11182.diff ___ Python tracker

[issue17468] Generator memory leak

2013-04-18 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue17468> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17618] base85 encoding

2013-04-18 Thread Martin Morrison
Martin Morrison added the comment: Attached a minor tweak over the last diff - I'd forgotten to fix the Struct handling inside the Mercurial implementation as well. All other comments still apply to this diff. -- Added file: http://bugs.python.org/file29930/issue17618-5

[issue17618] base85 encoding

2013-04-18 Thread Martin Morrison
Martin Morrison added the comment: Raised http://bz.selenic.com/show_bug.cgi?id=3894 against Mercurial for them to workaround issue14596. -- ___ Python tracker <http://bugs.python.org/issue17

[issue17646] traceback.py has a lot of code duplication

2013-04-18 Thread Martin Morrison
Martin Morrison added the comment: Latest upload has all of the agreed markups from the review. -- Added file: http://bugs.python.org/file29929/issue17646-2.diff ___ Python tracker <http://bugs.python.org/issue17

[issue17618] base85 encoding

2013-04-17 Thread Martin Morrison
Martin Morrison added the comment: New diff. Changes from the last one: - change in struct handling to avoid issue14596 - Addition of btoa85 and atob85 functions that do legacy 'btoa' encoding/decoding. These are just wrappers around a85(en|de)code, which now have additional keywo

[issue17618] base85 encoding

2013-04-17 Thread Martin Morrison
Martin Morrison added the comment: >> Can you elaborate on this? What leakage is there? I assume this is some > implementation quirk of the struct module that I'm not aware of. > > issue14596. Thanks for the pointer. I will rework the patch for the encoder/decoders to use a

[issue17618] base85 encoding

2013-04-17 Thread Martin Morrison
Martin Morrison added the comment: > Using a trick with struct.unpack() has very unpleasant side effect. > It might be a few speed up encoding, but creates the Struct object > with the size is many times larger than the size of the processed > data. Worse, this object is cached and

[issue17618] base85 encoding

2013-04-14 Thread Martin Morrison
Martin Morrison added the comment: I've updated the Ascii85 algorithms to remove the quadratic complexity, and use a single struct.pack/unpack. They should now be much quicker for large input strings. It's difficult to factor out commonality with b85* because the encodings and ru

[issue17618] base85 encoding

2013-04-13 Thread Martin Morrison
Martin Morrison added the comment: Updated patch that includes both my original implementation of Ascii85, as well as the Mercurial implementation of base85. A few notes/questions: - I named the Mercurial base85 implementation functions with the "b85" prefix. For the Ascii85 ones, I

[issue17618] base85 encoding

2013-04-13 Thread Martin Morrison
Martin Morrison added the comment: Ok, great. I'll update the patch to include both encoding schemes. -- ___ Python tracker <http://bugs.python.org/is

[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2013-04-09 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue17636> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17618] base85 encoding

2013-04-07 Thread Martin Morrison
Martin Morrison added the comment: Ok, I'm not even sure that Mercurial follows RFC1924! That RFC is specifically for encoding IPv6 addresses, and mandates that the calculations be performed on a 128bit integer. The Mercurial implementation seems to follow the Ascii85 policy of taking ea

[issue17618] base85 encoding

2013-04-07 Thread Martin Morrison
Martin Morrison added the comment: Ok, having now looked at mercurial's implementation... it looks like they implemented the RFC1924 version, whereas my implementation is the Ascii85 version (and I verified it against, amongst others: http://www.tools4noobs.com/online_tools/ascii85_e

[issue17618] base85 encoding

2013-04-07 Thread Martin Morrison
Martin Morrison added the comment: (sorry for spam) Forgot to mention, I included an optional keyword argument to support the 'btoa' shortcut for sequences of space characters as described in the Wikipedia article. However, I'm unsure if any other implementation supports this

[issue17618] base85 encoding

2013-04-07 Thread Martin Morrison
Martin Morrison added the comment: I wrote an implementation from scratch (based on the wikipedia article; I've not looked at any existing implementations) in pure Python in the attached diff. It includes tests. Feel free to use it as the pure Python implementation if desired, though I

[issue17646] traceback.py has a lot of code duplication

2013-04-06 Thread Martin Morrison
Martin Morrison added the comment: I hadn't spotted that one! My refactor goes further (consolidates all duplicates, not just the tb ones), is implemented the way you suggested therein (print in terms of extract), and is "more efficient" in that it uses generators for a

[issue17646] traceback.py has a lot of code duplication

2013-04-06 Thread Martin Morrison
New submission from Martin Morrison: traceback.py contains a lot of code duplication, which makes it fragile in the face of changes (i.e. special cases) to the stack/traceback output (I am separately working on just such a change). The attached patch refactors the code to reduce to a single

[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2013-04-03 Thread Martin Morrison
Changes by Martin Morrison : -- nosy: +isoschiz ___ Python tracker <http://bugs.python.org/issue14905> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14157] time.strptime without a year fails on Feb 29

2012-05-14 Thread Martin Morrison
Martin Morrison added the comment: This solution has some very undesirable properties - namely that Mar 1st is now less than Feb 29th! It seems like the correct follow up fix would be to adjust the date of the returned struct_time back to 1900. The struct_time object doesn't hav

[issue14157] time.strptime without a year fails on Feb 29

2012-02-29 Thread Martin Morrison
New submission from Martin Morrison : time.strptime without a year fails on Feb 29 with: >>> time.strptime("Feb 29", "%b %d") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.6/_strptime.py", line 454, in _strpt