[issue16399] argparse: append action with default list adds to list instead of overriding

2014-06-19 Thread SylvainDe
SylvainDe added the comment: As this is likely not to get solved, is there a recommanded way to work around this issue ? Here's what I have done : import argparse def main(): Main function parser = argparse.ArgumentParser() parser.add_argument('--foo', action='append

[issue21989] Missing (optional) argument `start` and `end` in documentation for list.index

2014-07-16 Thread SylvainDe
New submission from SylvainDe: From : https://docs.python.org/2/tutorial/datastructures.html and https://docs.python.org/3.4/tutorial/datastructures.html (and all other versions) : list.index(x) Return the index in the list of the first item whose

[issue24529] Same MemoryError object gets thrown from different places.

2015-06-29 Thread SylvainDe
New submission from SylvainDe: Disclaimer: This is very minor, impacts only Python 2 and is maybe not even a bug. Context: I was randomly changing attribute of Exception objects when I discovered something I did not expect : sometimes when an exception occurs, a new object is raised (which

[issue29932] Missing word ("be") in error message ("first argument must a type object")

2017-03-28 Thread SylvainDe
New submission from SylvainDe: Very uninteresting issue but error message should probably be "first argument must BE a type object" in `array__array_reconstructor_impl` in Modules/arraymodule.c . This has been introduced with ad077154d0f305ee0ba5bf41d3cb47d1d9c43e7b . I'll handle

[issue29932] Missing word ("be") in error message ("first argument must a type object")

2017-03-29 Thread SylvainDe
Changes by SylvainDe <sylvain.des...@gmail.com>: -- pull_requests: +790 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29932> ___

[issue29924] Useless argument in call to PyErr_Format

2017-03-27 Thread SylvainDe
New submission from SylvainDe: Very uninteresting issue I've found while looking at the code. In Objects/call.c, in _PyMethodDef_RawFastCallDict(PyMethodDef *method, PyObject *self, PyObject **arg...), we have no_keyword_error: PyErr_Format(PyExc_TypeError

[issue29924] Useless argument in call to PyErr_Format

2017-03-27 Thread SylvainDe
SylvainDe added the comment: I forgot to copy the link but here is a description of what I had in mind for the first idea. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29924] Useless argument in call to PyErr_Format

2017-03-27 Thread SylvainDe
SylvainDe added the comment: http://julio.meroh.net/2011/06/validating-format-strings-in-custom-c.html -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29924] Useless argument in call to PyErr_Format

2017-03-27 Thread SylvainDe
SylvainDe added the comment: Seems to be introduced via 250e4b0063fab35770719b64d1e36209c4aa2596 in January this year. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30878] The staticmethod doesn't properly reject keyword arguments

2017-07-08 Thread SylvainDe
Changes by SylvainDe <sylvain.des...@gmail.com>: -- pull_requests: +2700 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30878> ___

[issue30878] The staticmethod doesn't properly reject keyword arguments

2017-07-08 Thread SylvainDe
SylvainDe added the comment: I have a fix ready but I'll look if other functions using _PyArg_NoKeywords may have the same defect before submitting it. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30878] The staticmethod doesn't properly reject keyword arguments

2017-07-09 Thread SylvainDe
SylvainDe added the comment: Thanks Serhiy Storchaka ! This issue seems to affect (all) other Python versions. Should we proceed to a cherry-pick ? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30959] Constructor signature is duplicated in the help of namedtuples

2017-07-21 Thread SylvainDe
SylvainDe added the comment: Regarding the `sorted.__doc__` issue, it seems like the signature does not appear in the `__doc__` member but it does appear when using `help(sorted)` which is probably what really matters. In any case, I find PEP 257 about this part a bit ambiguous : "Th

[issue26656] Documentation for re.compile is a bit outdated

2017-08-09 Thread SylvainDe
SylvainDe added the comment: @swapnil agarwal I think you can go for it. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26656> ___ __

[issue30592] Bad error message 'bool()() takes no keyword arguments'

