[Python-checkins] r69216 - in python/branches/py3k-issue1717: Doc/c-api/allocation.rst Doc/c-api/arg.rst Doc/c-api/bool.rst Doc/c-api/buffer.rst Doc/c-api/bytearray.rst Doc/c-api/bytes.rst Doc/c-api/cell.rst Doc/c-api/cobject.rst Doc/c-api/complex.rst Doc/c-api/conversion.rst Doc/c-api/datetime.rst Doc/c-api/descriptor.rst Doc/c-api/dict.rst Doc/c-api/file.rst Doc/c-api/float.rst Doc/c-api/function.rst Doc/c-api/gcsupport.rst Doc/c-api/gen.rst Doc/c-api/import.rst Doc/c-api/iter.rst Doc/c-api/iterator.rst Doc/c-api/list.rst Doc/c-api/long.rst Doc/c-api/mapping.rst Doc/c-api/marshal.rst Doc/c-api/method.rst Doc/c-api/module.rst Doc/c-api/none.rst Doc/c-api/number.rst Doc/c-api/objbuffer.rst Doc/c-api/object.rst Doc/c-api/objimpl.rst Doc/c-api/reflection.rst Doc/c-api/sequence.rst Doc/c-api/set.rst Doc/c-api/slice.rst Doc/c-api/structures.rst Doc/c-api/sys.rst Doc/c-api/tuple.rst Doc/c-api/type.rst Doc/c-api/typeobj.rst Doc/c-api/unicode.rst Doc/c-api/weakref.rst Doc/library/ast.rst Doc/library/copyreg.rst Doc/library/fractions.rst Doc/library/html.entities.rst Doc/library/importlib.rst Doc/library/io.rst Doc/library/json.rst Doc/library/multiprocessing.rst Doc/library/plistlib.rst Doc/library/reprlib.rst Doc/reference/grammar.rst Doc/whatsnew/2.7.rst Include/code.h Lib/http/client.py Lib/importlib/NOTES Lib/importlib/_bootstrap.py Lib/tkinter/test/support.py Lib/tkinter/test/test_ttk/test_extensions.py Lib/tkinter/test/test_ttk/test_style.py Lib/tkinter/test/test_ttk/test_widgets.py Lib/xmlrpc/client.py Misc/NEWS Modules/_multiprocessing/connection.h Modules/_multiprocessing/semaphore.c Modules/_testcapimodule.c Modules/_threadmodule.c Modules/itertoolsmodule.c Objects/typeobject.c Objects/unicodeobject.c PC/getpathp.c Parser/asdl_c.py Python/Python-ast.c

mark.dickinson python-checkins at python.org
Mon Feb 2 21:58:54 CET 2009


Author: mark.dickinson
Date: Mon Feb  2 21:58:52 2009
New Revision: 69216

Log:
Merged revisions 69188,69190,69192,69197-69198,69202,69207,69209-69210,69213-69214 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r69188 | mark.dickinson | 2009-02-01 13:59:22 +0000 (Sun, 01 Feb 2009) | 6 lines
  
  Issue #1717, continued:  remove PyObject_Compare and Py_CmpToRich declarations
  from object.h; don't inherit tp_compare slot on subclasses; and raise TypeError
  when initializing a type that has a nonzero tp_compare slot.  Fix up
  comparison-related comments in object.c and code.h.
................
  r69190 | mark.dickinson | 2009-02-01 14:18:10 +0000 (Sun, 01 Feb 2009) | 2 lines
  
  Issue #1717: documentation fixes related to the cmp removal.
................
  r69192 | mark.dickinson | 2009-02-01 20:36:08 +0000 (Sun, 01 Feb 2009) | 2 lines
  
  Remove exception for non-NULL tp_compare that was introduced in r69188.
................
  r69197 | guilherme.polo | 2009-02-02 01:02:20 +0000 (Mon, 02 Feb 2009) | 10 lines
  
  Recorded merge of revisions 69195 via svnmerge from 
  svn+ssh://pythondev/python/trunk
  
  ........
    r69195 | guilherme.polo | 2009-02-01 22:38:54 -0200 (Sun, 01 Feb 2009) | 3 lines
    
    Use a single Tcl interpreter through all these tests, this may help some 
    failing buildbots.
  ........
