Message139961
Hi,
When you type (not copy-paste!) into an IDLE shell a string literal followed by (
you get a calltip.
When the string contains a bad unicode escaping you get an error (see example below), which makes some sense.
But when the string is raw, it isn't treated as such, and you may get the same error, though now it doesn't make any sense.
Non-raw example:
>>> '\xyz'(
>>> *** Internal Error: rpc.py:SocketIO.localcall()
Object: exec
Method: <bound method Executive.get_the_calltip of <idlelib.run.Executive object at 0x021C2910>>
Args: ("'\\xyz'",)
Traceback (most recent call last):
File "C:\Python32\lib\idlelib\rpc.py", line 188, in localcall
ret = method(*args, **kwargs)
File "C:\Python32\lib\idlelib\run.py", line 324, in get_the_calltip
return self.calltip.fetch_tip(name)
File "C:\Python32\lib\idlelib\CallTips.py", line 103, in fetch_tip
entity = self.get_entity(name)
File "C:\Python32\lib\idlelib\CallTips.py", line 112, in get_entity
return eval(name, namespace)
File "<string>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-2: truncated \xXX escape
Raw example:
>>> r'\xyz'(
>>> *** Internal Error: rpc.py:SocketIO.localcall()
Object: exec
Method: <bound method Executive.get_the_calltip of <idlelib.run.Executive object at 0x021C2910>>
Args: ("'\\xyz'",)
Traceback (most recent call last):
File "C:\Python32\lib\idlelib\rpc.py", line 188, in localcall
ret = method(*args, **kwargs)
File "C:\Python32\lib\idlelib\run.py", line 324, in get_the_calltip
return self.calltip.fetch_tip(name)
File "C:\Python32\lib\idlelib\CallTips.py", line 103, in fetch_tip
entity = self.get_entity(name)
File "C:\Python32\lib\idlelib\CallTips.py", line 112, in get_entity
return eval(name, namespace)
File "<string>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-2: truncated \xXX escape |
|
Date |
User |
Action |
Args |
2011-07-06 23:27:22 | Roy.Fox | set | recipients:
+ Roy.Fox |
2011-07-06 23:27:22 | Roy.Fox | set | messageid: <1309994842.51.0.029840708446.issue12510@psf.upfronthosting.co.za> |
2011-07-06 23:27:21 | Roy.Fox | link | issue12510 messages |
2011-07-06 23:27:21 | Roy.Fox | create | |
|