[issue42988] [security] CVE-2021-3426: Information disclosure via pydoc -p: /getfile?key=path allows to read arbitrary file on the filesystem

2021-03-13 Thread Gregory P. Smith
Gregory P. Smith added the comment: FWIW, I don't think we should even have a server feature in pydoc... -- nosy: +gregory.p.smith ___ Python tracker <https://bugs.python.org/is

[issue41200] Add pickle.loads fuzz test

2021-03-13 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35278] [security] directory traversal in tempfile prefix

2021-03-13 Thread Gregory P. Smith
Change by Gregory P. Smith : -- versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.9 ___ Python tracker <https://bugs.python.org/issue35278> ___ ___ Pytho

[issue43478] Disallow Mock spec arguments from being Mocks

2021-03-15 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker <https://bugs.python.org/issue43478> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43478] Disallow Mock spec arguments from being Mocks

2021-03-15 Thread Gregory P. Smith
Gregory P. Smith added the comment: Lets go ahead and try making this a breaking change in 3.10. If users report it causes a bunch of problems during the beta -that they don't want to address so soon- (they are all likely bugs in test suites...) we can soften it to a warning for a

[issue43285] ftplib should not use the host from the PASV response

2021-03-15 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 0ab152c6b5d95caa2dc1a30fa96e10258b5f188e by Gregory P. Smith in branch 'master': bpo-43285 Make ftplib not trust the PASV response. (GH-24838) https://github.com/python/cpython/commit/0ab152c6b5d95caa2dc1a30fa96e10

[issue43285] ftplib should not use the host from the PASV response

2021-03-15 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +23639 pull_request: https://github.com/python/cpython/pull/24881 ___ Python tracker <https://bugs.python.org/issue43

[issue43285] ftplib should not use the host from the PASV response

2021-03-15 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 664d1d16274b47eea6ec92572e1ebf3939a6fa0c by Gregory P. Smith in branch '3.8': [3.8] bpo-43285 Make ftplib not trust the PASV response. (GH-24838) (GH-24881) https://github.com/python/cpython/commit/664d1d16274b47eea6ec92572e1ebf

[issue43285] ftplib should not use the host from the PASV response

2021-03-15 Thread Gregory P. Smith
Gregory P. Smith added the comment: 3.7 and 3.6 backport PRs created and assigned to release manager Ned for merging. -- nosy: +ned.deily resolution: -> fixed stage: patch review -> commit review status: open -> closed ___ Python tracke

[issue43285] ftplib should not use the host from the PASV response

2021-03-15 Thread Gregory P. Smith
Gregory P. Smith added the comment: A What's New entry is a good idea. I'll make one and add it to those backport PRs. (reopened to remind me of that) ftplib docs... I don't actually want to document the attribute that people can set for the old behavior beyond the notes in

[issue43285] ftplib should not use the host from the PASV response

2021-03-15 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +23647 stage: commit review -> patch review pull_request: https://github.com/python/cpython/pull/24886 ___ Python tracker <https://bugs.python.org/issu

[issue43285] ftplib should not use the host from the PASV response

2021-03-15 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +23648 pull_request: https://github.com/python/cpython/pull/24887 ___ Python tracker <https://bugs.python.org/issue43

[issue43285] ftplib should not use the host from the PASV response

2021-03-15 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +23649 pull_request: https://github.com/python/cpython/pull/24888 ___ Python tracker <https://bugs.python.org/issue43

[issue43285] ftplib should not use the host from the PASV response

2021-03-15 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +23650 pull_request: https://github.com/python/cpython/pull/24889 ___ Python tracker <https://bugs.python.org/issue43

[issue43285] ftplib should not use the host from the PASV response

2021-03-15 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset d0312cece9ce89d783687ff6dddaae6495e19fcf by Gregory P. Smith in branch '3.9': [3.9] bpo-43285: Add a What's New entry for 3.9.3. (GH-24888) https://github.com/python/cpython/commit/d0312cece9ce89d783687ff6d

[issue43285] ftplib should not use the host from the PASV response

