Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #65160

Re: Python shell wont open idle or an exisiting py file

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'win32': 0.03; 'subject:Python': 0.06; 'debugging': 0.07; 'rename': 0.07; 'subject:file': 0.07; 'tkinter': 0.07; '__init__': 0.09; 'callback': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'skip:$ 30': 0.09; 'wrapped': 0.09; 'python': 0.11; 'jan': 0.12; '36,': 0.16; 'bug,': 0.16; 'codec': 0.16; 'filename,': 0.16; 'key)': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'import': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'byte': 0.24; 'skip:" 30': 0.26; 'skip:" 40': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'fixed': 0.29; 'url:bugs': 0.29; 'skip:( 20': 0.30; 'seemingly': 0.31; 'file': 0.32; 'open': 0.33; 'url:python': 0.33; '(most': 0.33; 'beginning': 0.33; 'message.': 0.35; "can't": 0.35; 'skip:s 30': 0.35; 'skip:u 20': 0.35; 'but': 0.35; 'there': 0.35; 'entry': 0.36; 'url:org': 0.36; 'nov': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'recent': 0.39; 'delete': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:org': 0.40; 'skip:u 10': 0.60; 'received:173': 0.61; 'further': 0.61; 'first': 0.61; 'name': 0.63; 'such': 0.63; 'more': 0.64; 'due': 0.66; 'invalid': 0.68; 'line,': 0.68; 'caused': 0.69; '10:': 0.84; '14:': 0.84; 'otten': 0.84; 'received:fios.verizon.net': 0.84; '2013,': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Python shell wont open idle or an exisiting py file
Date Fri, 31 Jan 2014 20:45:49 -0500
References <24EAA33389A147D8BC08B029E2209E16@UserPC> <lcguq4$a3s$1@ger.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-173-75-254-207.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
In-Reply-To <lcguq4$a3s$1@ger.gmane.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6239.1391219167.18130.python-list@python.org> (permalink)
Lines 72
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1391219167 news.xs4all.nl 2882 [2001:888:2000:d::a6]:52732
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:65160

Show key headers only | View raw


On 1/31/2014 2:51 PM, Peter Otten wrote:
> rpucci2@cox.net wrote:
>
>> Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:18:40) [MSC v.1600 32
>> bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more
>> information.
>>>>> import idlelib.idle
>> Exception in Tkinter callback
>> Traceback (most recent call last):
>>    File "C:\Python33\lib\tkinter\__init__.py", line 1475, in __call__
>>      return self.func(*args)
>>    File "C:\Python33\lib\idlelib\EditorWindow.py", line 927, in
>>    open_recent_file
>>      self.io.open(editFile=fn_closure)
>>    File "C:\Python33\lib\idlelib\IOBinding.py", line 183, in open
>>      flist.open(filename)
>>    File "C:\Python33\lib\idlelib\FileList.py", line 36, in open
>>      edit = self.EditorWindow(self, filename, key)
>>    File "C:\Python33\lib\idlelib\PyShell.py", line 126, in __init__
>>      EditorWindow.__init__(self, *args)
>>    File "C:\Python33\lib\idlelib\EditorWindow.py", line 287, in __init__
>>      if io.loadfile(filename):
>>    File "C:\Python33\lib\idlelib\IOBinding.py", line 242, in loadfile
>>      self.updaterecentfileslist(filename)
>>    File "C:\Python33\lib\idlelib\IOBinding.py", line 523, in
>>    updaterecentfileslist
>>      self.editwin.update_recent_files_list(filename)
>>    File "C:\Python33\lib\idlelib\EditorWindow.py", line 915, in
>>    update_recent_files_list
>>      menu.delete(0, END)  # clear, and rebuild:
>>    File "C:\Python33\lib\tkinter\__init__.py", line 2778, in delete
>>      if 'command' in self.entryconfig(i):
>>    File "C:\Python33\lib\tkinter\__init__.py", line 2788, in entryconfigure
>>      return self._configure(('entryconfigure', index), cnf, kw)
>>    File "C:\Python33\lib\tkinter\__init__.py", line 1247, in _configure
>>      self.tk.call(_flatten((self._w, cmd)))):
>> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 10:
>> invalid start byte
>> This is the error message.

> What happens if you rename
>
> $HOME/.idlerc/recent-files.lst

For me, on Win7, $HOME is C:/Users/Terry

> (to an arbitrary name, just to keep it around for further debugging if the
> file indeed triggers the problem)?

Or try the following in the console with the file name changed, but 
without the first line wrapped

with open('C:/Users/Terry/.idlerc/recent-files.lst', encoding='utf-8') as f:
      for n, line in enumerate(f):
           print(n, line, end='')

There was a (non-obvious) bug, recently fixed in
http://bugs.python.org/issue19020
which caused this seemingly bogus error message when an entry in 
recent-files.list contained a directory or file name beginning with '0'.

H:\HP_Documents\0PythonWork\AirplaneKinematics\accel2.py
caused this message
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 14: 
invalid start byte

If your file has such a line, either delete it or upgrade to 3.3.4 (rc1, 
final soon) or 3.4.0 (rc1 due soon).

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python shell wont open idle or an exisiting py file Terry Reedy <tjreedy@udel.edu> - 2014-01-31 20:45 -0500

csiph-web