[Python-bugs-list] [ python-Bugs-590888 ] off-by-one error in encoding warning

noreply@sourceforge.net noreply@sourceforge.net
Sun, 04 Aug 2002 18:49:48 -0700


Bugs item #590888, was opened at 2002-08-05 00:16
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=590888&group_id=5470

Category: Python Interpreter Core
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Martin v. Löwis (loewis)
Summary: off-by-one error in encoding warning

Initial Comment:
There seems to be an off-by-one error in the line number reported by 
the new encoding warnings.  Consider this simple file (three lines):

if __name__ == "__main__":
    x = "Bennett,Scott (guitar)" == "Scott Bennett"
    x = u"Andrč Previn" == "Andrč Previn"

If I import this into the current CVS Python, I get this warning:

>>> import dummy
dummy.py:2: DeprecationWarning: Non-ASCII character '\xe8', but 
no declared encoding
  x = "Bennett,Scott (guitar)" == "Scott Bennett"

It should be reporting and displaying line 3, not line 2.


----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-08-05 03:49

Message:
Logged In: YES 
user_id=21627

Thanks for your report. Fixed in tokenizer.c 2.60.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=590888&group_id=5470