[issue21578] Misleading error message when ImportError called with invalid keyword args

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +873 ___ Python tracker ___ ___

[issue21578] Misleading error message when ImportError called with invalid keyword args

2016-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added a test for multiple invalid keyword arguments, added braces, fixed a leak. But there is other oddity in ImportError constructor (issue28289). -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue21578] Misleading error message when ImportError called with invalid keyword args

2016-09-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9b8f0db1944f by Serhiy Storchaka in branch '3.5': Issue #21578: Fixed misleading error message when ImportError called with https://hg.python.org/cpython/rev/9b8f0db1944f New changeset 95549f4970d0 by Serhiy Storchaka in branch '3.6': Issue #21578:

[issue21578] Misleading error message when ImportError called with invalid keyword args

2016-09-27 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: berker.peksag -> serhiy.storchaka ___ Python tracker ___

[issue21578] Misleading error message when ImportError called with invalid keyword args

2016-09-27 Thread Brett Cannon
Brett Cannon added the comment: Left a review, but basically LGTM. -- ___ Python tracker ___ ___

[issue21578] Misleading error message when ImportError called with invalid keyword args

2016-09-27 Thread Berker Peksag
Berker Peksag added the comment: Serhiy's patch looks good to me. It would be nice to add a test for multiple invalid keyword arguments: with self.assertRaisesRegex(TypeError, msg): ImportError('test', invalid='keyword', another=True) Using empty_tuple seems reasonable to me.

[issue21578] Misleading error message when ImportError called with invalid keyword args

2016-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- versions: +Python 3.7 -Python 3.4 ___ Python tracker ___ ___

[issue21578] Misleading error message when ImportError called with invalid keyword args

2016-08-04 Thread Xiang Zhang
Xiang Zhang added the comment: I am a little uncomfortable with the empty tuple. It's only used as a placeholder for PyArg_ParseTupleAndKeywords. But this way we can achieve consistent error message. Don't know how to choose. -- nosy: +xiang.zhang

[issue21578] Misleading error message when ImportError called with invalid keyword args

2016-08-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why not use PyArg_ParseTupleAndKeywords()? -- Added file: http://bugs.python.org/file44010/import_error_parse_args.patch ___ Python tracker

[issue21578] Misleading error message when ImportError called with invalid keyword args

2016-08-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue21578] Misleading error message when ImportError called with invalid keyword args

2016-08-04 Thread Brett Cannon
Brett Cannon added the comment: Assigning to Berker to apply his own patch since Eric has not gotten around to this. -- assignee: eric.snow -> berker.peksag ___ Python tracker

[issue21578] Misleading error message when ImportError called with invalid keyword args

2015-09-16 Thread Berker Peksag
Changes by Berker Peksag : -- stage: needs patch -> patch review versions: +Python 3.6 ___ Python tracker ___

[issue21578] Misleading error message when ImportError called with invalid keyword args

2014-10-04 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the review, David. The standard error message for this case is: xxx() got an unexpected keyword argument 'foo' I found two similar messages in the codebase: * In Modules/itertoolsmodule.c: PyErr_SetString(PyExc_TypeError,

[issue21578] Misleading error message when ImportError called with invalid keyword args

2014-10-04 Thread R. David Murray
R. David Murray added the comment: Just the first unexpected keyword. That's what happens if you pass more than one unexpected keyword to a python function. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21578

[issue21578] Misleading error message when ImportError called with invalid keyword args

2014-09-27 Thread R. David Murray
R. David Murray added the comment: The standard error message for this case is: xxx() got an unexpected keyword argument 'foo' I have no idea where that gets generated (a grep didn't teach me anything useful), but I think it would make sense to use that form for the message. I think the

[issue21578] Misleading error message when ImportError called with invalid keyword args

2014-07-05 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- versions: -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21578 ___ ___

[issue21578] Misleading error message when ImportError called with invalid keyword args

2014-06-27 Thread Berker Peksag
Berker Peksag added the comment: Here's a new patch which uses assertRaisesRegex instead of assertRaises. -- Added file: http://bugs.python.org/file35794/issue21578_v3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21578

[issue21578] Misleading error message when ImportError called with invalid keyword args

2014-06-27 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: Removed file: http://bugs.python.org/file35366/issue21578.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21578 ___

[issue21578] Misleading error message when ImportError called with invalid keyword args

2014-06-26 Thread Berker Peksag
Berker Peksag added the comment: Eric, do you want me to commit the patch? Should this also be committed to the 3.4 branch? -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21578

[issue21578] Misleading error message when ImportError called with invalid keyword args

2014-05-27 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the review, Eric. Here's a new patch. -- Added file: http://bugs.python.org/file35381/issue21578_v2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21578

[issue21578] Misleading error message when ImportError called with invalid keyword args

2014-05-27 Thread Eric Snow
Eric Snow added the comment: Looks good to me. Thanks for doing this. If no one objects in the meantime, I'll commit this in a few days. -- assignee: - eric.snow stage: patch review - commit review ___ Python tracker rep...@bugs.python.org

[issue21578] Misleading error message when ImportError called with invalid keyword args

2014-05-26 Thread Berker Peksag
Berker Peksag added the comment: Here's a patch with a simple test case. -- keywords: +patch nosy: +berker.peksag stage: needs patch - patch review Added file: http://bugs.python.org/file35366/issue21578.diff ___ Python tracker rep...@bugs.python.org

[issue21578] Misleading error message when ImportError called with invalid keyword args

2014-05-25 Thread Eric Snow
New submission from Eric Snow: ImportError(spam='spam') Traceback (most recent call last): File stdin, line 1, in module TypeError: ImportError does not take keyword arguments However, it *does* take keyword arguments: ImportError(name='spam', path='spam') ImportError() --