IMO os.popen() is wrong here. On Sat, Apr 12, 2008 at 4:33 PM, Tim Heaney <[EMAIL PROTECTED]> wrote: > In Python 3.0, it seems that os.popen yields a string, whereas > subprocess.Popen yields bytes > > $ ./python > Python 3.0a4 (r30a4:62119, Apr 12 2008, 18:15:16) > [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import os, subprocess > >>> os.popen('date').readline() > 'Sat Apr 12 19:08:05 EDT 2008\n' > >>> subprocess.Popen(['date'], stdout=subprocess.PIPE).communicate()[0] > b'Sat Apr 12 19:08:13 EDT 2008\n' > > Is this intentional? If so, why should I expect this? Thanks! > > Tim > _______________________________________________ > Python-3000 mailing list > Python-3000@python.org > http://mail.python.org/mailman/listinfo/python-3000 > Unsubscribe: > http://mail.python.org/mailman/options/python-3000/guido%40python.org >
-- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com