This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Idle (Python 3.4 on Ubuntu) does not allow typing accents
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.4
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: @nkit, Gian Carlo Martinelli, eryksun, rogeriowolff, serhiy.storchaka, terry.reedy
Priority: normal Keywords:

Created on 2015-10-09 15:29 by Gian Carlo Martinelli, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (17)
msg252620 - (view) Author: Gian Carlo Martinelli (Gian Carlo Martinelli) Date: 2015-10-09 15:29
IDLE (using Python 3.4 on Ubuntu) does not recognize accent key presses (ex: ~, ^, ').

This makes it impossible to program in some languages.
msg252656 - (view) Author: Ankit Baruah (@nkit) Date: 2015-10-09 21:06
Hello, i am totally new.I went through Pythons Developers guide and would like to learn so please tell me what i should learn to resolve this issue.
msg252659 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-10-09 21:09
IDLE uses tkinter which wraps the tcl/tk GUI framework.  Tk handles key presses.  So this is almost certainly not an IDLE bug, or even a tkinter bug. Unless you can demonstrate otherwise, I will closing this as a CPython issue.

Since this is the first report I know of reporting a problem with ascii chars, there is almost certainly something peculiar about your system.  You should probably ask for help on python-list (or use the gmane.comp.python.general mirror as news.gmane.org).  Here are some preliminary questions.

Do the keys work in the Ubuntu console?
Do the keys work in interactive python (not IDLE), started with 'python' at the console prompt.
In IDLE, go to Help->About IDLE.  What is the Tk version.
  Best if 8.6.x, if before 8.5.18, upgrade.

Run the following program (IDLE editor is fine).

from tkinter import *
root = Tk()
text = Text(root)
text.pack()
text.focus_set()  # required to work
root.mainloop()

Try typing in the text box, including the problem chars.  What happens?
msg252660 - (view) Author: Gian Carlo Martinelli (Gian Carlo Martinelli) Date: 2015-10-09 21:14
1) Do the keys work in the Ubuntu console?
Yes.

2) Do the keys work in interactive python (not IDLE), started with 'python' at the console prompt.
Yes.

3) In IDLE, go to Help->About IDLE.  What is the Tk version.
  Best if 8.6.x, if before 8.5.18, upgrade.
8.6.1

4) Try typing in the text box, including the problem chars.  What happens?
Ran the program, all characters work perfectly.
msg252666 - (view) Author: Ankit Baruah (@nkit) Date: 2015-10-09 21:31
Yes same answers as Gian characters worked perfectly
msg252673 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-10-09 22:58
Ankit: the issue is where do they fail, why, and how to fix.  Are you running Ubuntu also?

G.C. How do you start IDLE? Is the problem with exactly those three chars? Do they fail in the Shell? an editor? search box? other entry box such as you get with Alt-M? Open file dialog (control-O)?

Does this have expected output?

for m in range(32, 128, 16):
    for n in range(16):
        print(chr(m + n), ' ', end='')
    print()
# should print
   !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /  
0  1  2  3  4  5  6  7  8  9  :  ;  <  =  >  ?  
@  A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  
P  Q  R  S  T  U  V  W  X  Y  Z  [  \  ]  ^  _  
`  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  
p  q  r  s  t  u  v  w  x  y  z  {  |  }  ~    
>>>
msg252674 - (view) Author: Gian Carlo Martinelli (Gian Carlo Martinelli) Date: 2015-10-09 23:40
Terry, first of all thanks for trying to solve this.

I usually start IDLE using Ubuntu's dash.

The problem is with more than just the three characters. Others that I have tested and that don't work include "ç", "`", umlauts... There work in others places in my system such as the console for example.

When I try ALT+M or CTRL+O, inside IDLE, these characters work.

This is a copy of my output. Seems OK
!  "  #  $  %  &  '  (  )  *  +  ,  -  .  /  
0  1  2  3  4  5  6  7  8  9  :  ;  <  =  >  ?  
@  A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  
P  Q  R  S  T  U  V  W  X  Y  Z  [  \  ]  ^  _  
`  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  
p  q  r  s  t  u  v  w  x  y  z  {  |  }  ~  
msg252680 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-10-10 02:59
I am not surprised that non-ascii chars fail also. But, all? or just a few (all symbol? or only diacriticals)?

My first thought was that you have a european keyboard that is does not match your Ubuntu configuration.  Or that you had an older tcl/tk that did not work with such.

^O opens a dialog that IDLE is not involved with.  Alt-M open a different tk widget that IDLE in not involved with.

Do shell and editor have exactly the same problems?

Let's try two other things.  Alt-F3 opens Find in Files (grep).  Can you enter any of `'^~ on the first line?