................
  r69198 | brett.cannon | 2009-02-02 05:58:30 +0000 (Mon, 02 Feb 2009) | 3 lines
  
  Note to move __package__ stuff over to rpartition to make Nick happy. Also make
  sure that accepting the empty string for top-level modules is okay.
................
  r69202 | hirokazu.yamamoto | 2009-02-02 09:15:41 +0000 (Mon, 02 Feb 2009) | 9 lines
  
  Merged revisions 69200 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r69200 | hirokazu.yamamoto | 2009-02-02 17:01:17 +0900 | 1 line
    
    Set native svn:eol-style property for text files.
  ........
................
  r69207 | martin.v.loewis | 2009-02-02 15:32:22 +0000 (Mon, 02 Feb 2009) | 9 lines
  
  Merged revisions 69205 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r69205 | martin.v.loewis | 2009-02-02 15:23:16 +0100 (Mo, 02 Feb 2009) | 1 line
    
    Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows.
  ........
................
  r69209 | kristjan.jonsson | 2009-02-02 16:04:04 +0000 (Mon, 02 Feb 2009) | 4 lines
  
  merging / reimplementing r68532 from the trunk to Py3k
  
  Enable buffering for HTTPResponse's fp.  read() behaves identically for buffered and non-buffered IO.  read(n) also won't block if n bytes are availble on the socket.  There is therefore no reason not to use buffering.  The reason 2.x disables buffering by default, that some clients may be accessing the underlying socket directly and so bypass the buffering buffer, doesn't apply in 3.x with its redesigned IO library.
  See issue 4448 and issue 4879
................
  r69210 | brett.cannon | 2009-02-02 19:19:36 +0000 (Mon, 02 Feb 2009) | 5 lines
  
  To prevent another screw-up on my part where my prototype gets lost thanks to
  an ``svn revert`` (gee, maybe more atomic commits by use of something like a
  DVCS would help with this? Wish someone would get on that ...), I am checking
  in an untested, work-in-progress meta path finder to handle sys.path.
................
  r69213 | brett.cannon | 2009-02-02 20:32:29 +0000 (Mon, 02 Feb 2009) | 1 line
  
  Add some notes for importlib to package up what is in Python 2.7 as well as modules that can probably get replaced by importlib at some point.
................
  r69214 | mark.dickinson | 2009-02-02 20:36:42 +0000 (Mon, 02 Feb 2009) | 4 lines
  
  Issue #1717: rename tp_compare to tp_reserved.  I'll change the
  type of tp_compare in a separate commit, for ease of reversion
  should things go wrong.
................


Modified:
   python/branches/py3k-issue1717/   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/allocation.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/arg.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/bool.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/buffer.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/bytearray.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/bytes.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/cell.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/cobject.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/complex.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/conversion.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/datetime.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/descriptor.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/dict.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/file.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/float.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/function.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/gcsupport.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/gen.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/import.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/iter.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/iterator.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/list.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/long.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/mapping.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/marshal.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/method.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/module.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/none.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/number.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/objbuffer.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/object.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/objimpl.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/reflection.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/sequence.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/set.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/slice.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/structures.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/sys.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/tuple.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/type.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/typeobj.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/unicode.rst   (props changed)
   python/branches/py3k-issue1717/Doc/c-api/weakref.rst   (props changed)
   python/branches/py3k-issue1717/Doc/library/ast.rst   (props changed)
   python/branches/py3k-issue1717/Doc/library/copyreg.rst   (props changed)
   python/branches/py3k-issue1717/Doc/library/fractions.rst   (props changed)
   python/branches/py3k-issue1717/Doc/library/html.entities.rst   (props changed)
   python/branches/py3k-issue1717/Doc/library/importlib.rst   (props changed)
   python/branches/py3k-issue1717/Doc/library/io.rst   (props changed)
   python/branches/py3k-issue1717/Doc/library/json.rst   (props changed)
   python/branches/py3k-issue1717/Doc/library/multiprocessing.rst   (props changed)
   python/branches/py3k-issue1717/Doc/library/plistlib.rst   (props changed)
   python/branches/py3k-issue1717/Doc/library/reprlib.rst   (props changed)
   python/branches/py3k-issue1717/Doc/reference/grammar.rst   (props changed)
   python/branches/py3k-issue1717/Doc/whatsnew/2.7.rst   (props changed)
   python/branches/py3k-issue1717/Include/code.h
   python/branches/py3k-issue1717/Lib/http/client.py
   python/branches/py3k-issue1717/Lib/importlib/NOTES
   python/branches/py3k-issue1717/Lib/importlib/_bootstrap.py
   python/branches/py3k-issue1717/Lib/tkinter/test/support.py
   python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_extensions.py
   python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_style.py
   python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_widgets.py
   python/branches/py3k-issue1717/Lib/xmlrpc/client.py
   python/branches/py3k-issue1717/Misc/NEWS
   python/branches/py3k-issue1717/Modules/_multiprocessing/connection.h
   python/branches/py3k-issue1717/Modules/_multiprocessing/semaphore.c
   python/branches/py3k-issue1717/Modules/_testcapimodule.c
   python/branches/py3k-issue1717/Modules/_threadmodule.c
   python/branches/py3k-issue1717/Modules/itertoolsmodule.c
   python/branches/py3k-issue1717/Objects/typeobject.c
   python/branches/py3k-issue1717/Objects/unicodeobject.c
   python/branches/py3k-issue1717/PC/getpathp.c
   python/branches/py3k-issue1717/Parser/asdl_c.py
   python/branches/py3k-issue1717/Python/Python-ast.c

Modified: python/branches/py3k-issue1717/Include/code.h
==============================================================================
--- python/branches/py3k-issue1717/Include/code.h	(original)
+++ python/branches/py3k-issue1717/Include/code.h	Mon Feb  2 21:58:52 2009
@@ -20,7 +20,7 @@
     PyObject *co_varnames;	/* tuple of strings (local variable names) */
     PyObject *co_freevars;	/* tuple of strings (free variable names) */
     PyObject *co_cellvars;      /* tuple of strings (cell variable names) */
-    /* The rest doesn't count for hash */
+    /* The rest doesn't count for hash or comparisons */
     PyObject *co_filename;	/* unicode (where it was loaded from) */
     PyObject *co_name;		/* unicode (name, for reference) */
     int co_firstlineno;		/* first source line number */

Modified: python/branches/py3k-issue1717/Lib/http/client.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/http/client.py	(original)
+++ python/branches/py3k-issue1717/Lib/http/client.py	Mon Feb  2 21:58:52 2009
@@ -265,14 +265,14 @@
     # accepts iso-8859-1.
 
     def __init__(self, sock, debuglevel=0, strict=0, method=None):
-        # XXX If the response includes a content-length header, we
+        # If the response includes a content-length header, we
         # need to make sure that the client doesn't read more than the
         # specified number of bytes.  If it does, it will block until
         # the server times out and closes the connection.  (The only
-        # applies to HTTP/1.1 connections.)  Since some clients access
-        # self.fp directly rather than calling read(), this is a little
-        # tricky.
-        self.fp = sock.makefile("rb", 0)
+        # applies to HTTP/1.1 connections.)  This will happen if a self.fp.read()
+        # is done (without a size) whether self.fp is buffered or not.
+        # So, no self.fp.read() by clients unless they know what they are doing.
+        self.fp = sock.makefile("rb")
         self.debuglevel = debuglevel
         self.strict = strict
         self._method = method

Modified: python/branches/py3k-issue1717/Lib/importlib/NOTES
==============================================================================
--- python/branches/py3k-issue1717/Lib/importlib/NOTES	(original)
+++ python/branches/py3k-issue1717/Lib/importlib/NOTES	Mon Feb  2 21:58:52 2009
@@ -1,6 +1,12 @@
 to do
 /////
 
+* Create sandbox directory for a distutils packaging of what is in Python 2.7.
+
+* Use rpartition for getting the package of a module.
+
+    + Make sure that an empty string is acceptable for __package__.
+
 * Create meta_path importer for sys.path.
 
     + Create hook.
@@ -73,3 +79,9 @@
     - Relative name from sys.path.
 
 * Bootstrap importlib as implementation of builtins.__import__
+
+* Replace standard library modules.
+
+  + imp
+  + py_compile
+  + compileall

Modified: python/branches/py3k-issue1717/Lib/importlib/_bootstrap.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/importlib/_bootstrap.py	(original)
+++ python/branches/py3k-issue1717/Lib/importlib/_bootstrap.py	Mon Feb  2 21:58:52 2009
@@ -589,6 +589,82 @@
         super(PyFileImporter, self).__init__(path_entry)
 
 
+class SysPathFinder:
+
+    """Meta path finder for sys.(path|path_hooks|path_importer_cache)."""
+
+    def _default_hook(self, path):
+        """Use the default hook on 'path'.
+
+        If the path will not work for the default hook then raise ImportError.
+
+        """
+        # TODO(brett.cannon) Implement
+        raise ImportError
+
+    # The list of implicit hooks cannot be a class attribute because of
+    # bootstrapping issues for accessing imp.
+    def _implicit_hooks(self, path):
+        """Return a list of the implicit path hooks."""
+        return [self._default_hook, imp.NullImporter]
+
+    def _path_hooks(self, path):
+        """Search sys.path_hooks for a finder for 'path'.
+
+        Guaranteed to return a finder for the path as NullImporter is the
+        default importer for any path that does not have an explicit finder.
+
+        """
+        for hook in sys.path_hooks + self._implicit_hooks():
+            try:
+                return hook(path)
+            except ImportError:
+                continue
+        else:
+            # This point should never be reached thanks to NullImporter.
+            raise SystemError("no hook could find an importer for "
+                              "{0}".format(path))
+
+    def _path_importer_cache(self, path):
+        """Get the finder for the path from sys.path_importer_cache.
+
+        If the path is not in the cache, find the appropriate finder and cache
+        it. If None is cached, get the default finder and cache that
+        (if applicable).
+
+        Because of NullImporter, some finder should be returned. The only
+        explicit fail case is if None is cached but the path cannot be used for
+        the default hook, for which ImportError is raised.
+
+        """
+        try:
+            finder = sys.path_importer_cache(path);
+        except KeyError:
+            finder = self._path_hooks(path)
+            sys.path_importer_cache[path] = finder
+        else:
+            if finder is None:
+                # Raises ImportError on failure.
+                finder = self._default_hook(path)
+                sys.path_importer_cache[path] = finder
+        return finder
+
+    def find_module(self, fullname, path=None):
+        """Find the module on sys.path or 'path'."""
+        if not path:
+            path = sys.path
+        for entry in path:
+            try:
+                finder = self._path_importer_cache(entry)
+            except ImportError:
+                continue
+            loader = finder.find_module(fullname)
+            if loader:
+                return loader
+        else:
+            return None
+
+
 class ImportLockContext(object):
 
     """Context manager for the import lock."""

Modified: python/branches/py3k-issue1717/Lib/tkinter/test/support.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/tkinter/test/support.py	(original)
+++ python/branches/py3k-issue1717/Lib/tkinter/test/support.py	Mon Feb  2 21:58:52 2009
@@ -15,6 +15,14 @@
 
     return root
 
