[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

[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

[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

[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
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

[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

[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

[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

[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

[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: +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

[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

[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

[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

[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

[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

[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

[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. --

[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

[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

[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

[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
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

[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-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

[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

[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

[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. --

[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

[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

[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/

[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

[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

[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-05 Thread Miguel
Miguel added the comment: I built with 'no-threads' option. I understand if you no longer wish to support non-threaded SSL. But it just seemed to me that you could if you protected the SSL API calls with locking since I can get all your ssl tests to work with this mi

[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-05 Thread Miguel
New submission from Miguel : Hello, this is my first python bug report! I've been running builds of Python 3.7.x on CentOS Linux release 7.7 (64bit/Intel Core 2 Duo) and I ran into hangs with test_ssl.py when using latest SSL 1.1.1d sources. I've done a full compilation from

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2020-04-03 Thread Miguel Amaral
Miguel Amaral added the comment: A related issue(which I believe has no topic in this forum yet) is substituting an expression that results in a multiline string into a multiline f-string while matching its indentation. If a new type of string prefix is made to auto-dedent, maybe the

[issue36085] Enable better DLL resolution

2020-03-27 Thread David Miguel Susano Pinto
David Miguel Susano Pinto added the comment: I have just found out that commit 2438cdf0e93 which added the winmode argument and the documentation for it disagree. Documentation states that default is zero while the real default in code is None. I have opened PR 19167 on github to address it

[issue39829] __len__ called twice in the list() constructor

2020-03-02 Thread Kim-Adeline Miguel
New submission from Kim-Adeline Miguel : (See #33234) Recently we added Python 3.8 to our CI test matrix, and we noticed a possible backward incompatibility with the list() constructor. We found that __len__ is getting called twice, while before 3.8 it was only called once. Here'

[issue35338] set union/intersection/difference could accept zero arguments

2018-11-28 Thread David Miguel Susano Pinto
New submission from David Miguel Susano Pinto : set union, intersection, difference methods accept any non-zero number of sets and return a new set instance, like so: >>> a = set([1, 2]) >>> b = set([1, 3]) >>> c = set([3, 5]) >>> set.unio

[issue33649] asyncio docs overhaul

2018-09-17 Thread Miguel Ángel
Change by Miguel Ángel : -- pull_requests: +8811 ___ Python tracker <https://bugs.python.org/issue33649> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33649] asyncio docs overhaul

2018-09-17 Thread Miguel Ángel
Change by Miguel Ángel : -- pull_requests: +8808 ___ Python tracker <https://bugs.python.org/issue33649> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34718] Syntax error on factorial example

2018-09-17 Thread Miguel Ángel
Miguel Ángel added the comment: Too trivial to require an issue. Sorry, I'm newbie here :) -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue34718] Syntax error on factorial example

2018-09-17 Thread Miguel Ángel
New submission from Miguel Ángel : In the example on https://docs.python.org/3/library/asyncio-task.html#running-tasks-concurrently, there is a double closing parenthesis, but just one is needed for the `gather` method. This makes the example to fail. -- assignee: docs@python

[issue30508] "Task exception was never retrieved" reported for a canceled task

2017-05-29 Thread Miguel Grinberg
New submission from Miguel Grinberg: I am seeing a strange issue that occurs when a task that is awaiting an asyncio.wait_for() is cancelled. I created a simple example that I think demonstrates the issue, even though it isn't exactly how it manifests on my application. When I ru

[issue29108] Python 3.6.0 multiprocessing map_async callback

2016-12-29 Thread Jose Miguel Colella
Jose Miguel Colella added the comment: Hello David, Thanks for your response. Improvements to the documentation could clear this misunderstanding. I had initially believed that after transforming with the function passed to the map, it would use the callback on each of the result arguments

[issue29108] Python 3.6.0 multiprocessing map_async callback

2016-12-29 Thread Jose Miguel Colella
Jose Miguel Colella added the comment: The result is: Here: [1, 4, 9] [1, 4, 9] -- ___ Python tracker <http://bugs.python.org/issue29108> ___ ___ Python-bug

[issue29108] Python 3.6.0 multiprocessing map_async callback

2016-12-29 Thread Jose Miguel Colella
New submission from Jose Miguel Colella: Hello I am trying to use the callback for the map_async method for Pool, but have found a bug. In the below code, only the print statement is carried out, the return is completely ignored. Is this working as designed or is this a bug? from

[issue28498] tk busy command

2016-10-29 Thread Miguel
Miguel added the comment: Why dont we do the job well from the beginning and refactor _configure() and adapt other dependent code? It's not so complicated to change the dependent code. Many people around the world use Tkinter. -- ___ Python tr

[issue28498] tk busy command

2016-10-26 Thread Miguel
Miguel added the comment: Using the same reasoning applied to tk_busy_hold(), we have to change also these methods: selection_set(self, first, last=None) -> selection_set(self, **kw) coords(self, value=None) -> coords(self, **kw) identify(self, x, y) -> identity(s

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: In the C source code that I am reading of tkinter: _tkinter.c. It seems that these parameters are not used: - wantobjects - useTk - syn - use It seems that it's dead code. I hope that somebody can tell me whether I am right. I suppose that now Python returns a

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: It's not defined the semantics for things different than strings. -- ___ Python tracker <http://bugs.python.org/issue28498> ___ ___

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Hi, I think that it's behaving well. Where is the bug here? root.tk.getboolean(root.tk_strictMotif()) getboolean() converts Tcl strings to Boolean Python values according to the definition of True and False in Tcl. getboolean is only used for converting strin

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Yes, its true. The semantics of configure() is affected then if I ommit _flaten. I like elegancy and to dont repeat myself for this reason I made that suggestion. But the drawback is that maybe other external code that shouldn't rely on internal methods

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Hi Serhiy, I totally disagree of this change on your patch: +def tk_busy_status(self): +'''Returns the busy status of this window. +If the window presently can not receive user interactions, +True is returned,

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: This is my point of view: These functions are easy to change: itemconfigure(), entryconfigure(), image_configure(), tag_configure() and window_configure() It's only to add self._w in the proper place. Only one line per method Other third party extensions shoul

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Your proposal also makes an extra computation: an item (not) belongs to a list if not self._w in cmd: cmd = _flatten((self._w, cmd)) Also it's more efficient to use this than the function _flaten() in that situation: if not self._w in cmd:

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: It's also necessary in the same way to adapt these functions: itemconfigure(), entryconfigure(), image_configure(), tag_configure() and window_configure(). -- ___ Python tracker <http://bugs.python.org/is

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Yes, sure. It will break code. Maybe it's better to be explicit than implicit (another Python motto). It's also necessary to change configure(). This is the code for my version of _configure() and configure(): def _configure(self, cm

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Ok. Maybe the bug is here: Misc.getboolean() This is the required change: def getboolean(self, s): """Return a boolean value for Tcl boolean values true and false given as parameter.""" re

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Tcl_GetBoolean() converts a boolean string to an integer 0 or 1: https://www.tcl.tk/man/tcl8.6/TclLib/GetInt.htm and then Py_BuildValue() converts the integer to a Python object: https://docs.python.org/2/c-api/arg.html

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Hi klappnase, you are right with the function tk_busy_configure(). Maybe there is a little bit of code duplicated. I think that it's better to directly change the Tkinter function _configure() to make it more general: def _configure(self, cmd, cn

[issue28498] tk busy command

2016-10-22 Thread Miguel
Miguel added the comment: Misc._configure is only used when the first Tcl command is the name of the widget. Very probably my proposal for tk_busy_configure is a better candidate because it follows the conventions used in tkinter (it's similar to pack_configure and place_configure):

[issue28498] tk busy command

2016-10-22 Thread Miguel
Miguel added the comment: Thanks klappnase for your collaboration. I dont understand this function: def busy_status(self): '''Returns the busy status of this window. If the window presently can not receive user interactions, True is returned,

[issue28498] tk busy command

2016-10-22 Thread Miguel
Miguel added the comment: Maybe it's better to add also these methods: busy = tk_busy busy_cget = tk_busy_cget busy_configure = tk_busy_configure busy_current = tk_busy_current busy_forget = tk_busy_forget busy_hold = tk_busy_hold busy_status = tk_busy_status

[issue28498] tk busy command

2016-10-21 Thread Miguel
New submission from Miguel: tcl tk 8.6.6 has a new busy command. The new tkinter library doesn't provide an interface for this command. https://www.tcl.tk/man/tcl/TkCmd/busy.htm The solution is to add to the class Misc of tkinter these methods: def tk_busy(self, *args,

[issue28497] future in tkinter

2016-10-21 Thread Miguel
New submission from Miguel: I load the future package. In the new package installed here: python2.7/dist-packages/tkinter/__init__.py it's not possible to import _default_root. One possible solution is to create a method in tkinter module that returns the _default_root object. ``

[issue11632] difflib.unified_diff loses context

2013-04-29 Thread Miguel Latorre
Miguel Latorre added the comment: This bug is still present in python 2.7.4 and python 3.3.1. I attach another example, the result differs depending on number of lines to process (see test.py). -- nosy: +mal versions: +Python 2.7, Python 3.3 Added file: http://bugs.python.org/file30057

[issue12268] file readline, readlines & readall methods can lose data on EINTR

2012-12-03 Thread Gary Miguel
Changes by Gary Miguel : -- nosy: +Gary.Miguel ___ Python tracker <http://bugs.python.org/issue12268> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13896] Make shelf instances work with 'with' as context managers

2012-09-05 Thread Miguel Angel García
Changes by Miguel Angel García : -- nosy: +Miguel.Angel.García ___ Python tracker <http://bugs.python.org/issue13896> ___ ___ Python-bugs-list mailing list Unsub

[issue13818] argparse: -h listening required options under optional arguments

2012-01-18 Thread Miguel Godinho
New submission from Miguel Godinho : Adding a 'required optional argument' as with: ``` app.add_argument('--dbsnp', required=True) ``` will still result on having that argument listed under the optional when the app is called with the help option (-h) Please note th

[issue6434] buffer overflow in Zipfile when wrinting more than 2gig file

2011-11-03 Thread Miguel Hernández Martos
Miguel Hernández Martos added the comment: I think it's a dup of http://bugs.python.org/issue9720 That issue has a patch that allows the generation of zip files with >2GB files. -- nosy: +enlavin ___ Python tracker <http://bugs

[issue12772] fractional day attribute in datetime class

2011-08-20 Thread Miguel de Val Borro
Miguel de Val Borro added the comment: Thanks, I need the fractional day added to the ordinal day of the month. Using the timedelta division it would be: >>> from __future__ import division >>> dt = datetime.datetime(2008, 5, 8, 13, 35, 41, 56) >>> dt.day + (d

[issue12772] fractional day attribute in datetime class

2011-08-17 Thread Miguel de Val Borro
New submission from Miguel de Val Borro : It would be useful to have a fractional day method in datetime.datetime that returns a float object calculated from the day, hour, minute, second, and microseconds. Fractional days in UTC are often used in science, in particular to record astronomical

[issue10141] SocketCan support

2011-07-19 Thread Miguel Luis
Changes by Miguel Luis : -- nosy: +mluis ___ Python tracker <http://bugs.python.org/issue10141> ___ ___ Python-bugs-list mailing list Unsubscribe: