[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-03-11 Thread Matt Bogosian
Change by Matt Bogosian : -- pull_requests: +29919 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/31821 ___ Python tracker <https://bugs.python.org/issu

[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-02-01 Thread Matt Bogosian
Change by Matt Bogosian : -- keywords: +patch nosy: +mbogosian nosy_count: 4.0 -> 5.0 pull_requests: +29243 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31061 ___ Python tracker <https://bugs.python.org/i

[issue34798] pprint ignores the compact parameter for dicts

2021-12-11 Thread Matt Bogosian
Matt Bogosian added the comment: Please consider highlighting that dicts are not included in the documentation. While *technically* true, this ... > compact impacts the way that long sequences (lists, tuples, sets, etc) are > formatted. If compact is false (the default) then eac

[issue40346] Add random.BaseRandom to ease implementation of subclasses

2021-09-23 Thread Matt Bogosian
Matt Bogosian added the comment: Thanks! Where's that documented? (Apologies if I missed it.) -- ___ Python tracker <https://bugs.python.org/issue40346> ___ ___

[issue40346] Add random.BaseRandom to ease implementation of subclasses

2021-09-23 Thread Matt Bogosian
Matt Bogosian added the comment: I landed here after investigating this surprising result: # test_case.py from random import Random from typing import Sequence, Union _RandSeed = Union[None, int, Sequence[int]] class MyRandom(Random): def __init__( self, seed

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-10 Thread Matt Bogosian
Matt Bogosian added the comment: After some consideration, I think this is probably more correct: ``` --- /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py 2016-12-17 12:41:21.0 -0800 +++ tarfile.py 2017-03-10 14:57:15.0 -0800 @@ -2347,9 +2347,10

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-10 Thread Matt Bogosian
Changes by Matt Bogosian <spam+python@eb3f73.yaymail.com>: Removed file: http://bugs.python.org/file46717/tarfile.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-10 Thread Matt Bogosian
Matt Bogosian added the comment: This patch (also attached) seems to address this particular use case: ``` --- a/Lib/tarfile.py2016-12-17 12:41:21.0 -0800 +++ b/Lib/tarfile.py2017-03-10 12:23:34.0 -0800 @@ -2347,7 +2347,7 @@ # Advance the file pointer

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-10 Thread Matt Bogosian
Matt Bogosian added the comment: I'm not sure if it helps at this point, but I've tried several "flavors" of apparently legit tar files with zero entries. All fail. ``tarfile`` module: ``` $ ( set -x ; cd /tmp || exit 1 ; python -V ; rm -fv test.tar ; python -c 'import os, ta

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-08 Thread Matt Bogosian
Matt Bogosian added the comment: FWIW, the (offending) fix for #24259 was introduced (e.g., in 2.7) via 2.7.10. I've verified that 2.7.9 works as expected: ``` $ python -V Python 2.7.9 $ python tarfail.py opening /…/tarfail/test.tar.bz2 opening /…/tarfail/test.tar

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-08 Thread Matt Bogosian
New submission from Matt Bogosian: It looks like there's a problem examining ``.tar`` files with no entries: ``` $ # == $ # Extract test cases (attached to this bug report) $ tar xpvf tarfail.tar.bz2 x tarfail/ x tarfail/tarfail.py

[issue28981] distutils/check.py overzealous catch block hides errors

2016-12-15 Thread Matt Bogosian
New submission from Matt Bogosian: >From (e.g) >https://github.com/python/cpython/blob/2.7/Lib/distutils/command/check.py#L145: {{{ try: parser.parse(data, document) except AttributeError as e: # <- this could happen anywhere inside par

[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2016-12-15 Thread Matt Bogosian
Changes by Matt Bogosian <spam+python@eb3f73.yaymail.com>: -- nosy: +posita ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25714] Consider isinstance(..., numbers.Integral) instead of isinstance(..., int) or isinstance(..., (int, long)) in datetime.py

2015-12-01 Thread Matt Bogosian
Matt Bogosian added the comment: > I consider this as a bug and think that we should weak some of checks > isinstance(..., int) to isinstance(..., (int, long)). numbers.Integral is too > wide type, C implementation doesn't support it. Oddly enough, the C implementation is what i

[issue25714] Consider isinstance(..., numbers.Integral) instead of isinstance(..., int) or isinstance(..., (int, long)) in datetime.py

2015-11-23 Thread Matt Bogosian
New submission from Matt Bogosian: datetime.py is peppered with ``assert`` statements that are two restrictive. Specifically, ``isinstance(..., int)`` does not afford compatibility with alternate ``int``-like implementations (e.g., ``future.types.newint``). Some background: * https