Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > issues installing readine-1.12 on WinXP

Reply
Thread Tools

issues installing readine-1.12 on WinXP

 
 
Michele Simionato
Guest
Posts: n/a
 
      03-13-2005
I have installed Gary Bishop's readline library and Thomas
Heller's cypes; I have Python 2.4 ActiveState distribution.
When I try to import readline I get the following error:

C:\Programmi>python
ActivePython 2.4 Build 243 (ActiveState Corp.) based on
Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
VkKeyScan("`") = -1
>>> import readline

Exception exceptions.AttributeError: "'Console' object has no attribute
'saveatt
r'" in <bound method Console.__del__ of <readline.Console.Console
object at 0x00
BB5E10>> ignored
VkKeyScan("`") = -1
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python24\Lib\site-packages\readline\__init__.py", line 1, in
?
from PyReadline import *
File "C:\Python24\Lib\site-packages\readline\PyReadline.py", line
1091, in ?
rl = Readline()
File "C:\Python24\Lib\site-packages\readline\PyReadline.py", line 46,
in __ini
t__
self.emacs_editing_mode(None)
File "C:\Python24\Lib\site-packages\readline\PyReadline.py", line
1008, in ema
cs_editing_mode
self._bind_key('"%s"' % chr(c), self.self_insert)
File "C:\Python24\Lib\site-packages\readline\PyReadline.py", line
1000, in _bi
nd_key
keyinfo = key_text_to_keyinfo(key)
File "C:\Python24\Lib\site-packages\readline\keysyms.py", line 101,
in key_tex
t_to_keyinfo
return keyseq_to_keyinfo(keytext[1:-1])
File "C:\Python24\Lib\site-packages\readline\keysyms.py", line 163,
in keyseq_
to_keyinfo
res.append(char_to_keyinfo(keyseq[0], control, meta, shift))
File "C:\Python24\Lib\site-packages\readline\keysyms.py", line 111,
in char_to
_keyinfo
raise ValueError, 'bad key'
ValueError: bad key

Any hints on what is causing this and the cure?
TIA,

Michele Simionato

 
Reply With Quote
 
 
 
 
Simon Percivall
Guest
Posts: n/a
 
      03-13-2005
That shouldn't happen AFAICT. Check line 108 in keysyms.py and make
sure it says "vk = VkKeyScan(ord(char))".

 
Reply With Quote
 
 
 
 
Michele Simionato
Guest
Posts: n/a
 
      03-13-2005
That line seems right. The function is

def char_to_keyinfo(char, control=False, meta=False, shift=False):
vk = VkKeyScan(ord(char))
if vk & 0xffff == 0xffff:
print 'VkKeyScan("%s") = %x' % (char, vk)
raise ValueError, 'bad key'
if vk & 0x100:
shift = True
if vk & 0x200:
control = True
if vk & 0x400:
meta = True
return (control, meta, shift, vk & 0xff)

Maybe the problem is related to the fact that I am using the Italian
keyboard?

 
Reply With Quote
 
Simon Percivall
Guest
Posts: n/a
 
      03-13-2005
Possibly. Is the ` sign available as an unmodified key?

 
Reply With Quote
 
Michele Simionato
Guest
Posts: n/a
 
      03-13-2005
No, I don't even know how to get it under Windows (usually I use
Linux). Switching to the US keyboard
does not help, anyway. I get the same error.

Michele

 
Reply With Quote
 
Simon Percivall
Guest
Posts: n/a
 
      03-13-2005
Well, just modify the source in that case.

 
Reply With Quote
 
Michele Simionato
Guest
Posts: n/a
 
      03-14-2005
Well, this is ugly as the sin but it seems to work, at least for the
moment:

vk = VkKeyScan(ord(char))
if vk == -1: # ugly fix for backtips
vk = 96

I will write to Gary Bishop to point out this issue with the Italian
keyboard and see if he has some decent
solution.

Michele Simonato

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slipstreaming winxp 64 sp2 into Winxp 64 Kue2 Windows 64bit 10 03-17-2007 12:13 AM
Is 64-bit WinXP faster than 32-bit WinXP? Man-wai Chang Windows 64bit 10 04-23-2006 01:25 PM
WinXP 64 .mp3 summary change to look like WinXP 32? Manquala Windows 64bit 4 01-15-2006 04:01 AM
Session object doesn't work after installing WinXP SP2 Peter Afonin ASP .Net 2 08-17-2004 04:25 PM
WinXP Welcome screen appears after installing VS .Net 2K3 Grahammer ASP .Net 0 11-08-2003 05:38 PM



Advertisments