Skip to content

Problems with Python word_count_test #3385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Miles-Williams opened this issue Feb 21, 2017 · 8 comments
Closed

Problems with Python word_count_test #3385

Miles-Williams opened this issue Feb 21, 2017 · 8 comments

Comments

@Miles-Williams
Copy link

Fetched the word-count exercise for Python and the test file won't open in IDLE.

I'm on a Win7 32bit machine and running Python 3.6. I've had no issues with the previous 6 exercises.

When I try to open it by right-clicking and selecting "Edit in IDLE" it just fails to open. It's not that IDLE can't open the file, IDLE just doesn't open at all.
If I try opening it from within an already running instance of IDLE it opens a new "untitled" file.

I am not having any issues with any of my other Python files, just this one.

I have deleted the word-count directory and its contents and re-fetched the exercise but still the same issue.

@NobbZ
Copy link
Member

NobbZ commented Feb 21, 2017

The file itself seems to be OK. You can see it at https://github.com/exercism/xpython/blob/master/exercises/word-count/word_count_test.py

  • What size does your filemanager show?
  • Can you read it using notepad.exe?
  • Are you able to run it without IDLE from the cmd-prompt? python word_count_test.py, make sure python.exe is in your PATH though.

@Miles-Williams
Copy link
Author

Miles-Williams commented Feb 22, 2017 via email

@NobbZ
Copy link
Member

NobbZ commented Feb 22, 2017

So it seems that the file is OK but IDLE is broken. I will try to install python as well as IDLE once I have hands back on a computer (~3 hours from now) and do some experiments.

In the meantime, you can try to re-install/update IDLE.

Oh, and please check if you have the same problem when

  • downloading the file manually from github (link above)
  • manually copy-pasting the content into IDLE and then save it and reopen

@Miles-Williams
Copy link
Author

Miles-Williams commented Feb 22, 2017 via email

@NobbZ
Copy link
Member

NobbZ commented Feb 22, 2017

OK, I tried it locally and observe the same behaviour as you. So I tried to start IDLE from cmd and got a python stack in my face:

~/AppData/Local/Programs/Python/Python36-32/python ~/AppData/Local/Programs//Python/Python36-32/Lib/idlelib/idle.pyw word_count_test.py
Traceback (most recent call last):
  File "C:/Users/NobbZ/AppData/Local/Programs/Python/Python36-32/Lib/idlelib/idle.pyw", line 17, in <module>
    idlelib.pyshell.main()
  File "C:\Users\NobbZ\AppData\Local\Programs\Python\Python36-32\lib\idlelib\pyshell.py", line 1481, in main
    if flist.open(filename) is None:
  File "C:\Users\NobbZ\AppData\Local\Programs\Python\Python36-32\lib\idlelib\filelist.py", line 37, in open
    edit = self.EditorWindow(self, filename, key)
  File "C:\Users\NobbZ\AppData\Local\Programs\Python\Python36-32\lib\idlelib\pyshell.py", line 118, in __init__
    EditorWindow.__init__(self, *args)
  File "C:\Users\NobbZ\AppData\Local\Programs\Python\Python36-32\lib\idlelib\editor.py", line 247, in __init__
    if io.loadfile(filename):
  File "C:\Users\NobbZ\AppData\Local\Programs\Python\Python36-32\lib\idlelib\iomenu.py", line 241, in loadfile
    self.text.insert("1.0", chars)
  File "C:\Users\NobbZ\AppData\Local\Programs\Python\Python36-32\lib\idlelib\percolator.py", line 28, in insert
    self.top.insert(index, chars, tags)
  File "C:\Users\NobbZ\AppData\Local\Programs\Python\Python36-32\lib\idlelib\undo.py", line 83, in insert
    self.addcmd(InsertCommand(index, chars, tags))
  File "C:\Users\NobbZ\AppData\Local\Programs\Python\Python36-32\lib\idlelib\undo.py", line 118, in addcmd
    cmd.do(self.delegate)
  File "C:\Users\NobbZ\AppData\Local\Programs\Python\Python36-32\lib\idlelib\undo.py", line 219, in do
    text.insert(self.index1, self.chars, self.tags)
  File "C:\Users\NobbZ\AppData\Local\Programs\Python\Python36-32\lib\idlelib\colorizer.py", line 101, in insert
    self.delegate.insert(index, chars, tags)
  File "C:\Users\NobbZ\AppData\Local\Programs\Python\Python36-32\lib\idlelib\redirector.py", line 150, in __call__
    return self.tk_call(self.orig_and_operation + args)
_tkinter.TclError: character U+1f596 is above the range (U+0000-U+FFFF) allowed by Tcl

So in fact, it is a mix of the files fault as well as IDLEs fault. IDLE 2.7 does work well though...

Please report a bug at IDLEs tracker. The faulty line seems to be this one: word_count('до🖖свидания!'), IDLE crashes on paste.

I would be happy if @exercism/python would look into this as well, therefore I'll move the thread into the python repository.

@NobbZ
Copy link
Member

NobbZ commented Feb 22, 2017

Issue moved to exercism/xpython #416 via ZenHub

@NobbZ
Copy link
Member

NobbZ commented Feb 22, 2017

Hmpf, I'm not allowed to close here, please go to exercism/python#416 and continue discussion over there.

Also please can someone with appropriate rights close this?

@kotp kotp closed this as completed Feb 22, 2017
@Miles-Williams
Copy link
Author

Miles-Williams commented Feb 22, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants