[Tutor] Puzzled again

Dave Angel d at davea.name
Wed Aug 3 09:17:22 CEST 2011


On 08/03/2011 02:07 AM, Richard D. Moores wrote:
> On Tue, Aug 2, 2011 at 21:59, Dave Angel<d at davea.name>  wrote:
>
>> When I paste that from your email into a file and run Python 2.7 on it, it
>> behaves fine with no errors.  That's in Linux.
>
> I should have said that I'm using Wing IDE Professional 4.0.3-1 (rev
> 24721), Windows Vista, and Python 3.2.1.
>
>> But the easiest explanation is that you perhaps used a funny character for
>> your triple-quotes.  And when you retyped them on a new line, you typed
>> regular ones.
>>
>> For example, I've seen that sort of thing when someone wrote code in a
>> Windows word processor that had "smart quotes."
>
> No, no funny characters with Wing.
>
> Thanks for your guess, Dave.
>
> But here's a try using the regular command line:
>
> C:\Windows\System32>python
> Python 3.2.1 (default, Jul 10 2011, 20:02:51) [MSC v.1500 64 bit
> (AMD64)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from mycalc import convertPath
> Traceback (most recent call last):
>    File "<stdin>", line 1, in<module>
>    File "C:\Python32\lib\site-packages\mycalc.py", line 36
>      """
> SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes
> in position 149-151: truncated \UXXXXXXX
> X escape
>>>>
>
> Dick
>
OK, so it's no longer a guess, it's a certainty.  You can't get that 
error unless you have a non-ASCII character there.  So take a look at 
the file with a hex viewer, and look at offset 149.  Somewhere there's a 
character above hex 7f


-- 

DaveA


More information about the Tutor mailing list