[issue11396] add format handler to bytes object

2011-03-04 Thread nestor

New submission from nestor nestornis...@gmail.com:

Many programs written for Python 2.x use simple string interpolation to create 
byte strings with specific layout, this is gone in 3.x. Is it possible to 
support the format method but maybe only supporting field names like '{}' 
'{1}{2}' '{name}' and not conversion and formatting for the bytes type?

Examples:
http://mail.python.org/pipermail/python-list/2011-March/1267308.html

and the get_current_url function at this post:
http://lucumr.pocoo.org/2010/5/25/wsgi-on-python-3/

--
messages: 130055
nosy: nestor
priority: normal
severity: normal
status: open
title: add format handler to bytes object
type: feature request
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11396
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11396] add format handler to bytes object

2011-03-04 Thread nestor

nestor nestornis...@gmail.com added the comment:

My search fu has failed me this time. This is indeed a duplicate of issue 3982. 
I think the issue is real and not going to go away, but finding a beautiful 
solution has been elusive so far.

--
resolution:  - duplicate

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11396
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10973] OS X 10.6 IDLE, tkinter: Cocoa Tk 8.5 crash when composite character typed in text field

2011-01-23 Thread Nestor Aguilera

Nestor Aguilera aguil...@santafe-conicet.gov.ar added the comment:

On 23 Jan 2011, at 04:33, Georg Brandl wrote:

 Georg Brandl ge...@python.org added the comment:
 
 I disagree. There aren't really 64-bit users on OSX, thanks to fat
 binaries. So if starting IDLE would start a 32-bit interpreter, users
 likely won't even notice. If they do notice, they can still run in
 64-bit mode from the command line.

 Okay, fair enough.  If it's easy to always let IDLE run in 32-bit mode, I'm 
 fine with that.  What about other programs using tkinter?

In a previous message (http://bugs.python.org/issue10973#msg126868) I mentioned 
that I get warning messages with the 32-bit version of 3.1.3 in OSX 10.6. Would 
a 32-bit version for 3.2 correct these?

--
title: OS X 10.6 IDLE,  tkinter: Cocoa Tk 8.5 crash when composite character 
typed in text  field - OS X 10.6 IDLE, tkinter: Cocoa Tk 8.5 crash when 
composite character typed in text field

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10974] IDLE 3.2 not loading on double-click in Finder, OSX 10.6

2011-01-23 Thread Nestor Aguilera

Nestor Aguilera aguil...@santafe-conicet.gov.ar added the comment:

On 22 Jan 2011, at 04:50, Ned Deily wrote:

[...]
 A similar exception occurs (without a crash) when saving a file to a 
 non-ASCII file name and LANG is not properly set:
[...]

Is there a way of telling tkinter to set the encoding to utf-8 (or whatever) 
before seeking recent-files.lst?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10974
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10974] IDLE 3.2 not loading on double-click in Finder, OSX 10.6

2011-01-22 Thread Nestor Aguilera

Nestor Aguilera aguil...@santafe-conicet.gov.ar added the comment:

Ned: thanks for the explanation.

Nestor

===

On 22 Jan 2011, at 04:50, Ned Deily wrote:

 
 Changes by Ned Deily n...@acm.org:
 
 
 --
 Removed message: http://bugs.python.org/msg126820
 
 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue10974
 ___

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10974
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10973] OS X 10.6 IDLE, tkinter: Cocoa Tk 8.5 crash when composite character typed in text field

2011-01-22 Thread Nestor Aguilera

Nestor Aguilera aguil...@santafe-conicet.gov.ar added the comment:

Thanks Ned for thinking of ways out.

- If I had a choice, I would agree with Georg's choice (Ned's option 1): most 
users will not use the composite characters and need not go through 
complications, or worse, cannibalization of the distribution (3a and 3b are 
unacceptable).

Perhaps the existence of the bug could be documented together with the need of 
a proper Tcl/Tk version.

