[Tutor] Puzzled again

Andre Engels andreengels at gmail.com
Wed Aug 3 08:39:54 CEST 2011


On Wed, Aug 3, 2011 at 8:07 AM, Richard D. Moores <rdmoores at gmail.com>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
> >>>
>

That says that there is some character in that line that is not valid
Unicode. Remove the line (and perhaps the ones above and below it at the
same time, in case it's around the line feed character(s)) and type it in
again. It's likely to be as easy as that.

-- 
André Engels, andreengels at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110803/875c2a4c/attachment.html>


More information about the Tutor mailing list