[Python-Dev] run 2to3 generated scripts under python2.6 + unicode + extension support

kai davidbranniganz at gmail.com
Wed Nov 26 09:35:59 CET 2008

there's an alpha-release interpreter based on cpython2.6 that has
support for 2.6 extensions, & can automatically generate & import
files using 2to3 (& pure python3.0 scripts as well).  it consists of 3
files & is intended to coexist w/ an existing python2.6 installation


enclosed is its patch summary against Python-2.6 (most of it deals w/
backporting 3.0 opcodes).

here's a test run of it (version 2008.11.23) importing most of
Python2.6's standard library regenerated by 2to3:

  $ python setup.py dev --py2to3test
  tested 200 2to3 generated scripts from 2.6.py3to2 (r26:66714, Nov 25
2008, 22:10:03)
  [GCC 3.4.6 20060404 (Red Hat 3.4.6-10)] standard library

  0 skipped:

  23 couldn't import required modules:
  BaseHTTPServer CGIHTTPServer cgi cookielib copy dummy_threading
HTMLParser httplib macurl2path mimetypes os pdb pydoc re robotparser
sgmllib SimpleHTTPServer SimpleXMLRPCServer _strptime tempfile
threading urllib2 urllib

  6 were non-utf8 compliant scripts:
  base64 getopt heapq shlex smtpd tarfile

  14 failed import due to other reasons:
  anydbm dbhash doctest fractions _LWPCookieJar _MozillaCookieJar
pickle sets socket tabnanny UserList UserString whichdb xmlrpclib

  158 passed import:
  _abcoll abc aifc ast asynchat asyncore atexit audiodev Bastion bdb
binhex bisect calendar cgitb chunk cmd codecs codeop code collections
colorsys commands compileall ConfigParser contextlib Cookie copy_reg
cProfile csv decimal difflib dircache dis DocXMLRPCServer dumbdbm
dummy_thread filecmp fileinput fnmatch formatter fpformat ftplib
functools __future__ genericpath getpass gettext glob gzip hashlib
hmac htmlentitydefs htmllib ihooks imaplib imghdr imputil inspect io
keyword linecache locale macpath mailbox mailcap markupbase md5 mhlib
mimetools MimeWriter mimify modulefinder multifile mutex netrc new
nntplib ntpath nturl2path numbers opcode optparse os2emxpath
__phello__.foo pickletools pipes pkgutil platform plistlib popen2
poplib posixfile posixpath pprint profile pstats pty pyclbr py_compile
pydoc_topics Queue quopri random repr rexec rfc822 rlcompleter runpy
sched sha shelve shutil site smtplib sndhdr SocketServer sre_compile
sre_constants sre_parse sre ssl stat statvfs StringIO stringold
stringprep string struct subprocess sunaudio sunau symbol symtable
telnetlib textwrap this _threading_local timeit toaiff tokenize token
traceback trace tty types unittest urlparse UserDict user uuid uu
warnings wave weakref webbrowser xdrlib xmllib zipfile

  $ python setup.py dev --maketest
  324 tests OK.
  36 tests skipped:
      test_aepack test_al test_applesingle test_bsddb185 test_bsddb3
      test_cd test_cl test_codecmaps_cn test_codecmaps_hk
      test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_curses
      test_dl test_gdbm test_gl test_imageop test_imgfile test_kqueue
      test_linuxaudiodev test_macos test_macostools test_normalization
      test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages
      test_socketserver test_startfile test_sunaudiodev test_timeout
      test_urllib2net test_urllibnet test_winreg test_winsound
  1 skip unexpected on linux2:
  completed 2.6 (r26:66714, Nov 17 2008, 13:35:14)
  [GCC 3.4.6 20060404 (Red Hat 3.4.6-10)] regression tests
-------------- next part --------------
A non-text attachment was scrubbed...
Name: py3to2.diff
Type: application/octet-stream
Size: 76483 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-dev/attachments/20081126/1c876b4a/attachment-0001.obj>

More information about the Python-Dev mailing list