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


Groups > comp.lang.python > #7139

Re: Print Window on IDLE

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.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.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; '2.7': 0.04; 'attempting': 0.04; 'subject:IDLE': 0.04; 'value,': 0.04; '3.2': 0.05; 'url:bugs': 0.05; 'bug.': 0.07; 'option,': 0.07; 'roll': 0.07; 'versions.': 0.07; 'python': 0.08; "(it's": 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'tkinter': 0.09; 'syntax': 0.11; 'linux': 0.11; 'error:': 0.12; 'exception': 0.12; '%r"': 0.16; '3.2.': 0.16; '54,': 0.16; 'bug?': 0.16; 'callback': 0.16; 'closes': 0.16; 'defaults,': 0.16; 'from:addr:yahoo.com.ar': 0.16; 'to"': 0.16; 'type=type,': 0.16; 'windows?': 0.16; 'skip:" 40': 0.16; 'traceback': 0.16; '(most': 0.16; 'mon,': 0.17; 'command': 0.19; 'solution.': 0.19; 'seems': 0.21; 'file,': 0.22; 'fine': 0.22; 'last):': 0.23; "skip:' 40": 0.23; 'steve': 0.24; 'code': 0.24; 'problem': 0.28; 'skip:" 30': 0.29; 'import': 0.29; 'idle': 0.29; 'temporary': 0.29; 'offending': 0.30; 'entry': 0.31; 'header:X-Complaints-To:1': 0.32; 'file.': 0.32; 'someone': 0.33; 'to:addr:python-list': 0.33; 'actually': 0.33; 'lines': 0.33; 'starting': 0.33; 'error': 0.33; 'file': 0.34; 'header:User-Agent:1': 0.35; 'fails': 0.35; 'using': 0.35; 'open': 0.36; 'change': 0.37; 'url:python': 0.38; 'received:org': 0.38; 'edit': 0.38; 'url:org': 0.38; 'but': 0.38; 'earlier': 0.38; 'subject:: ': 0.38; 'should': 0.39; 'header:Mime- Version:1': 0.39; 'to:addr:python.org': 0.39; 'your': 0.60; 'back': 0.63; 'become': 0.72; 'received:190': 0.74; '"how': 0.80; '-0300,': 0.84; '__call__': 0.84; 'entry,': 0.84; 'genellina': 0.84; 'gabriel': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From "Gabriel Genellina" <gagsl-py2@yahoo.com.ar>
Subject Re: Print Window on IDLE
Date Tue, 07 Jun 2011 03:22:44 -0300
References <9184B5BB5F0EE2438C877DF95AD93B510F8C768DA5@MAILMBX03.MAIL.LA.GOV>
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-1; format=flowed; delsp=yes
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host 190.2.4.25
User-Agent Opera Mail/11.11 (Win32)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2522.1307427593.9059.python-list@python.org> (permalink)
Lines 64
NNTP-Posting-Host 82.94.164.166
X-Trace 1307427593 news.xs4all.nl 49047 [::ffff:82.94.164.166]:47577
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:7139

Show key headers only | View raw


En Mon, 06 Jun 2011 14:48:26 -0300, Steve Oldner <Steven.Oldner@la.gov>  
escribió:

> Seems to work using 2.7 but not 3.2.  On 3.2 it just closes all my  
> python sessions.  Is this a bug?  Can someone point me to a "How To" on  
> using a local printer in windows?

It's a bug. Starting IDLE from the command line, one can actually see the  
error:


Exception in Tkinter callback
Traceback (most recent call last):
   File "D:\apps\python32\lib\tkinter\__init__.py", line 1399, in __call__
     return self.func(*args)
   File "D:\apps\python32\lib\idlelib\IOBinding.py", line 453, in  
print_window
     command = idleConf.GetOption('main','General','print-command-win')
   File "D:\apps\python32\lib\idlelib\configHandler.py", line 245, in  
GetOption
     type=type, raw=raw)
   File "D:\apps\python32\lib\idlelib\configHandler.py", line 54, in Get
     return self.get(section, option, raw=raw)
   File "D:\apps\python32\lib\configparser.py", line 789, in get
     d)
   File "D:\apps\python32\lib\configparser.py", line 391, in before_get
     self._interpolate_some(parser, option, L, value, section, defaults, 1)
   File "D:\apps\python32\lib\configparser.py", line 440, in  
_interpolate_some
     "found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(',  
found
: '%s'

IDLE is attempting to read an entry from its configuration file, but fails  
because of a syntax error in the file (it's an error for a ConfigParser  
entry, %s should be %%s). The same entry was fine for earlier IDLE  
versions. As a workaround, you may edit the offending lines in your  
configuration file.


Go to the idlelib directory; if you don't know where it is, just open idle  
or Python command line and execute:

py> import idlelib
py> idlelib.__file__
'D:\\apps\\python32\\lib\\idlelib\\__init__.py'

In the same directory you'll find config-main.def; open it, and replace  
these lines in the [General] section:

print-command-posix=lpr %%s
print-command-win=start /min notepad /p %%s

(%s should become %%s). Tested on Windows, but Linux should have the same  
problem and temporary solution. You may need to roll this change back when  
the code is corrected.

Reported as http://bugs.python.org/issue12274


-- 
Gabriel Genellina

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


Thread

Re: Print Window on IDLE "Gabriel Genellina" <gagsl-py2@yahoo.com.ar> - 2011-06-07 03:22 -0300

csiph-web