Put anything on the first line and add a *fake* directory on the second (so you have something like zyx/*.py).  Search.  Try typing in the Output Window.  It is slightly different from shell and editor (no colors, for instance).

Ankit: I am trying to narrow possibilities using my knowledge of IDLE internals.  I wish I knew what *I* need to learn for this.
msg252685 - (view) Author: Ankit Baruah (@nkit) Date: 2015-10-10 04:26
Yes,i am using ubuntu.


Thank you Terry for guiding me really appreciate your help. 
Sorry for not replying fell asleep.
msg252687 - (view) Author: Ankit Baruah (@nkit) Date: 2015-10-10 04:53
Find in Files (grep)
Yes can type `'^~.

Output Window 
Yes seems to work can type `'^~ and other characters.
msg252691 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-10-10 06:09
Do you have problems with ASCII characters "'", "^", "~", or with combining accents in "á", "â", "ã"?
msg252713 - (view) Author: Gian Carlo Martinelli (Gian Carlo Martinelli) Date: 2015-10-10 13:32
@Terry
Using 'Find in Files' (Alt+F3) works fine. I can type everything normally. Also in the Output everything is fine.

Apparently the problem is only with diacriticals (I mentioned 'ç', but it is working (I have a particular key for that in my keyboard... it is a Brazilian keyboard)).

@Serhiy
The problem is both with standalone keys ('`~^) and accented characters (ãẽéáà etc)



Today I found a very strange behaviour.

IF I start IDLE with a clean file, everything works fine. 

If then I open a .py file, or save the new file as .py, after 3-5 seconds these keys stop working. Very strange...

I hope I was clear in describing this.

@Ankit: check if this behavior is the same for you.
msg253443 - (view) Author: Gian Carlo Martinelli (Gian Carlo Martinelli) Date: 2015-10-26 00:40
Any additional input on this issue?
msg253451 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-10-26 02:06
I am out of ideas.  You might ask on python-list (accessible as newsgroup mirror on news.gmane.org) whether any other Ubunto users have the problem or have heard of it.
msg253518 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2015-10-27 05:00
This seems to be a problem with Tk 8.6 when using an international keyboard layout on Linux. I ran the following test.tcl script via wish:

    text .t
    pack .t

Initially dead keys work, but they stop working if I switch away from the text entry to another window and then back. Using the menu to save a file in IDLE has the same effect. I suggest opening a ticket at http://core.tcl.tk/tk.
msg253526 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-10-27 09:34
Thank you for the confirmation that this is a tcl/tk problem. At least this report is here for anyone else using 8.6 with non-US keyboard on linux.
msg277923 - (view) Author: Rogério Nunes Wolff (rogeriowolff) Date: 2016-10-03 02:43
I find this bug recently in my IDLE. Ubuntu 14.04, Python 3.4.3, Tk 8.6.1. How can I fix this?
History
Date User Action Args
2022-04-11 14:58:22adminsetgithub: 69543
2016-10-03 02:43:56rogeriowolffsetnosy: + rogeriowolff
messages: + msg277923
2015-10-27 09:34:48terry.reedysetstatus: open -> closed
resolution: third party
messages: + msg253526

stage: resolved
2015-10-27 05:00:32eryksunsetnosy: + eryksun
messages: + msg253518
2015-10-26 02:06:57terry.reedysetmessages: + msg253451
2015-10-26 00:40:26Gian Carlo Martinellisetmessages: + msg253443
2015-10-10 13:32:30Gian Carlo Martinellisetmessages: + msg252713
2015-10-10 06:09:24serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg252691
2015-10-10 04:53:49@nkitsetmessages: + msg252687
2015-10-10 04:26:23@nkitsetmessages: + msg252685
2015-10-10 02:59:57terry.reedysetmessages: + msg252680
2015-10-09 23:40:09Gian Carlo Martinellisetmessages: + msg252674
2015-10-09 22:58:24terry.reedysetmessages: + msg252673
2015-10-09 21:31:27@nkitsetmessages: + msg252666
2015-10-09 21:14:24Gian Carlo Martinellisetmessages: + msg252660
2015-10-09 21:09:46terry.reedysetnosy: + terry.reedy
messages: + msg252659
2015-10-09 21:06:34@nkitsetnosy: + @nkit
messages: + msg252656
2015-10-09 15:29:20Gian Carlo Martinellicreate