2021-03-15 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 9eda0dfff2884bf9272f37d4151ef2335f55066f by Gregory P. Smith in branch '3.8': [3.8] bpo-43285: Whats New entry for 3.8.9. (GH-24889) https://github.com/python/cpython/commit/9eda0dfff2884bf9272f37d4151ef2

[issue43285] ftplib should not use the host from the PASV response

2021-03-15 Thread Gregory P. Smith
Gregory P. Smith added the comment: 3.7 and 3.6 PRs updated to include a What's New entry. -- assignee: gregory.p.smith -> ned.deily priority: normal -> release blocker versions: -Python 3.10, Python 3.8, Python 3.9 ___ Python trac

[issue15533] subprocess.Popen(cwd) documentation: Posix vs Windows

2021-03-16 Thread Gregory P. Smith
Gregory P. Smith added the comment: For our subprocess docs, Eryk's text: """ For POSIX, ``executable`` should be stated as a "relative path without a slash in it" or a "relative path without a directory in it". An unqualified filename is a relative p

[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: -10. I agree with Serhiy. Automatic type conversion is rarely a feature. It leads to silent bugs when people pass the wrong things. Be explicit. We are intentionally not one of those everything is really a string languages like Perl or Javascript

[issue43517] Fix false positives in circular import detection with from-imports

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: Thanks Antoine! -- nosy: +gregory.p.smith ___ Python tracker <https://bugs.python.org/issue43517> ___ ___ Python-bugs-list m

[issue43520] Make Fraction(string) handle non-ascii slashes

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: The proposal I like is for a unicode numeric normalization functions that return the ascii equivalent to exist. These ideally belong in a third party PyPI library anyways, as they're the kind of thing that needs updating every time a new unicode rev

[issue43520] Make Fraction(string) handle non-ascii slashes

2021-03-20 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43571] Add option to create MPTCP sockets

2021-03-20 Thread Gregory P. Smith
New submission from Gregory P. Smith : New changeset b05b48dd7ab68bf0046356f2abd6d7fe3b5b3d77 by Rui Cunha in branch 'master': bpo-43571: Add IPPROTO_MPTCP macro (GH-24946) https://github.com/python/cpython/commit/b05b48dd7ab68bf0046356f2abd6d7fe3b5b3d77 -- nosy: +grego

[issue43571] Add option to create MPTCP sockets

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: Thanks for the contribution! Simple constant addition. I ignored the contributor CLA status as a result. There's only one way to write this non-logic plumbing. -- assignee: -> gregory.p.smith resolution: -> fixed stage: patch revie

[issue27602] Enable py launcher to launch repository Python.

2021-03-20 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +brett.cannon ___ Python tracker <https://bugs.python.org/issue27602> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29178] Adding bytes.frombuffer(byteslike) constructor

2021-03-20 Thread Gregory P. Smith
Change by Gregory P. Smith : -- stage: -> patch review versions: -Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue29178> ___ ___ Py

[issue43487] Rename __unicode__ methods to __str__ in 2to3 conversion

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: We're not accepting anything new into lib2to3 anymore as it is deprecated and slated for eventual removal. I recommend putting any fixers you develop up as on PyPI as package(s) for others to use. -- nosy: +gregory.p.smith resol

[issue37871] Windows: WindowsConsoleIO produces mojibake for strings longer than 32 KiB

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: Steve's approach makes sense and should be robust. side note: do we need to care about Windows 7 anymore in 3.10 given that microsoft no longer supports it? -- nosy: +gregory.p.smith ___ Python tracker &

[issue43542] Add image/heif(heic) to list of media types in mimetypes.py

2021-03-20 Thread Gregory P. Smith
Change by Gregory P. Smith : -- assignee: -> gregory.p.smith nosy: +gregory.p.smith versions: +Python 3.10 ___ Python tracker <https://bugs.python.org/issu

