[Python-porting] Unclear error message

Joe Stepansky kq3f at comcast.net
Wed Apr 26 11:23:00 EDT 2017


I've decided to just jump into 3.6 by porting one of my Python 2.7 programs.
The first error I received was an easy one to resolve, but now I have one I
don't understand. Here's the code:

 

with open('C:\Users\Joe\METAR.filelist.txt','r') as METAR_filelist:

                     ^

This gives me an error message with a "caret" below the first (open)
parentheses and the following message:

 

SyntaxError: (Unicode error) 'unicodeescape' codec can't decode bytes in
position 2-3: truncated \UXXXXXXXX escape

 

Huh? I tried removing the parentheses but, of course, that was also a syntax
error. Checked the online 3.6 docs for "with open" and my code looks OK. But
it isn't. Any suggestions welcome.

 

Joe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170426/89140b6e/attachment.html>


More information about the Python-porting mailing list