- My experience with python 3.1.3 with OS 10.6 is that when starting IDLE I 
always get several messages of the sort:

  Python(1305,0xa0a5c540) malloc: *** error for object
  0x1a277738: pointer being freed was not allocated
  *** set a breakpoint in malloc_error_break to debug

possibly leading to memory leaks. Thus, I am not happy with 4.

- As for 5a, perhaps with the warnings of Tcl/Tk and composite crashes, one 
could announce this alternative installation. 5b doesn't seem to be worth the 
trouble, given the existence of the MacPorts version.

My 2 cents.

Néstor

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10973] 'ñ' not working with IDLE 3.2rc1 - OSX 10.6.6

2011-01-21 Thread Nestor Aguilera

New submission from Nestor Aguilera aguil...@santafe-conicet.gov.ar:

When trying to type 'ñ' in idle 3.2 (no problem in terminal), python quits 
unexpectedly when started from terminal:

$ idle3
2011-01-21 11:21:55.883 Python[5228:a07] setCanCycle: is deprecated.  Please 
use setCollectionBehavior instead
2011-01-21 11:21:55.890 Python[5228:a07] setCanCycle: is deprecated.  Please 
use setCollectionBehavior instead
2011-01-21 11:21:55.891 Python[5228:a07] setCanCycle: is deprecated.  Please 
use setCollectionBehavior instead
2011-01-21 11:22:08.777 Python[5228:a07] An uncaught exception was raised
2011-01-21 11:22:08.779 Python[5228:a07] *** -[NSCFString characterAtIndex:]: 
Range or index out of bounds
2011-01-21 11:22:08.781 Python[5228:a07] *** Terminating app due to uncaught 
exception 'NSRangeException', reason: '*** -[NSCFString characterAtIndex:]: 
Range or index out of bounds'
*** Call stack at first throw:
(
0   CoreFoundation  0x7fff829c47b4 
__exceptionPreprocess + 180
1   libobjc.A.dylib 0x7fff816300f3 
objc_exception_throw + 45
2   CoreFoundation  0x7fff829c45d7 
+[NSException raise:format:arguments:] + 103
3   CoreFoundation  0x7fff829c4564 
+[NSException raise:format:] + 148
4   Foundation  0x7fff839c15e1 -[NSCFString 
characterAtIndex:] + 97
5   Tk  0x0001012ba035 
-[TKApplication(TKKeyEvent) tkProcessKeyEvent:] + 664
6   Tk  0x0001012c0b38 
TkMacOSXEventsCheckProc + 349
7   Tcl 0x000101175667 
Tcl_DoOneEvent + 316
8   _tkinter.so 0x00010077d801 
Tkapp_MainLoop + 177
9   Python  0x0001000b2b62 
PyEval_EvalFrameEx + 30530
10  Python  0x0001000b34ca 
PyEval_EvalCodeEx + 1770
11  Python  0x0001000b19e3 
PyEval_EvalFrameEx + 26051
12  Python  0x0001000b1bfd 
PyEval_EvalFrameEx + 26589
13  Python  0x0001000b34ca 
PyEval_EvalCodeEx + 1770
14  Python  0x0001000b37df 
PyEval_EvalCode + 63
15  Python  0x0001000da19b 
PyRun_FileExFlags + 187
16  Python  0x0001000da469 
PyRun_SimpleFileExFlags + 521
17  Python  0x0001000ef253 Py_Main + 
3059
18  Python  0x00010e5f 0x0 + 
4294970975
19  Python  0x00010d04 0x0 + 
4294970628
)
terminate called after throwing an instance of 'NSException'
Abort trap
 
#--
The welcome in idle 3.2 is:

Python 3.2rc1 (r32rc1:88040, Jan 15 2011, 13:31:22) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type copyright, credits or license() for more information.

#--
I cannot start IDLE by double-clicking its icon in the Finder.

Best,

Néstor Aguilera

--
components: IDLE
messages: 126739
nosy: naguilera
priority: normal
severity: normal
status: open
title: 'ñ' not working with IDLE 3.2rc1 - OSX 10.6.6
type: crash
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10973] 'ñ' not working with IDLE 3.2rc1 - OSX 10.6.6

