Bugs item #788035, was opened at 2003-08-13 09:17 Message generated for change (Comment added) made by akuchling You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=788035&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Torsten Marek (shlomme) Assigned to: Nobody/Anonymous (nobody) Summary: missing universal newline support in os.popen & friends Initial Comment: In contrast to the documentation, os.popen and relatives do not support the "U" format character in their constructors. os.popen("some_nifty_command some_arg", "rU") throws OSError: [Errno 22] Invalid argument , while os.popen{2,3,4} just ignores "U". I noticed that behaviour while p-opening oggenc (the ogg vorbis encoder), which uses curses for output. The lines end with \r and not with \n (due to some ncurses internals, I suspect), so that the file objects readline() function cannot split the output. ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2006-08-03 16:50 Message: Logged In: YES user_id=11375 popen5 was added to Python 2.4 as the subprocess module. It's probably unlikely that someone will go back and fix the low-level os.popen2() function. I suggest that this bug be closed, and we encourage people to use the subprocess module. ---------------------------------------------------------------------- Comment By: Philip Lindsay (philiplindsay) Date: 2004-01-13 05:46 Message: Logged In: YES user_id=254205 See http://advogato.org/person/follower/diary.html?start=43 for details of a possible interim work around. (WFM, YMMV) ---------------------------------------------------------------------- Comment By: Philip Lindsay (philiplindsay) Date: 2004-01-13 05:45 Message: Logged In: YES user_id=254205 See <http://advogato.org/person/follower/diary.html?start=43> for details of a possible interim work around. (WFM, YMMV) ---------------------------------------------------------------------- Comment By: Peter Åstrand (astrand) Date: 2003-11-03 15:01 Message: Logged In: YES user_id=344921 I've added universal newline support to popen5. http://www.lysator.liu.se/~astrand/popen5/. ---------------------------------------------------------------------- Comment By: Jack Jansen (jackjansen) Date: 2003-08-26 18:04 Message: Logged In: YES user_id=45365 Theoretically this is easy to fix: if mode=="U" or "rU" just pass "r" to popen(), "rb" to fdopen() and _O_BINARY to the lowlevel calls, and the original string to PyFile_FromFile. But this whole popen{,2,3,4} section of posixmodule.c is so fiendishly complicated with all the platform special cases that I'm loath to touch it... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=788035&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com