[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-04-28 Thread Miguel Brito
Miguel Brito added the comment: Hello, first time here. I created an PR for that. Managed to reproduce the issue both manually and via unit test. I hope there's no edge case but all tests pass on my machine. -- nosy: +miguendes ___ Python tr

[issue43978] Incorrect "versionadded" info in typing.NoReturn documentation

2021-04-30 Thread Miguel Brito
Change by Miguel Brito : -- keywords: +patch nosy: +miguendes nosy_count: 3.0 -> 4.0 pull_requests: +24450 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25760 ___ Python tracker <https://bugs.p

[issue43978] Incorrect "versionadded" info in typing.NoReturn documentation

2021-04-30 Thread Miguel Brito
Miguel Brito added the comment: This looks like a leftover from a merge conflict. Or a bad copy and paste indeed. I've checked the file prior to the PR and the was no version 3.5.4 tag. I've opened a PR to fix this: https://github.com/python/cpython/

[issue43871] urllib.parse.urlparse doesn't check port

2021-05-01 Thread Miguel Brito
Change by Miguel Brito : -- keywords: +patch nosy: +miguendes nosy_count: 4.0 -> 5.0 pull_requests: +24464 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25774 ___ Python tracker <https://bugs.python.org/i

[issue43871] urllib.parse.urlparse doesn't check port

2021-05-01 Thread Miguel Brito
Miguel Brito added the comment: I also think the validation logic should be ran as early as possible. I gave it a shot and implemented it. I appreciate any reviews: https://github.com/python/cpython/pull/25774 Got some ideas from https://github.com/python/cpython/pull/16780

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-05-01 Thread Miguel Brito
Miguel Brito added the comment: I was reading through the dev guide and past issues and I didn't know it's advisable to give the author of the issue a chance to submit the PR. Sorry about that, you can close mine in this case. --

[issue43869] Fix documentation of epoch/time.time

2021-05-01 Thread Miguel Brito
Change by Miguel Brito : -- keywords: +patch nosy: +miguendes nosy_count: 4.0 -> 5.0 pull_requests: +24467 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25777 ___ Python tracker <https://bugs.python.org/i

[issue43869] Fix documentation of epoch/time.time

2021-05-01 Thread Miguel Brito
Miguel Brito added the comment: Seen that no one is working on this issue I created an PR to clarify the docs. https://github.com/python/cpython/pull/25777 -- ___ Python tracker <https://bugs.python.org/issue43

[issue43952] Multiprocessing UNIX socket connection: client freeze if authkey is an empty byte string

2021-05-01 Thread Miguel Brito
Miguel Brito added the comment: I tried debugging this and from what I can see it's because there's an if that checks if the authkey is not None in the Client constructor: https://github.com/python/cpython/blob/v3.9.4/Lib/multiprocessing/connection.py#L512 ``` if authkey i

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-05-03 Thread Miguel Brito
Miguel Brito added the comment: Thanks terry.reedy, actually I read it in the mailing list, someones comment not a guideline. Do you mind having a look at the PR? -- ___ Python tracker <https://bugs.python.org/issue43

[issue43952] Multiprocessing UNIX socket connection: client freeze if authkey is an empty byte string

2021-05-03 Thread Miguel Brito
Change by Miguel Brito : -- keywords: +patch pull_requests: +24528 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25845 ___ Python tracker <https://bugs.python.org/issu

[issue44018] Bug in random.seed

2021-05-03 Thread Miguel Brito
Miguel Brito added the comment: The problem is that random seed will do ``` if isinstance(a, str): a = a.encode() a += _sha512(a).digest() a = int.from_bytes(a, 'big') ``` and that will modify the bytearray in place. >>

[issue43952] Multiprocessing UNIX socket connection: client freeze if authkey is an empty byte string

2021-05-03 Thread Miguel Brito
Miguel Brito added the comment: I had a look at the HMAC RFC and apparently empty bytes sequence can be used as secret key. "The definition of HMAC requires a cryptographic hash function, which we denote by H, and a secret key K. ... The authentication key K can be of any length up

[issue44030] Markup with_traceback code example

2021-05-05 Thread Miguel Brito
Change by Miguel Brito : -- keywords: +patch nosy: +miguendes nosy_count: 2.0 -> 3.0 pull_requests: +24596 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25929 ___ Python tracker <https://bugs.p

[issue44030] Markup with_traceback code example

2021-05-05 Thread Miguel Brito
Miguel Brito added the comment: If we make it a code snippet it works. Just adding a `::` after the paragraph. Here's a print on Firefox locally: https://imgur.com/a/g2vsqf2 I created a PR for that if you think it's a good solution, feel fre

[issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5

2021-05-06 Thread Miguel Brito
Miguel Brito added the comment: I can reproduce it on latest master running on Linux. steve.dower: I wrote some tests and wrapping get_importer argument with os.fsdecode() fixes it. I'm happy to open an PR, just let me know or if OP is not willing to do so either. --

[issue44061] Regression in pkgutil: iter_modules stopped taking Path argument in python 3.8.10 and 3.9.5

2021-05-07 Thread Miguel Brito
Change by Miguel Brito : -- keywords: +patch pull_requests: +24621 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25964 ___ Python tracker <https://bugs.python.org/issu

[issue43124] [security] smtplib multiple CRLF injection

2021-05-07 Thread Miguel Brito
Miguel Brito added the comment: If there's no one working on it I'd be happy to prepare a fix. -- nosy: +miguendes ___ Python tracker <https://bugs.python.o

[issue43124] [security] smtplib multiple CRLF injection

2021-05-08 Thread Miguel Brito
Change by Miguel Brito : -- keywords: +patch pull_requests: +24639 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25987 ___ Python tracker <https://bugs.python.org/issu

[issue44110] Improve string's __getitem__ error message

2021-05-11 Thread Miguel Brito
New submission from Miguel Brito : I noticed that __getitem__ message, although helpful, could be improved a bit further. This will also make it consistent with other error messages such as the ones raised by `str.count`, `str.split`, `str.endswith` and so many others. Currently, the error

[issue44110] Improve string's __getitem__ error message

2021-05-11 Thread Miguel Brito
Change by Miguel Brito : -- keywords: +patch pull_requests: +24687 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26042 ___ Python tracker <https://bugs.python.org/issu

[issue32133] documentation: numbers module nitpick

2021-05-14 Thread Miguel Brito
Miguel Brito added the comment: Seen that nobody is working on this I transformed the suggestion into a PR. -- nosy: +miguendes ___ Python tracker <https://bugs.python.org/issue32

[issue44095] Add suffix property to zipfile.Path

2021-05-14 Thread Miguel Brito
Miguel Brito added the comment: +1. The docstring says: ``` class Path: """ A pathlib-compatible interface for zip files. ``` but only a few methods are supported. It'd be nice to have at least `stem`, `parents`, `suffixes`, `parts`, which IMHO would make sens

[issue44095] Add suffix property to zipfile.Path

2021-05-14 Thread Miguel Brito
Change by Miguel Brito : -- keywords: +patch pull_requests: +24768 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26129 ___ Python tracker <https://bugs.python.org/issu

[issue44095] Add suffix property to zipfile.Path

2021-05-14 Thread Miguel Brito
Miguel Brito added the comment: I prototyped something by adding `suffix`, `suffixes`, and `stem`. To me these are the most obvious ones and would be useful right away. Regarding the others I'm not so sure. It seems that zipfile.Path is just a convenient class to provide basic navigat

[issue32133] documentation: numbers module nitpick

2021-05-15 Thread Miguel Brito
Change by Miguel Brito : -- keywords: +patch pull_requests: +24775 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26124 ___ Python tracker <https://bugs.python.org/issu

[issue32133] documentation: numbers module nitpick

2021-05-15 Thread Miguel Brito
Miguel Brito added the comment: @rhettinger added your suggestion. -- ___ Python tracker <https://bugs.python.org/issue32133> ___ ___ Python-bugs-list mailin

[issue44137] importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager

2021-05-15 Thread Miguel Brito
Miguel Brito added the comment: I can reproduce this. From what I can see the issue is that `importlib.resources.path` intentionally suppresses `FileNotFoundError` errors. https://github.com/python/cpython/blob/main/Lib/importlib/resources.py#L138 Based on `importlib.resources.path

[issue44166] Make IndexError messages for list more informative

2021-05-18 Thread Miguel Brito
New submission from Miguel Brito : I've noticed that in people will often ask for help on forums or stackoverflow to better understand the causes of IndexErrors [1][2][3]. > The error message line for an IndexError doesn’t give you great > information.[1] Currently, when we acce

[issue44166] Make IndexError messages for list more informative

2021-05-18 Thread Miguel Brito
Change by Miguel Brito : -- keywords: +patch pull_requests: +24824 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26207 ___ Python tracker <https://bugs.python.org/issu

[issue44166] Make IndexError messages for list more informative

2021-05-18 Thread Miguel Brito
Miguel Brito added the comment: Thanks for your comments, folks! I really appreciate it. I left a comment about this issue in the PR thread: https://github.com/python/cpython/pull/26207#issuecomment-843531990 -- ___ Python tracker <ht

[issue44792] Improve syntax errors for invalid if expressions

2021-07-31 Thread Miguel Brito
New submission from Miguel Brito : Hi, I was playing around with Python's grammar and noticed that the error message for if expression is generic, so not very informative. I decided to improve it slightly. *From*: ``` >>> a = 42 if True File "", l

[issue44792] Improve syntax errors for invalid if expressions

2021-07-31 Thread Miguel Brito
Change by Miguel Brito : -- keywords: +patch pull_requests: +26020 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27506 ___ Python tracker <https://bugs.python.org/issu