2011-01-21 Thread Nestor Aguilera

Nestor Aguilera aguil...@santafe-conicet.gov.ar added the comment:

Thanks Victor and Ned, I'll send a report on the second issue as well (I 
thought it was known).

Néstor Aguilera

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10974] IDLE 3.2 not loading on double-click in Finder, OSX 10.6

2011-01-21 Thread Nestor Aguilera

New submission from Nestor Aguilera aguil...@santafe-conicet.gov.ar:

Here is the report from Console (date/time removed):

[0x0-0x1a11a1].org.python.IDLE[5541]Traceback (most recent call last):
[0x0-0x1a11a1].org.python.IDLE[5541]  File /Applications/Python 
3.2/IDLE.app/Contents/Resources/idlemain.py, line 73, in module
[0x0-0x1a11a1].org.python.IDLE[5541]main()
[0x0-0x1a11a1].org.python.IDLE[5541]  File 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/PyShell.py,
 line 1388, in main
[0x0-0x1a11a1].org.python.IDLE[5541]shell = flist.open_shell()
[0x0-0x1a11a1].org.python.IDLE[5541]  File 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/PyShell.py,
 line 277, in open_shell
[0x0-0x1a11a1].org.python.IDLE[5541]self.pyshell = PyShell(self)
[0x0-0x1a11a1].org.python.IDLE[5541]  File 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/PyShell.py,
 line 813, in __init__
[0x0-0x1a11a1].org.python.IDLE[5541]OutputWindow.__init__(self, flist, 
None, None)
[0x0-0x1a11a1].org.python.IDLE[5541]  File 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/OutputWindow.py,
 line 16, in __init__
[0x0-0x1a11a1].org.python.IDLE[5541]EditorWindow.__init__(self, *args)
[0x0-0x1a11a1].org.python.IDLE[5541]  File 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/EditorWindow.py,
 line 267, in __init__
[0x0-0x1a11a1].org.python.IDLE[5541]self.update_recent_files_list()
[0x0-0x1a11a1].org.python.IDLE[5541]  File 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/EditorWindow.py,
 line 777, in update_recent_files_list
[0x0-0x1a11a1].org.python.IDLE[5541]rf_list = rf_list_file.readlines()
[0x0-0x1a11a1].org.python.IDLE[5541]  File 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/encodings/ascii.py,
 line 26, in decode
[0x0-0x1a11a1].org.python.IDLE[5541]return codecs.ascii_decode(input, 
self.errors)[0]
[0x0-0x1a11a1].org.python.IDLE[5541]UnicodeDecodeError: 'ascii' codec can't 
decode byte 0xcc in position 55: ordinal not in range(128)
com.apple.launchd.peruser.501[168]  ([0x0-0x1a11a1].org.python.IDLE[5541]) 
Exited with exit code: 1

Thanks,

Néstor Aguilera

--
components: IDLE
messages: 126764
nosy: naguilera
priority: normal
severity: normal
status: open
title: IDLE 3.2 not loading on double-click in Finder, OSX 10.6
type: crash
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10974
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10973] 'ñ' not working with IDLE 3.2rc1 - OSX 10.6.6

2011-01-21 Thread Nestor Aguilera

Nestor Aguilera aguil...@santafe-conicet.gov.ar added the comment:

On 21 Jan 2011, at 20:39, Martin v. Löwis wrote:

 Martin v. Löwis mar...@v.loewis.de added the comment:
 
 As this clearly seems to be a Tk bug, I suggest to close this report as 
 won't fix - 3rd party.

I see your point. The problem is that IDLE is somewhat included with Python (so 
in a sense it is not 3rd party), and seems like a good tool for learning 
Python: my concern is similar to that in message 126276 
http://bugs.python.org/msg126276.

All the best,

Nestor

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10973] 'ñ' not working with IDLE 3.2rc1 - OSX 10.6.6