+def root_deiconify():
+    root = get_tk_root()
+    root.deiconify()
+
+def root_withdraw():
+    root = get_tk_root()
+    root.withdraw()
+
 
 def simulate_mouse_click(widget, x, y):
     """Generate proper events to click at the x, y position (tries to act

Modified: python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_extensions.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_extensions.py	(original)
+++ python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_extensions.py	Mon Feb  2 21:58:52 2009
@@ -10,6 +10,13 @@
 
 class LabeledScaleTest(unittest.TestCase):
 
+    def setUp(self):
+        support.root_deiconify()
+
+    def tearDown(self):
+        support.root_withdraw()
+
+
     def test_widget_destroy(self):
         # automatically created variable
         x = ttk.LabeledScale()
@@ -175,12 +182,12 @@
 class OptionMenuTest(unittest.TestCase):
 
     def setUp(self):
-        self.root = support.get_tk_root()
-        self.textvar = tkinter.StringVar(self.root)
+        support.root_deiconify()
+        self.textvar = tkinter.StringVar()
 
     def tearDown(self):
         del self.textvar
-        self.root.destroy()
+        support.root_withdraw()
 
 
     def test_widget_destroy(self):

Modified: python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_style.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_style.py	(original)
+++ python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_style.py	Mon Feb  2 21:58:52 2009
@@ -10,15 +10,7 @@
 class StyleTest(unittest.TestCase):
 
     def setUp(self):
-        self.root = support.get_tk_root()
-        self.style = ttk.Style(self.root)
-
-    def tearDown(self):
-        # As tests have shown, these tests are likely to deliver
-        # <<ThemeChanged>> events after the root is destroyed, so
-        # lets let them happen now.
-        self.root.update_idletasks()
-        self.root.destroy()
+        self.style = ttk.Style()
 
 
     def test_configure(self):

Modified: python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_widgets.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_widgets.py	(original)
+++ python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_widgets.py	Mon Feb  2 21:58:52 2009
@@ -12,12 +12,14 @@
     """Tests methods available in every ttk widget."""
 
     def setUp(self):
+        support.root_deiconify()
         self.widget = ttk.Button()
         self.widget.pack()
         self.widget.wait_visibility()
 
     def tearDown(self):
         self.widget.destroy()
+        support.root_withdraw()
 
 
     def test_identify(self):
@@ -107,10 +109,12 @@
 class ComboboxTest(unittest.TestCase):
 
     def setUp(self):
+        support.root_deiconify()
         self.combo = ttk.Combobox()
 
     def tearDown(self):
         self.combo.destroy()
+        support.root_withdraw()
 
     def _show_drop_down_listbox(self):
         width = self.combo.winfo_width()
@@ -195,10 +199,12 @@
 class EntryTest(unittest.TestCase):
 
     def setUp(self):
+        support.root_deiconify()
         self.entry = ttk.Entry()
 
     def tearDown(self):
         self.entry.destroy()
+        support.root_withdraw()
 
 
     def test_bbox(self):
@@ -297,10 +303,12 @@
 class PanedwindowTest(unittest.TestCase):
 
     def setUp(self):
+        support.root_deiconify()
         self.paned = ttk.Panedwindow()
 
     def tearDown(self):
         self.paned.destroy()
+        support.root_withdraw()
 
 
     def test_add(self):
@@ -445,12 +453,14 @@
 class ScaleTest(unittest.TestCase):
 
     def setUp(self):
+        support.root_deiconify()
         self.scale = ttk.Scale()
         self.scale.pack()
         self.scale.update()
 
     def tearDown(self):
         self.scale.destroy()
+        support.root_withdraw()
 
 
     def test_custom_event(self):
@@ -519,6 +529,7 @@
 class NotebookTest(unittest.TestCase):
 
     def setUp(self):
+        support.root_deiconify()
         self.nb = ttk.Notebook()
         self.child1 = ttk.Label()
         self.child2 = ttk.Label()
@@ -529,6 +540,7 @@
         self.child1.destroy()
         self.child2.destroy()
         self.nb.destroy()
+        support.root_withdraw()
 
 
     def test_tab_identifiers(self):
@@ -708,13 +720,12 @@
 class TreeviewTest(unittest.TestCase):
 
     def setUp(self):
-        self.root = support.get_tk_root()
-        self.tv = ttk.Treeview(self.root)
+        support.root_deiconify()
+        self.tv = ttk.Treeview()
 
     def tearDown(self):
         self.tv.destroy()
-        self.root.update_idletasks()
-        self.root.destroy()
+        support.root_withdraw()
 
 
     def test_bbox(self):

Modified: python/branches/py3k-issue1717/Lib/xmlrpc/client.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/xmlrpc/client.py	(original)
+++ python/branches/py3k-issue1717/Lib/xmlrpc/client.py	Mon Feb  2 21:58:52 2009
@@ -1129,7 +1129,7 @@
 
         self.verbose = verbose
 
-        return self._parse_response(resp, None)
+        return self.parse_response(resp)
 
     ##
     # Create parser.
@@ -1212,29 +1212,12 @@
     # @return Response tuple and target method.
 
     def parse_response(self, file):
-        # compatibility interface
-        return self._parse_response(file, None)
-
-    ##
-    # Parse response (alternate interface).  This is similar to the
-    # parse_response method, but also provides direct access to the
-    # underlying socket object (where available).
-    #
-    # @param file Stream.
-    # @param sock Socket handle (or None, if the socket object
-    #    could not be accessed).
-    # @return Response tuple and target method.
-
-    def _parse_response(self, file, sock):
         # read response from input file/socket, and parse it
 
         p, u = self.getparser()
 
         while 1:
-            if sock:
-                response = sock.recv(1024)
-            else:
-                response = file.read(1024)
+            response = file.read(1024)
             if not response:
                 break
             if self.verbose:

Modified: python/branches/py3k-issue1717/Misc/NEWS
==============================================================================
--- python/branches/py3k-issue1717/Misc/NEWS	(original)
+++ python/branches/py3k-issue1717/Misc/NEWS	Mon Feb  2 21:58:52 2009
@@ -14,8 +14,8 @@
 
 - Issue #1717: Removed builtin cmp() function, dropped tp_compare
   slot, the C API functions PyObject_Compare and PyUnicode_Compare and
-  the type definition cmpfunc.  The tp_compare slot is reserved for
-  future usage.
+  the type definition cmpfunc.  The tp_compare slot has been renamed
+  to tp_reserved, and is reserved for future usage.
 
 - Issue #4707: round(x, n) now returns an integer if x is an integer.
   Previously it returned a float.
@@ -374,6 +374,8 @@
 Build
 -----
 
+- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows.
+
 - Issue #4895: Use _strdup on Windows CE.
 
 - Issue #4472: "configure --enable-shared" now works on OSX

Modified: python/branches/py3k-issue1717/Modules/_multiprocessing/connection.h
==============================================================================
--- python/branches/py3k-issue1717/Modules/_multiprocessing/connection.h	(original)
+++ python/branches/py3k-issue1717/Modules/_multiprocessing/connection.h	Mon Feb  2 21:58:52 2009
@@ -487,7 +487,7 @@
 	/* tp_print          */ 0,
 	/* tp_getattr        */ 0,
 	/* tp_setattr        */ 0,
-	/* tp_reserved        */ 0,
+	/* tp_reserved       */ 0,
 	/* tp_repr           */ (reprfunc)connection_repr,
 	/* tp_as_number      */ 0,
 	/* tp_as_sequence    */ 0,

Modified: python/branches/py3k-issue1717/Modules/_multiprocessing/semaphore.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_multiprocessing/semaphore.c	(original)
+++ python/branches/py3k-issue1717/Modules/_multiprocessing/semaphore.c	Mon Feb  2 21:58:52 2009
@@ -592,7 +592,7 @@
 	/* tp_print          */ 0,
 	/* tp_getattr        */ 0,
 	/* tp_setattr        */ 0,
-	/* tp_reserved        */ 0,
+	/* tp_reserved       */ 0,
 	/* tp_repr           */ 0,
 	/* tp_as_number      */ 0,
 	/* tp_as_sequence    */ 0,

Modified: python/branches/py3k-issue1717/Modules/_testcapimodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_testcapimodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/_testcapimodule.c	Mon Feb  2 21:58:52 2009
@@ -187,7 +187,7 @@
 	0,			/* tp_print */
 	0,			/* tp_getattr */
 	0,			/* tp_setattr */
-	0,			/* tp_compare */
+	0,			/* tp_reserved */
 	0,			/* tp_repr */
 	0,			/* tp_as_number */
 	0,			/* tp_as_sequence */

Modified: python/branches/py3k-issue1717/Modules/_threadmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_threadmodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/_threadmodule.c	Mon Feb  2 21:58:52 2009
@@ -358,7 +358,7 @@
 	/* tp_print          */ 0,
 	/* tp_getattr        */ 0,
 	/* tp_setattr        */ 0,
-	/* tp_reserved        */ 0,
+	/* tp_reserved       */ 0,
 	/* tp_repr           */ 0,
 	/* tp_as_number      */ 0,
 	/* tp_as_sequence    */ 0,

Modified: python/branches/py3k-issue1717/Modules/itertoolsmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/itertoolsmodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/itertoolsmodule.c	Mon Feb  2 21:58:52 2009
@@ -2273,7 +2273,7 @@
 	0,						/* tp_print */
 	0,						/* tp_getattr */
 	0,						/* tp_setattr */
-	0,						/* tp_compare */
+	0,						/* tp_reserved */
 	0,						/* tp_repr */
 	0,						/* tp_as_number */
 	0,						/* tp_as_sequence */
@@ -2700,7 +2700,7 @@
 	0,								/* tp_print */
 	0,								/* tp_getattr */
 	0,								/* tp_setattr */
-	0,								/* tp_compare */
+	0,								/* tp_reserved */
 	0,								/* tp_repr */
 	0,								/* tp_as_number */
 	0,								/* tp_as_sequence */

Modified: python/branches/py3k-issue1717/Objects/typeobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/typeobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/typeobject.c	Mon Feb  2 21:58:52 2009
@@ -3662,7 +3662,7 @@
 		type->tp_setattr = base->tp_setattr;
 		type->tp_setattro = base->tp_setattro;
 	}
-	/* tp_reserved is ignored, see tp_richcompare */
+	/* tp_reserved is ignored */
 	COPYSLOT(tp_repr);
 	/* tp_hash see tp_richcompare */
 	COPYSLOT(tp_call);

Modified: python/branches/py3k-issue1717/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/unicodeobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/unicodeobject.c	Mon Feb  2 21:58:52 2009
@@ -4566,7 +4566,7 @@
     0,                      /*tp_print*/
     0,                      /*tp_getattr*/
     0,                      /*tp_setattr*/
-    0,                      /*tp_compare*/
+    0,                      /*tp_reserved*/
     0,                      /*tp_repr*/
     0,                      /*tp_as_number*/
     0,                      /*tp_as_sequence*/
@@ -9493,7 +9493,7 @@
     0,                  /* tp_print */
     0,                  /* tp_getattr */
     0,                  /* tp_setattr */
-    0,                  /* tp_compare */
+    0,                  /* tp_reserved */
     unicode_repr,           /* tp_repr */
     &unicode_as_number,         /* tp_as_number */
     &unicode_as_sequence,       /* tp_as_sequence */
@@ -9799,7 +9799,7 @@
     0,                  /* tp_print */
     0,                  /* tp_getattr */
     0,                  /* tp_setattr */
-    0,                  /* tp_compare */
+    0,                  /* tp_reserved */
     0,                  /* tp_repr */
     0,                  /* tp_as_number */
     0,                  /* tp_as_sequence */

Modified: python/branches/py3k-issue1717/PC/getpathp.c
==============================================================================
--- python/branches/py3k-issue1717/PC/getpathp.c	(original)
+++ python/branches/py3k-issue1717/PC/getpathp.c	Mon Feb  2 21:58:52 2009
@@ -200,6 +200,7 @@
 }
 
 #ifdef MS_WINDOWS
+#ifdef Py_ENABLE_SHARED
 
 /* a string loaded from the DLL at startup.*/
 extern const char *PyWin_DLLVersionString;
@@ -349,6 +350,7 @@
 		free(keyBuf);
 	return retval;
 }
+#endif /* Py_ENABLE_SHARED */
 #endif /* MS_WINDOWS */
 
 static void
@@ -359,11 +361,15 @@
 	wchar_t *prog = Py_GetProgramName();
 
 #ifdef MS_WINDOWS
+#ifdef Py_ENABLE_SHARED
 	extern HANDLE PyWin_DLLhModule;
 	/* static init of progpath ensures final char remains \0 */
 	if (PyWin_DLLhModule)
 		if (!GetModuleFileNameW(PyWin_DLLhModule, dllpath, MAXPATHLEN))
 			dllpath[0] = 0;
+#else
+	dllpath[0] = 0;
+#endif
 	if (GetModuleFileNameW(NULL, progpath, MAXPATHLEN))
 		return;
 #endif
@@ -471,8 +477,10 @@
 	}
  
 	skiphome = pythonhome==NULL ? 0 : 1;
+#ifdef Py_ENABLE_SHARED
 	machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome);
 	userpath = getpythonregpath(HKEY_CURRENT_USER, skiphome);
+#endif
 	/* We only use the default relative PYTHONPATH if we havent
 	   anything better to use! */
 	skipdefault = envpath!=NULL || pythonhome!=NULL || \

Modified: python/branches/py3k-issue1717/Parser/asdl_c.py
==============================================================================
--- python/branches/py3k-issue1717/Parser/asdl_c.py	(original)
+++ python/branches/py3k-issue1717/Parser/asdl_c.py	Mon Feb  2 21:58:52 2009
@@ -662,7 +662,7 @@
     0,                       /* tp_print */
     0,                       /* tp_getattr */
     0,                       /* tp_setattr */
-    0,                       /* tp_compare */
+    0,                       /* tp_reserved */
     0,                       /* tp_repr */
     0,                       /* tp_as_number */
     0,                       /* tp_as_sequence */

Modified: python/branches/py3k-issue1717/Python/Python-ast.c
==============================================================================
--- python/branches/py3k-issue1717/Python/Python-ast.c	(original)
+++ python/branches/py3k-issue1717/Python/Python-ast.c	Mon Feb  2 21:58:52 2009
@@ -479,7 +479,7 @@
     0,                       /* tp_print */
     0,                       /* tp_getattr */
     0,                       /* tp_setattr */
-    0,                       /* tp_compare */
+    0,                       /* tp_reserved */
     0,                       /* tp_repr */
     0,                       /* tp_as_number */
     0,                       /* tp_as_sequence */


More information about the Python-checkins mailing list