Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue15256] Typo in error message

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 5, 2012, 11:57 AM

Post #1 of 11 (438 views)
Permalink
[issue15256] Typo in error message

New submission from Marc Abramowitz <msabramo [at] gmail>:

>From a failing unit test with coverage.py, I noticed what seems to be a slight typo in the error message when a module cannot be imported:

diff -r 1186d68715cc Lib/imp.py
--- a/Lib/imp.py Wed Jul 04 19:33:45 2012 -0700
+++ b/Lib/imp.py Thu Jul 05 11:50:25 2012 -0700
@@ -230,7 +230,7 @@
continue
break # Break out of outer loop when breaking out of inner loop.
else:
- raise ImportError('No module name {!r}'.format(name), name=name)
+ raise ImportError('No module named {!r}'.format(name), name=name)

encoding = None
if mode == 'U':

Note the missing "d". This makes it match similar existing error messages:

Lib/importlib/_bootstrap.py
1238:_ERR_MSG = 'No module named {!r}'

Lib/modulefinder.py
185: self.msgout(4, "raise ImportError: No module named", qname)
186: raise ImportError("No module named " + qname)
198: self.msgout(4, "raise ImportError: No module named", mname)
199: raise ImportError("No module named " + mname)
215: raise ImportError("No module named " + subname)

Lib/runpy.py
106: raise ImportError("No module named %s" % mod_name)

I wonder if this can be centralized to ensure that all code uses the exact same message?

----------
components: Library (Lib)
messages: 164693
nosy: Marc.Abramowitz, brett.cannon
priority: normal
severity: normal
status: open
title: Typo in error message
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15256>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 5, 2012, 12:00 PM

Post #2 of 11 (429 views)
Permalink
[issue15256] Typo in error message [In reply to]

Changes by Ned Batchelder <ned [at] nedbatchelder>:


----------
nosy: +nedbat

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15256>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 6, 2012, 10:11 AM

Post #3 of 11 (428 views)
Permalink
[issue15256] Typo in error message [In reply to]

Changes by Jesús Cea Avión <jcea [at] jcea>:


----------
nosy: +jcea

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15256>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 6, 2012, 10:33 AM

Post #4 of 11 (429 views)
Permalink
[issue15256] Typo in error message [In reply to]

Marc Abramowitz <msabramo [at] gmail> added the comment:

I think this is just a simple typo and a consistency issue; not a grammatical issue.

The misspelled version was added in a recent commit:

[last: 0] marca [at] SCML-Marc:~/dev/hg-repos/cpython$ hg log -r 76455
changeset: 76455:085cf1480cfe
user: Brett Cannon <brett [at] python>
date: Sat Apr 21 21:09:46 2012 -0400
summary: Issue #13959: Re-implement imp.find_module() in Lib/imp.py.

Link to issue: http://bugs.python.org/issue13959

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15256>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 6, 2012, 10:40 AM

Post #5 of 11 (429 views)
Permalink
[issue15256] Typo in error message [In reply to]

Changes by Ezio Melotti <ezio.melotti [at] gmail>:


----------
keywords: +easy
nosy: +ezio.melotti
stage: -> needs patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15256>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 6, 2012, 11:30 AM

Post #6 of 11 (428 views)
Permalink
[issue15256] Typo in error message [In reply to]

Marc Abramowitz <msabramo [at] gmail> added the comment:

Attaching patch

----------
keywords: +patch
Added file: http://bugs.python.org/file26271/python_issue_15256.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15256>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 6, 2012, 1:33 PM

Post #7 of 11 (429 views)
Permalink
[issue15256] Typo in error message [In reply to]

Marc Abramowitz <msabramo [at] gmail> added the comment:

Patch with Brett's comments

----------
Added file: http://bugs.python.org/file26272/python_issue_15256.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15256>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 6, 2012, 7:32 PM

Post #8 of 11 (429 views)
Permalink
[issue15256] Typo in error message [In reply to]

Changes by Terry J. Reedy <tjreedy [at] udel>:


----------
stage: needs patch -> patch review

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15256>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 7, 2012, 6:44 PM

Post #9 of 11 (429 views)
Permalink
[issue15256] Typo in error message [In reply to]

Brett Cannon <brett [at] python> added the comment:

Patch looks fine. Next time I have python-dev time I will commit it.

----------
assignee: -> brett.cannon
stage: patch review -> commit review

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15256>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 9, 2012, 10:24 AM

Post #10 of 11 (427 views)
Permalink
[issue15256] Typo in error message [In reply to]

Roundup Robot <devnull [at] psf> added the comment:

New changeset 75831951a6b5 by Brett Cannon in branch 'default':
Issue #15256: Re-use the ImportError exception message as defined by
http://hg.python.org/cpython/rev/75831951a6b5

----------
nosy: +python-dev

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15256>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 9, 2012, 10:25 AM

Post #11 of 11 (427 views)
Permalink
[issue15256] Typo in error message [In reply to]

Brett Cannon <brett [at] python> added the comment:

Thanks for the patch, Marc!

----------
resolution: -> fixed
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15256>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.