2011-01-21 Thread Nestor Aguilera

Nestor Aguilera aguil...@santafe-conicet.gov.ar added the comment:

On 21 Jan 2011, at 21:12, Martin v. Löwis wrote:

 
 Martin v. Löwis mar...@v.loewis.de added the comment:
 
 I see your point. The problem is that IDLE is somewhat included with
 Python (so in a sense it is not 3rd party), and seems like a good
 tool for learning Python: my concern is similar to that in message
 126276 http://bugs.python.org/msg126276.
 
 Unfortunately, there is little we can do about this (IIUC). One option
 would be to include a fixed Tk version, but there is none to include
 (IIUC). The only real solution to fix both the reported problem and
 the problem of msg126276 would be to stop including IDLE with the MacOS
 distributions, and asking users who want to use IDLE to switch to
 Linux or Windows.

(:-)

I hope you will not consider to also stop including tkinter!

Nestor

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10973
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10299] Add index with links section for built-in functions

2010-11-03 Thread nestor

New submission from nestor nestornis...@gmail.com:

The built-in function page 
(http://docs.python.org/dev/py3k/library/functions.html) is pretty long. Each 
function has an anchor but unlike the built-in types section there is no quick 
way to get an overview or jump to a specific function (like open or print) 
short of scrolling through 22 pages. It would be nice to have an index of all 
built-in functions linked to the specific entry on the built-in functions page. 
This could be either somehow added to the index page 
(http://docs.python.org/dev/py3k/library/index.html) or to the top of the 
built-in functions page itself. For efficient use of real-estate multiple 
function names could be on one single line alphabetically sorted and separated 
by spaces.

--
assignee: d...@python
components: Documentation
messages: 120327
nosy: d...@python, georg.brandl, nestor
priority: normal
severity: normal
status: open
title: Add index with links section for built-in functions
type: feature request
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10299
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10091] ast.literal_eval does not handled new set literals

2010-10-18 Thread nestor

nestor nestornis...@gmail.com added the comment:

FYI although it breaks symmetry with eval, I am fine with this going in for 
3.2. It just surprised me and I wanted to make sure it was documented here for 
future reference.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10091
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10091] ast.literal_eval does not handled new set literals

2010-10-13 Thread nestor

New submission from nestor nestornis...@gmail.com:

 import ast
 eval('{1:11,2:22}')
{1: 11, 2: 22}
 ast.literal_eval('{1:11,2:22}')
{1: 11, 2: 22}

 eval('{1,2}')
{1, 2}
 ast.literal_eval('{1,2}')
Traceback (most recent call last):
  File pyshell#8, line 1, in module
ast.literal_eval('{1,2}')
  File C:\Python31\lib\ast.py, line 80, in literal_eval
return _convert(node_or_string)
  File C:\Python31\lib\ast.py, line 79, in _convert
raise ValueError('malformed string')
ValueError: malformed string

 

I haven't tested for 2.7 or 3.2 but this bug probably applies also there.

--
components: Library (Lib)
messages: 118568
nosy: aronacher, benjamin.peterson, georg.brandl, gpolo, mark.dickinson, 
nestor, rhettinger, terry.reedy
priority: normal
severity: normal
status: open
title: ast.literal_eval does not handled new set literals
type: behavior
versions: Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10091
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6236] os.popen causes illegal seek on AIX in Python 3.1rc

2009-09-22 Thread nestor

nestor nestornis...@gmail.com added the comment:

Fantastic. Applied the patch and it solved the problem with xlc 8.0 on
AIX 5.3.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6236] os.popen causes illegal seek on AIX in Python 3.1rc

2009-07-28 Thread nestor

nestor nestornis...@gmail.com added the comment:

Python 3.1 (r31:73572, Jul  9 2009, 16:28:28) [C] on aix5
Type help, copyright, credits or license for more information.

 import sys
 sys.stdout.seekable()
True


I can access the machine only through ssh.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6236] os.popen causes illegal seek on AIX in Python 3.1rc

