diff --git a/porting-code-to-python-3-with-2to3.html b/porting-code-to-python-3-with-2to3.html index a250ee6..b583773 100644 --- a/porting-code-to-python-3-with-2to3.html +++ b/porting-code-to-python-3-with-2to3.html @@ -12,8 +12,11 @@ window.onload = function() { var arTables = document.getElementsByTagName('table'); for (var i = arTables.length - 1; i >= 0; i--) { var elmTable = arTables[i]; - var arNotes = document.getElementById("skip" + elmTable.id).getElementsByTagName('li'); + var olNotes = document.getElementById("skip" + elmTable.id); + if (!olNotes) { continue; } + var arNotes = olNotes.getElementsByTagName('li'); var arTableRows = elmTable.getElementsByTagName('tr'); + if (arNotes.length != arTableRows.length - 1) { continue; } for (var j = arTableRows.length - 1; j >= 1; j--) { var elmTableRow = arTableRows[j]; var elmNote = arNotes[j - 1]; @@ -894,7 +897,7 @@ except:

imports

FIXME intro

-

this includes fixer_imports, fixer_imports2, fixer_urllib

+

@@ -903,13 +906,220 @@ except: - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Notes
FIXMEFIXME
import StringIO
+import cStringIO
import io
import cPickleimport pickle
import __builtin__import builtins
import copy_regimport copyreg
import Queueimport queue
import SocketServerimport socketserver
import ConfigParserimport configparser
import reprimport reprlib
import commandsimport subprocess
  1. ...
  2. +
  3. ...
  4. +
  5. ...
  6. +
  7. ...
  8. +
  9. ...
  10. +
  11. ...
  12. +
  13. ...
  14. +
  15. ...
  16. +
  17. ...
  18. +
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NotesPython 2Python 3
import dbmimport dbm.ndbm
import gdbmimport dbm.gnu
import dbhashimport dbm.bsd
import dumbdbmimport dbm.dumb
import anydbm
+import whichdb
import dbm
+ +
    +
  1. ...
  2. +
  3. ...
  4. +
  5. ...
  6. +
  7. ...
  8. +
  9. ...
  10. +
+ +

+ + + + + + + + + + + + + + + + +
NotesPython 2Python 3
import xmlrpclibimport xmlrpc.client
import DocXMLRPCServer
+import SimpleXMLRPCServer
import xmlrpc.server
+ +
    +
  1. ...
  2. +
  3. ...
  4. +
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NotesPython 2Python 3
import httplibimport http.client
import Cookieimport http.cookies
import cookielibimport http.cookiejar
import BaseHTTPServer
+import SimpleHTTPServer
+import CGIHttpServer
import http.server
+ +
    +
  1. ...
  2. +
  3. ...
  4. +
  5. ...
  6. +
  7. ...
  8. +
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NotesPython 2Python 3
import urllibimport urllib.request, urllib.parse, urllib.error
import urllib2import urllib.request, urllib.error
import urlparseimport urllib.parse
import robotparserimport urllib.robotparser
from urllib import FancyURLOpener
+from urllib import urlencode
from urllib.request import FancyURLOpener
+from urllib.parse import urlencode
from urllib2 import Request
+from urllib2 import HTTPError
from urllib.request import Request
+from urllib.error import HTTPError
+ +
    +
  1. ...
  2. +
  3. ...
  4. +
  5. ...
  6. +
  7. ...
  8. +
  9. ...
  10. +
  11. ...