2017-06-08 Thread SylvainDe
SylvainDe added the comment: As I was trying to test coverage for a few places where the same error was built, I have discovered another issue where the error message is very misleading: AssertionError: "^index\(\) takes no keyword arguments$" does not match "index() t

[issue30600] Error message incorrect when index is called with keyword argument ("[].index(x=2)")

2017-06-09 Thread SylvainDe
Changes by SylvainDe <sylvain.des...@gmail.com>: -- pull_requests: +2113 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30600> ___

[issue30712] struct.unpack generates wrong error in certain conditions

2017-06-20 Thread SylvainDe
Changes by SylvainDe <sylvain.des...@gmail.com>: -- nosy: +SylvainDe ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30712> ___ _

[issue30712] struct.unpack generates wrong error in certain conditions

2017-06-20 Thread SylvainDe
SylvainDe added the comment: Could it be caused by alignment ? Also, it could be interesting to explain a bit more what you expect and what you actually get. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30592] Bad error message 'bool()() takes no keyword arguments'

2017-06-07 Thread SylvainDe
New submission from SylvainDe: Very recent "regression". Issue found because of a pet project trying to parse error messages using regexps : more on https://github.com/SylvainDe/DidYouMean-Python/issues/31 . On recent Cron builds on Jenkins, running the following code

[issue30592] Bad error message 'bool()() takes no keyword arguments'

2017-06-07 Thread SylvainDe
SylvainDe added the comment: Reproduced locally using unit tests: +def test_varargs0_kw(self): +msg = r"bool\(\) takes no keyword arguments" +self.assertRaisesRegex(TypeError, msg, bool, x=2) + giving: Traceback (most recent call last): File "/hom

[issue30592] Bad error message 'bool()() takes no keyword arguments'

2017-06-07 Thread SylvainDe
SylvainDe added the comment: The issue seems to be in: int _PyArg_NoKeywords(const char *funcname, PyObject *kwargs) I'm happy to submit a PR if needed. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30592] Bad error message 'bool()() takes no keyword arguments'

2017-06-08 Thread SylvainDe
SylvainDe added the comment: Hi serhiy.storchaka, this is fine by me! I've added a corresponding comment with questions/suggestions on the Github PR. Do you reckon I should open another ticket for the issue mentionned in my previous message ? I'm happy to take care

[issue30600] Error message incorrect when index is called with keyword argument ("[].index(x=2)")

2017-06-08 Thread SylvainDe
SylvainDe added the comment: Can I give this a try or is anyone working on this already ? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30600] Error message incorrect when index is called with keyword argument ("[].index(x=2)")

2017-06-08 Thread SylvainDe
New submission from SylvainDe: Issue found while trying to write tests for https://bugs.python.org/issue30592 . Issue related to http://bugs.python.org/issue30534 . The following code: [].index(x=2) should raise the following error: TypeError: index() takes no keyword arguments

[issue30600] Error message incorrect when index is called with keyword argument ("[].index(x=2)")

2017-06-09 Thread SylvainDe
SylvainDe added the comment: Thanks Serhiy Storchaka for the tip! I am currently investigating how the argument clinic works. I have used git bisect to find when the issue got introduced. commit fdd42c481edba4261f861fc1dfe24bbd79b5a17a bpo-20185: Convert list object implementation to Argument

[issue20627] Add context manager support to xmlrpc.client.ServerProxy

2017-06-11 Thread SylvainDe
Changes by SylvainDe <sylvain.des...@gmail.com>: -- pull_requests: +2168 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20627> ___

[issue26656] Documentation for re.compile is a bit outdated

2017-06-11 Thread SylvainDe
SylvainDe added the comment: IMHO, the sentence is not bad as it is. An easy (?) yet efficient way to make it much better from the a user perspective would be to make the "regular expression object" text a link leading to https://docs.python.org/3/library/re.html#regular-expressi

[issue30627] Incorrect error message for a few functions called with keywod argument