2009-07-21 Thread nestor

nestor nestornis...@gmail.com added the comment:

Maybe this has something to do with it?

Python 3.1 (r31:73572, Jul  9 2009, 16:28:28) [C] on aix5
Type help, copyright, credits or license for more information.
 open(/dev/tty,a).seekable()
True


--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6348] solaris/aix: Py_Initialize: can't initialize sys standard streams

2009-07-09 Thread nestor

nestor nestornis...@gmail.com added the comment:

Maybe make test will help troubleshoot this (BTW how do I enable verbose
mode?):

test test_ascii_formatd failed -- errors occurred; run in verbose mode
for details
test_cmath
test test_cmath failed -- Traceback (most recent call last):
  File
/datawhse/test/data/export/ptst/Python-3.1/Lib/test/test_cmath.py,
line 362, in test_specific_values
self.fail(error_message)
AssertionError: atan: atan(complex(0.0, 0.0))
Expected: complex(0.0, 0.0)
Received: complex(0.0, -0.0)
Received value insufficiently close to expected value.
test_cmd_line
test test_cmd_line failed -- errors occurred; run in verbose mode for
details
test_cmd_line_script
test test_cmd_line_script failed -- errors occurred; run in verbose mode
for details
test_code
test_distutils
Exception AttributeError: '_Stream' object has no attribute 'cmp' in
bound method _Stream.__del__ of tarfile._Stream object at 0x218c2d70
ignored
Exception AttributeError: '_Stream' object has no attribute 'cmp' in
bound method _Stream.__del__ of tarfile._Stream object at 0x21763bf0
ignored
unable to execute cc_r: No such file or directory
unable to execute cc_r: No such file or directory
unable to execute cc_r: No such file or directory
Exception AttributeError: '_Stream' object has no attribute 'cmp' in
bound method _Stream.__del__ of tarfile._Stream object at 0x21a3fc30
ignored
Exception AttributeError: '_Stream' object has no attribute 'cmp' in
bound method _Stream.__del__ of tarfile._Stream object at 0x21a3fdd0
ignored
test test_distutils failed -- errors occurred; run in verbose mode for
details
test_fileio
test test_fileio failed -- Traceback (most recent call last):
  File
/datawhse/test/data/export/ptst/Python-3.1/Lib/test/test_fileio.py,
line 262, in testAbles
self.assertEquals(f.seekable(), False)
AssertionError: True != False
test_httpservers
Fatal Python error: Py_Initialize: can't initialize sys standard streams
AttributeError: '_io.FileIO' object has no attribute 'raw'
Fatal Python error: Py_Initialize: can't initialize sys standard streams
AttributeError: '_io.FileIO' object has no attribute 'raw'
Fatal Python error: Py_Initialize: can't initialize sys standard streams
AttributeError: '_io.FileIO' object has no attribute 'raw'
Fatal Python error: Py_Initialize: can't initialize sys standard streams
AttributeError: '_io.FileIO' object has no attribute 'raw'
test test_httpservers failed -- errors occurred; run in verbose mode for
details
test_io
test test_io failed -- errors occurred; run in verbose mode for details
test_mmap
test test_mmap failed -- Traceback (most recent call last):
  File
/datawhse/test/data/export/ptst/Python-3.1/Lib/test/test_mmap.py, line
219, in test_access_parameter
m.flush()
mmap.error: [Errno 22] Invalid argument
test_multiprocessing
test test_multiprocessing failed -- errors occurred; run in verbose mode
for details

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6348
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6236] os.popen causes illegal seek on AIX in Python 3.1rc

2009-06-24 Thread nestor

nestor nestornis...@gmail.com added the comment:

That fails consistently:
Python 2.6.2 (r262:71600, Jun  4 2009, 16:07:26) [C] on aix5
Type help, copyright, credits or license for more information.
 import os
 r,w=os.pipe()
 os.lseek(r,0,1)
Traceback (most recent call last):
  File stdin, line 1, in module
