[issue25729] update pure python datetime.timedelta creation

2015-11-25 Thread Brian Kearns
Brian Kearns added the comment: Bug fixes are to the test suite itself, and the name cleanup, minor. Best classified as enhancement, apply where applicable. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25729] update pure python datetime.timedelta creation

2015-11-25 Thread Brian Kearns
Brian Kearns added the comment: Updated again -- Added file: http://bugs.python.org/file41165/timedelta3.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25729] update pure python datetime.timedelta creation

2015-11-25 Thread Brian Kearns
Brian Kearns added the comment: Updated patch per review -- Added file: http://bugs.python.org/file41164/timedelta2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25729] update pure python datetime.timedelta creation

2015-11-24 Thread Brian Kearns
Changes by Brian Kearns <bdkea...@gmail.com>: Removed file: http://bugs.python.org/file41158/timedelta.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25729] update pure python datetime.timedelta creation

2015-11-24 Thread Brian Kearns
Changes by Brian Kearns <bdkea...@gmail.com>: Added file: http://bugs.python.org/file41159/timedelta.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25729] update pure python datetime.timedelta creation

2015-11-24 Thread Brian Kearns
New submission from Brian Kearns: Brings timedelta creation up to par with the (simpler) C equivalent. Gives a nice speed boost on the pure-py version (not worth much on CPython but useful on other implementations like PyPy). Included in a few other small bug fixes/cleanups, should be self

[issue23521] OverflowError from timedelta * float in datetime.py

2015-02-26 Thread Brian Kearns
Brian Kearns added the comment: You saw the demo python implementation of divmod_near in Objects/longobject.c? Maybe it's worth using a common implementation? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23521

[issue23521] OverflowError from timedelta * float in datetime.py

2015-02-25 Thread Brian Kearns
Brian Kearns added the comment: Maybe we should also use divide_and_round for __truediv__ to match the C implementation calling divide_nearest there as well? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23521

[issue23521] OverflowError from timedelta * float in datetime.py

2015-02-25 Thread Brian Kearns
Brian Kearns added the comment: td = timedelta(seconds=1) print(td / (1/0.6112295)) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23521

[issue23090] fix test_doctest relying on refcounting to close files

2014-12-19 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: -- files: fix_test_doctest.patch keywords: patch nosy: bdkearns priority: normal severity: normal status: open title: fix test_doctest relying on refcounting to close files type: behavior versions: Python 2.7 Added file: http://bugs.python.org

[issue22266] fix reliance on refcounting in tarfile.gzopen

2014-08-25 Thread Brian Kearns
Brian Kearns added the comment: Updated to backport all the cases where 3.x handles this issue. -- Added file: http://bugs.python.org/file36468/tarfile2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22266

[issue22266] fix reliance on refcounting in tarfile.gzopen

2014-08-25 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Removed file: http://bugs.python.org/file36468/tarfile2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22266

[issue22266] fix reliance on refcounting in tarfile.gzopen

2014-08-25 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Added file: http://bugs.python.org/file36469/tarfile2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22266

[issue22259] fdopen of directory causes segmentation fault

2014-08-24 Thread Brian Kearns
Brian Kearns added the comment: Updated to use assertEqual -- Added file: http://bugs.python.org/file36452/fdopen-directory.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22259

[issue22259] fdopen of directory causes segmentation fault

2014-08-24 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Removed file: http://bugs.python.org/file36450/fdopen-directory.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22259

[issue22265] fix reliance on refcounting in test_itertools

2014-08-24 Thread Brian Kearns
New submission from Brian Kearns: The test fails on Python implementations with non-refcounted GCs without this line. -- files: test_itertools.patch keywords: patch messages: 225835 nosy: bdkearns priority: normal severity: normal status: open title: fix reliance on refcounting

[issue22266] fix reliance on refcounting in tarfile.gzopen

2014-08-24 Thread Brian Kearns
New submission from Brian Kearns: tarfile.gzopen relies on refcounting to close the fileobj when the fileobj is created during the call to gzopen (when it is not passed in). Since the fileobj is created outside of GzipFile, GzipFile does not take responsibility for closing the fileobj (so

[issue22265] fix reliance on refcounting in test_itertools

2014-08-24 Thread Brian Kearns
Brian Kearns added the comment: Should go on py3k branches too... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22265 ___ ___ Python-bugs-list

[issue22267] fix reliance on refcounting in test_weakref

2014-08-24 Thread Brian Kearns
New submission from Brian Kearns: The test fails on Python implementations with non-refcounted GCs without these lines. Should go on py3k branches also. -- files: test_weakref.patch keywords: patch messages: 225839 nosy: bdkearns priority: normal severity: normal status: open title

[issue22267] fix reliance on refcounting in test_weakref

2014-08-24 Thread Brian Kearns
Brian Kearns added the comment: Possibly. But if so then one would argue there are plenty of other instances where gc_collect should be used, both within test_weakref and the rest of the test suite. Chose gc.collect here as it was used all over test_weakref.py, gc_collect never being used

[issue22266] fix reliance on refcounting in tarfile.gzopen

2014-08-24 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Removed file: http://bugs.python.org/file36456/tarfile.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22266

[issue22266] fix reliance on refcounting in tarfile.gzopen

2014-08-24 Thread Brian Kearns
Brian Kearns added the comment: Yes, I guess that makes sense (though this behavior is undocumented and untested...) -- Added file: http://bugs.python.org/file36462/tarfile.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue22259] fdopen of directory causes segmentation fault

2014-08-23 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: -- files: fdopen-directory.patch keywords: patch nosy: bdkearns priority: normal severity: normal status: open title: fdopen of directory causes segmentation fault type: crash versions: Python 2.7 Added file: http://bugs.python.org/file36444

[issue22259] fdopen of directory causes segmentation fault

2014-08-23 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Removed file: http://bugs.python.org/file36444/fdopen-directory.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22259

[issue22259] fdopen of directory causes segmentation fault

2014-08-23 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Added file: http://bugs.python.org/file36450/fdopen-directory.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22259

[issue20858] Enhancements/fixes to pure-python datetime module

2014-07-07 Thread Brian Kearns
Brian Kearns added the comment: Updated patch, now it also caches the result of __hash__ like the C accelerator. -- Added file: http://bugs.python.org/file35894/datetime-py35.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue21350] bug in file.writelines accepting buffers

2014-05-07 Thread Brian Kearns
Brian Kearns added the comment: So, for example: f = open('blah', 'wb') f.write(array.array('c', 'test')) f.writelines([array.array('c', 'test')]) Traceback (most recent call last): File stdin, line 1, in module TypeError: writelines() argument must be a sequence of strings While

[issue21350] bug in file.writelines accepting buffers

2014-04-25 Thread Brian Kearns
New submission from Brian Kearns: In file.writelines, the conditions in this if statement are bogus. If f-f_binary and AsReadBuffer succeeds (returns 0), AsCharBuf is still tried. So, for example, passing an array('c') to a file('wb').writelines fails, when it seems the intention of the code

[issue21350] bug in file.writelines accepting buffers

2014-04-25 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Removed file: http://bugs.python.org/file35036/fix_file_writelines-py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21350

[issue21350] bug in file.writelines accepting buffers

2014-04-25 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Added file: http://bugs.python.org/file35037/fix_file_writelines-py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21350

[issue21349] crash in winreg SetValueEx with memoryview

2014-04-25 Thread Brian Kearns
Brian Kearns added the comment: Oops, updated test. -- Added file: http://bugs.python.org/file35038/fix_winreg_setvalueex-py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21349

[issue21349] crash in winreg SetValueEx with memoryview

2014-04-25 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Removed file: http://bugs.python.org/file35031/fix_winreg_setvalueex-py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21349

[issue21349] crash in winreg SetValueEx with memoryview

2014-04-25 Thread Brian Kearns
Brian Kearns added the comment: Are you aware of the old/new buffer interfaces and their usages? Did you actually try the code? crash would be obvious. Objects that support only the new buffer interface define tp_as_buffer with fields representing the old buffer interface as null. So

[issue21346] typos in test_itertools.py

2014-04-24 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: -- files: test_itertools_typos-py27.patch keywords: patch nosy: bdkearns priority: normal severity: normal status: open title: typos in test_itertools.py type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file35025

[issue21349] crash in winreg SetValueEx with memoryview

2014-04-24 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Removed file: http://bugs.python.org/file35030/fix_winreg_setvalueex-py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21349

[issue21349] crash in winreg SetValueEx with memoryview

2014-04-24 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: -- files: fix_winreg_setvalueex-py27.patch keywords: patch nosy: bdkearns priority: normal severity: normal status: open title: crash in winreg SetValueEx with memoryview type: crash versions: Python 2.7 Added file: http://bugs.python.org

[issue21349] crash in winreg SetValueEx with memoryview

2014-04-24 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Added file: http://bugs.python.org/file35031/fix_winreg_setvalueex-py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21349

[issue20887] stdlib compatibility with pypy, test_zipfile.py

2014-03-10 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: -- nosy: +bdkearns ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20887 ___ ___ Python-bugs-list

[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns
New submission from Brian Kearns: This patch brings the pure-python datetime more in-line with the C module. We have been running these modifications in PyPy2 stdlib for more than a year with no issue. Includes: - General PEP8/cleanups - Better testing of argument types passed to constructors

[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Added file: http://bugs.python.org/file34294/datetime-py33.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20858

[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns
Brian Kearns added the comment: Also includes bug fixes/tests for certain rounding cases (doesn't apply to the 3.4 version). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20858

[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Added file: http://bugs.python.org/file34296/datetime-py34-v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20858

[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns
Brian Kearns added the comment: Updated patch to v2 with another test/fix for type checking of __format__ argument to match the C module. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20858

[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns
Brian Kearns added the comment: Right, that's the behavior as it stands, so I hope this patch can be considered independently of that issue (and if such a change is made to the C implementation, then a corresponding change could be made in the python implementation

[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns
Brian Kearns added the comment: Yes, I am the PyPy developer who worked on these datetime improvements there -- just finally got around to pushing them upstream. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20858

[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2014-03-06 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: -- nosy: +bdkearns ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20861 ___ ___ Python-bugs-list

[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Added file: http://bugs.python.org/file34297/datetime-py33-v3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20858

[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Added file: http://bugs.python.org/file34298/datetime-py34-v3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20858

[issue16389] re._compiled_typed's lru_cache causes significant degradation of the mako_v2 bench

2013-03-08 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: -- nosy: +brian.kearns ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16389 ___ ___ Python-bugs-list