2017-06-10 Thread SylvainDe
SylvainDe added the comment: (Also, I suspect introspection could be used to know if the same bug is still lying somewhere: get all objects (using gc?), keep callables with no __code__ member only, call with keyword argument, check error

[issue30627] Incorrect error message for a few functions called with keywod argument

2017-06-10 Thread SylvainDe
New submission from SylvainDe: Follow-up for http://bugs.python.org/issue30600 which is itself a follow-up for http://bugs.python.org/issue30534 . Not quite sure what the process is in that situation : creating a new ticket or updating the old one ? After working on http://bugs.python.org

[issue30645] imp.py: load_package() appends to its own loop variable

2017-06-14 Thread SylvainDe
SylvainDe added the comment: Alexandru: You'll find the PSF Contributor Agreement at https://www.python.org/psf/contrib/contrib-form/ . -- nosy: +SylvainDe ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30627] Incorrect error message for a few functions called with keywod argument

2017-06-15 Thread SylvainDe
Changes by SylvainDe <sylvain.des...@gmail.com>: -- pull_requests: +2263 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30627> ___

[issue36026] Different error message when sys.settrace is used (regressions)

2019-02-18 Thread SylvainDe
SylvainDe added the comment: This is mostly true and I agree that error messages are not part of the API. However, I'd like to add the following points: - the error message was more meaningful before - the fact that having system.settrace used or not changes the behaviour makes me think

[issue36026] Different error message when sys.settrace is used (regressions)

2019-02-19 Thread SylvainDe
Change by SylvainDe : -- type: -> behavior versions: +Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue36026> ___ ___ Python-bugs-lis

[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread SylvainDe
SylvainDe added the comment: This looks good to me :) -- ___ Python tracker <https://bugs.python.org/issue36026> ___ ___ Python-bugs-list mailing list Unsub

[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread SylvainDe
SylvainDe added the comment: Thanks for the investigation. I'm fine with the explanation provided. -- ___ Python tracker <https://bugs.python.org/issue36

[issue36026] Different error message when sys.settrace is used (regressions)

2019-02-18 Thread SylvainDe
New submission from SylvainDe : Context: Follow-up from https://bugs.python.org/issue35965 which was closed when we assumed the issue was on the coverage side. After nedbat investigation, it seems like the issue comes from call to "sys.settrace". Issue: -- A te

[issue35965] Behavior for unittest.assertRaisesRegex differs depending on whether it is used as a context manager

2019-02-11 Thread SylvainDe
SylvainDe added the comment: I have no explanation whatsoever but removing the call to coverage seems to remove the issue: https://travis-ci.org/SylvainDe/DidYouMean-Python/builds/491727724 . I guess we can close this issue - sorry for the inconvenience. @nedbat: do you want me to open

[issue35965] Behavior for unittest.assertRaisesRegex differs depending on whether it is used as a context manager

2019-02-11 Thread SylvainDe
New submission from SylvainDe : On some Python versions, the following pieces of code have a different behavior which is not something I'd expect: ``` DESCRIPT_REQUIRES_TYPE_RE = r"descriptor '\w+' requires a 'set' object but received a 'int'" ... def test_assertR

[issue35965] Behavior for unittest.assertRaisesRegex differs depending on whether it is used as a context manager

2019-02-11 Thread SylvainDe
SylvainDe added the comment: That's the very weird thing. I've been unable to reproduce this locally but it can be seen on Travis runs. Here are the results so far (Versions numbers are retrieved with python -VV and python -c "import sys; print(sys._git)"): On some versions,

[issue35965] Behavior for unittest.assertRaisesRegex differs depending on whether it is used as a context manager

2019-02-11 Thread SylvainDe
SylvainDe added the comment: This is a brilliant idea! I'll give it a try and keep you posted. -- ___ Python tracker <https://bugs.python.org/issue35

[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-20 Thread SylvainDe
SylvainDe added the comment: For similar reasons as friendly-traceback, I'd be interested in a list of stdlib modules to be able to provide additional information in case of exceptions. For instance: string.ascii_lowercase > Before: NameError("name 'string' is not defined&qu