OSError: [Errno 29] Illegal seek

Python 3.0.1 (r301:69556, Jun  4 2009, 16:07:22) [C] on aix5
Type help, copyright, credits or license for more information.
 import os
 r,w=os.pipe()
 os.lseek(r,0,1)
Traceback (most recent call last):
  File stdin, line 1, in module
OSError: [Errno 29] Illegal seek

Python 3.1rc2 (r31rc2:73411, Jun 15 2009, 10:56:49) [C] on aix5
Type help, copyright, credits or license for more information.
 import os
 r,w=os.pipe()
 os.lseek(r,0,1)
Traceback (most recent call last):
  File stdin, line 1, in module
OSError: [Errno 29] Illegal seek


--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6236] os.popen causes illegal seek on AIX in Python 3.1rc

2009-06-08 Thread nestor

nestor nestornis...@gmail.com added the comment:

This quick and dirty fix in pydoc.py makes so it no longer aborts help.

(less behaves somewhat strange for some commands but that is better than
no help at all)

def pipepager(text, cmd):
Page through text by feeding it to another program.
import subprocess
pipe=subprocess.Popen(cmd,stdin=subprocess.PIPE).stdin
#pipe = os.popen(cmd, 'w')
try:
pipe.write(bytes(text,sys.getdefaultencoding()))
#pipe.write(text)
pipe.close()
except IOError:
pass # Ignore broken pipes caused by quitting the pager program.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6236] os.popen causes illegal seek on AIX in Python 3.1rc

2009-06-07 Thread nestor

New submission from nestor nestornis...@gmail.com:

Python 2.6.2 (r262:71600, Jun  4 2009, 16:07:26) [C] on aix5
Type help, copyright, credits or license for more information.
 import os
 os.popen('cat','w')

open file 'cat', mode 'w' at 0x1101ab4f8


Python 3.0.1 (r301:69556, Jun  4 2009, 16:07:22) [C] on aix5
Type help, copyright, credits or license for more information.
 import os
 os.popen('cat','w')

os._wrap_close object at 0x1103e5748 

Python 3.1rc1 (r31rc1:73054, Jun  1 2009, 10:49:24) [C] on aix5
Type help, copyright, credits or license for more information.
 import os
 os.popen('cat','w')

Traceback (most recent call last):
  File stdin, line 1, in module
  File /Python-3.1rc1/Lib/os.py, line 641, in popen
return _wrap_close(io.TextIOWrapper(proc.stdin), proc)
IOError: [Errno 29] Illegal seek 

This in turn causes help not to work:

Python 3.1rc1 (r31rc1:73054, Jun  1 2009, 10:49:24) [C] on aix5
Type help, copyright, credits or license for more information.
 help(open)

Traceback (most recent call last):
  File stdin, line 1, in module
  File /Python-3.1rc1/Lib/site.py, line 429, in __call__
return pydoc.help(*args, **kwds)
  File /Python-3.1rc1/Lib/pydoc.py, line 1709, in __call__
self.help(request)
  File /Python-3.1rc1/Lib/pydoc.py, line 1756, in help
else: doc(request, 'Help on %s:')
  File /Python-3.1rc1/Lib/pydoc.py, line 1505, in doc
pager(render_doc(thing, title, forceload))
  File /Python-3.1rc1/Lib/pydoc.py, line 1320, in pager
pager(text)
  File /Python-3.1rc1/Lib/pydoc.py, line 1340, in lambda
return lambda text: pipepager(text, 'less')
  File /Python-3.1rc1/Lib/pydoc.py, line 1359, in pipepager
pipe = os.popen(cmd, 'w')
  File /Python-3.1rc1/Lib/os.py, line 641, in popen
return _wrap_close(io.TextIOWrapper(proc.stdin), proc)
IOError: [Errno 29] Illegal seek

--
components: Library (Lib)
messages: 89065
nosy: nestor
severity: normal
status: open
title: os.popen causes illegal seek on AIX in Python 3.1rc
versions: Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com