[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: There is a lot of doubt. That should clearly raise an exception because this function is intended to only operate on strings. Trivial types examples like that gloss over the actual problem. data_from_some_computations = [b"foo", b"ba

[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: Isn't this just "how windows behaves" on some filesystems with little that we can do about it? The only real action item I can see here is that if it is _reasonable_ for us to detect the situation and improve the error message, that'd

[issue38890] subprocess.Popen should not emit a ResourceWarning for a detached process

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: On POSIX the norm for anything daemonizing itself is to fork() and let the parent die so that its original process with the child pid has ended. But I'm used to this being the responsibility of the daemon process. Not the code launching the d

[issue43542] Add image/heif(heic) to list of media types in mimetypes.py

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 20a5b7e986377bdfd929d7e8c4e3db5847dfdb2d by Ilya Stepin in branch 'master': bpo-43542: Add heif/heic formats in mimetypes (GH-24917) https://github.com/python/cpython/commit/20a5b7e986377bdfd929d7e8c4e3db

[issue43542] Add image/heif(heic) to list of media types in mimetypes.py

2021-03-20 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43080] pprint for dataclass instances

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: +0.5 I lean towards just accepting this under the conditions Eric describes given that dataclass is a stdlib concept and nobody is likely to claim that such output from pprint is a bad thing. The larger "some form of protocol for pprint to work o

[issue42917] Block stack size for frame objects should be dynamically sizable

2021-03-20 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker <https://bugs.python.org/issue42917> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32592] Drop support of Windows Vista and Windows 7

2021-03-20 Thread Gregory P. Smith
Change by Gregory P. Smith : -- title: Drop support of Windows Vista and 7 in Python 3.9 -> Drop support of Windows Vista and Windows 7 type: -> enhancement ___ Python tracker <https://bugs.python.org/i

[issue42914] pprint numbers with underscore

2021-03-20 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker <https://bugs.python.org/issue42914> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: oh, I missed that a notification happens to the other process(es) in a common case, a bit of retrying with backoff would actually make sense there. But I wouldn't let a retry run for longer than a second or three, as code tends to assume that rmtr

[issue42914] pprint numbers with underscore

2021-03-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 3ba3d513b1e3c63d09cb798b982a9e6c369cea4c by sblondon in branch 'master': bpo-42914: add a pprint underscore_numbers option (GH-24864) https://github.com/python/cpython/commit/3ba3d513b1e3c63d09cb798b982a9e

[issue42914] pprint numbers with underscore

2021-03-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: Thanks for the contribution Stéphane! I agree that this would be a nice default. We're just being conservative in the pace of default behavior changes. Changing the default could be considered in the future after a few releases with this parameter

[issue43710] Access violations in C extension modules on Python 3.9.3

2021-04-03 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith nosy_count: 7.0 -> 8.0 pull_requests: +23920 pull_request: https://github.com/python/cpython/pull/25179 ___ Python tracker <https://bugs.python.org/issu

[issue42500] crash with unbounded recursion in except statement

2021-04-03 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith nosy_count: 7.0 -> 8.0 pull_requests: +23921 pull_request: https://github.com/python/cpython/pull/25179 ___ Python tracker <https://bugs.python.org/issu

[issue43710] Access violations in C extension modules on Python 3.9.3

2021-04-03 Thread Gregory P. Smith
Gregory P. Smith added the comment: I really suggest a simple rollback (revert) of the change rather than a redo-fix for 3.9.4. Unless you like the idea of a possible 3.9.5 if the redo-fix itself has issues that haven't been given due thought in the rush to undo the 3.9.3 mistake.

[issue43725] Create a release branch ABI stability regression test

2021-04-03 Thread Gregory P. Smith
New submission from Gregory P. Smith : In order to automate prevention of ABI regressions in stable releases, we could create an automated ABI stability test generator and check the specific ABI test it generates into each specific release branch. I'm envisioning the main branch only h

[issue43725] Create a release branch ABI stability regression test

2021-04-04 Thread Gregory P. Smith
Gregory P. Smith added the comment: Indeed. In particular given the 3.9.3 issue I was assuming such a test should include asserting both the sizeof() ABI structs and offsetof() public members of all ABI structs. On each specific first class supported platform. This goes beyond what https

[issue17305] IDNA2008 encoding is missing

2021-04-06 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +patch nosy: +gregory.p.smith nosy_count: 15.0 -> 16.0 pull_requests: +23948 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25208 ___ Python tracker

[issue17305] IDNA2008 encoding is missing

2021-04-06 Thread Gregory P. Smith
Gregory P. Smith added the comment: My PR merely adds a note to the docs linking to idna on pypi. Don't get excited, it doesn't implement anything. :P re "Once Python has a working idna2008 encoder, we need to address integration into socket, ssl, http, and asyncio modu

[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-06 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker <https://bugs.python.org/issue41486> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43684] Add combined opcodes

2021-04-06 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker <https://bugs.python.org/issue43684> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43725] Create a release branch ABI stability regression test

2021-04-06 Thread Gregory P. Smith
Gregory P. Smith added the comment: Ideally we'd analyze for a representative set of major platforms we ship binaries on. 32-bit and 64-bit Linux are a start, but we should assume that at least windows and linux toolchains may be different and toss in an additional CPU architectu

[issue40701] tempfile mixes str and bytes in an inconsistent manner

2021-04-09 Thread Gregory P. Smith
Gregory P. Smith added the comment: Fixed for 3.10. Marking as a release blocker for 3.9 and assigning for a release manager decision on if they accept this change (the PR) as a bugfix in 3.9 or not. (see the PR) It is late enough in 3.8's lifetime I wouldn't touc

[issue43478] Disallow Mock spec arguments from being Mocks

2021-04-09 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset dccdc500f9b5dab0a20407ae0178d393796a8828 by Matthew Suozzo in branch 'master': bpo-43478: Restrict use of Mock objects as specs (GH-25326) https://github.com/python/cpython/commit/dccdc500f9b5dab0a20407ae0178d3

[issue37251] Mocking a MagicMock with a function spec results in an AsyncMock

2021-04-10 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: fixed -> stage: resolved -> needs patch status: closed -> open ___ Python tracker <https://bugs.python.or

[issue40701] tempfile mixes str and bytes in an inconsistent manner

2021-04-10 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +24068 pull_request: https://github.com/python/cpython/pull/25334 ___ Python tracker <https://bugs.python.org/issue40

[issue40701] tempfile mixes str and bytes in an inconsistent manner

2021-04-10 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset e05a703848473b0365886dcc593cbddc46609f29 by Gregory P. Smith in branch 'master': bpo-40701: doc typo historcal -> historical (GH-25334) https://github.com/python/cpython/commit/e05a703848473b0365886dcc593

[issue43776] Popen with shell=True yield mangled repr output

2021-04-10 Thread Gregory P. Smith
Change by Gregory P. Smith : -- assignee: -> gregory.p.smith nosy: +gregory.p.smith versions: +Python 3.10 ___ Python tracker <https://bugs.python.org/issu

[issue43808] Add .isfloat() method to str

2021-04-11 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: I left some review comments on the PR. I like the algorithm being used. I don't really _like_ that this is a .h file acting as a C template to inject effectively the same static code into each module that wants to use it... Which I think i

[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: looking around it appears you've proposed an independent implementation of this for the thir party brotli module? https://github.com/google/brotli/pull/856 that is what i mean about making this reu

[issue43785] Remove RLock from BZ2File

2021-04-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'm not worried about compatibility on this for 3.10. Nobody realistically expects to be able to have multiple readers from a single BZ2File stream. They don't for the gzip or lzma equivalents. That isn't even a normal thing to do on

[issue43785] Remove RLock from BZ2File

2021-04-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: I see you're already tracking __iter__ in https://bugs.python.org/issue43787, perfect! :) -- ___ Python tracker <https://bugs.python.org/is

[issue43787] Optimize BZ2File, GzipFile, and LZMAFile __iter__ method.

2021-04-11 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker <https://bugs.python.org/issue43787> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43787] Optimize BZ2File, GzipFile, and LZMAFile __iter__ method.

2021-04-11 Thread Gregory P. Smith
Change by Gregory P. Smith : -- stage: -> needs patch ___ Python tracker <https://bugs.python.org/issue43787> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue43574] Regression in overallocation for literal list initialization in v3.9+

2021-04-11 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker <https://bugs.python.org/issue43574> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1662581] the re module can perform poorly: O(2**n) versus O(n**2)

2021-04-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: https://pypi.org/project/pyre2/ seems to be a maintained version of that for use on modern Python interpreters. -- ___ Python tracker <https://bugs.python.org/issue1662

[issue43686] re.match appears to hang with certain combinations of pattern and string

2021-04-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: Try something like https://pypi.org/project/pyre2/ or _maybe_ https://pypi.org/project/regex/ (I didn't think that one tried to do a breadth first approach though so maybe not) I'm marking this a duplicate of the age old issue around degenerat

[issue7247] test_fcntl_64_bit from test_fcntl.py fails in Python 2.6.4

2021-04-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: given how old this is and how i added that test skip presumably when i setup my first arm buildbot... closing. -- assignee: -> gregory.p.smith resolution: -> fixed stage: patch review -> resolved status: open

[issue30713] Reject newline character (U+000A) in URLs in urllib.parse

2021-04-23 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker <https://bugs.python.org/issue30713> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43883] Making urlparse WHATWG conformant

2021-04-23 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker <https://bugs.python.org/issue43883> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41639] Unpickling derived class of list does not call __init__()

2021-04-26 Thread Gregory P. Smith
Gregory P. Smith added the comment: this looks resolved? -- nosy: +gregory.p.smith resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43946] unpickling a subclass of list fails when it implements its own extend method

2021-04-26 Thread Gregory P. Smith
New submission from Gregory P. Smith : The changes from https://bugs.python.org/issue29368 are causing a subclass of list trouble: ``` class FieldList(list): ... def extend(...): ... ``` FieldList has its own extend and append methods that implement additional checks. As it is a

[issue29368] Optimize unpickling list-like objects: use extend() instead of append()

2021-04-26 Thread Gregory P. Smith
Gregory P. Smith added the comment: The PyList_Check -> PyList_CheckExact change led to bugs where subclasses of list that override extend can no longer be unpickled. https://bugs.python.org/issue43946 -- nosy: +gregory.p.smith ___ Python trac

[issue43946] unpickling a subclass of list fails when it implements its own extend method

2021-04-27 Thread Gregory P. Smith
Gregory P. Smith added the comment: Thanks, that makes sense. And it at least less ugly than the __new__ hack I was thinking of as a workaround. though similar in spirit. presumably self.append should get the same treatment for completeness given the PEP 307 text. I didn't notice a

[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-27 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset f9bedb630e8a0b7d94e1c7e609b20dfaa2b22231 by Ma Lin in branch 'master': bpo-41486: Faster bz2/lzma/zlib via new output buffering (GH-21740) https://github.com/python/cpython/commit/f9bedb630e8a0b7d94e1c7e609b20d

[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-28 Thread Gregory P. Smith
Gregory P. Smith added the comment: Thanks, this is great work! Especially when living within the constraints of C and the existing code. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracke

[issue43776] Popen with shell=True yield mangled repr output

2021-04-28 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +3.9regression ___ Python tracker <https://bugs.python.org/issue43776> ___ ___ Python-bugs-list mailing list Unsub

[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: Renaming to OutputBuffer sounds like a good idea. On Thu, Apr 29, 2021, 7:55 PM Ma Lin wrote: > > Ma Lin added the comment: > > Found a backward incompatible behavior. > > Before the patch, in 64-bit build, zlib module allow

[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-30 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 251ffa9d2b16b091046720628deb6a7906c35d29 by Ma Lin in branch 'master': bpo-41486: Fix initial buffer size can't > UINT32_MAX in zlib module (GH-25738) https://github.com/python/cpython/commit/251ffa9d2b16b091046720

[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: I think there's still a flaw in the fixes implemented in 3.10 and 3.9 so far. We're closer, but probably not quite good enough yet. why? We aren't stripping the newlines+tab early enough. I think we need to do the stripping *r

[issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching

2021-05-01 Thread Gregory P. Smith
New submission from Gregory P. Smith : `urllib.parse` has custom caching code for both `urlsplit()` and `quote()`. From 1996. https://github.com/python/cpython/commit/3fd32ecd9232fcb041b9f1f7a19a1e7e65cf11a0 https://github.com/python/cpython/commit/74495409861b357d9925937d6576229c74e2550d

[issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: Yeah, the Quoter class seems a little odd... Past notes of some the caching performance around the character quoting for quote() can be found in https://bugs.python.org/issue1285086 circa 2005-2010. -- nosy: -rhettinger

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
New submission from Gregory P. Smith : When the C implementation of functools.lru_cache was added in bpo/issue14373, it appears to have omitted setting `.__defaults__` on its wrapped function. ``` Python 3.10.0a7+ (heads/master-dirty:823fbf4e0e, May 1 2021, 11:10:30) [Clang 12.0.0 (clang

[issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching

2021-05-01 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +patch pull_requests: +24486 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25798 ___ Python tracker <https://bugs.python.org/issu

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: That was anecdotal evidence: ``` Python 3.9.1 (v3.9.1:1e5d33e9b9, Dec 7 2020, 12:10:52) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: the pure python functools.lru_cache doesn't get this right either. here's a desirable testcase for this bug: ``` def test_lru_defaults_bug44003(self): @self.module.lru_cache(maxsize=None) def func(arg='

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +patch pull_requests: +24487 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25800 ___ Python tracker <https://bugs.python.org/issu

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: __defaults__ and __kwdefaults__ get used for code introspection. Just as __annotations__ does. __annotations__ is already available on the lru_cache wrapped function. All of those seem to go together from a runtime inspection point of view

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: An inner function can't know if somebody else might want to inspect it. This is a decorator that does not change anything about the argument signature of the wrapped function, carrying over the reference to meta-information about that by default

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'm working on a more specialized case of this for functools.lru_cache in bpo-issue44003. But I believe this issue also makes sense. It is basically suggesting that __defaults__ and __kwdefaults__ should be included in the default set of ass

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: https://bugs.python.org/issue41232 covers the more general case of suggesting changing update_wrapper's behavior. That would alleviate the need to fix the pure python implementation within my o

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Change by Gregory P. Smith : -- type: behavior -> enhancement versions: -Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue44003> ___ _

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: Oh, I didn't realize mutating those would actually change the code runtime behavior. But it makes sense, those are needed before the code object is entered. Yeah that is different, and suggests making this the default is not actually desired.

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: Even if we shouldn't blindly propagate defaults (wrong in some wrapping scenarios), there is still a problem here as noted in Thor's opening message. A bug exists between functools.wraps and inspect.signature. The signature reported is w

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: rejecting. code trying to make direct use of __defaults__ is likely better off using inspect.signature(). there might be an issue with inspect in some cases (https://bugs.python.org/issue41232) but I do not believe that is true for lru_cache wrapped

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: That makes sense. It seems like we're missing information signature() would need to be able to differentiate between when it should default to follow .__wrapped__ vs when it shouldn't. Neither default can satisf

[issue43883] Making urlparse WHATWG conformant

2021-05-04 Thread Gregory P. Smith
Gregory P. Smith added the comment: FWIW rather than implementing our own URL parsing at all... wrapping a library extracted from a compatible-license major browser (Chromium or Firefox) and keeping it updated would avoid disparities. Unfortunately, I'm not sure how feasible this real

[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-04 Thread Gregory P. Smith
Gregory P. Smith added the comment: Both Django and Botocore issues appear to be in the category of: "depending on invalid data being passed through our urlsplit API so that they could look for it later" Not much sympathy. We never guaranteed we'd pass invalid data th

[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-05 Thread Gregory P. Smith
Gregory P. Smith added the comment: Thanks Florian! Indeed, I'm glad you have tests for this. (I expect anyone writing their own validation code will have such tests) Making urlsplit raise an exception where it never has before has other consequences: In CPython's own

[issue36515] unaligned memory access in the _sha3 extension

2021-05-05 Thread Gregory P. Smith
Change by Gregory P. Smith : -- assignee: -> christian.heimes versions: +Python 3.10, Python 3.11, Python 3.9 ___ Python tracker <https://bugs.python.org/issu

<    7   8   9   10   11   12   13   14   15   16   >