Merged revisions 58203-58210 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r58204 | georg.brandl | 2007-09-19 08:37:19 +0200 (Wed, 19 Sep 2007) | 2 lines

  Fix #1169: remove docstrings in functions for -OO.
........
  r58206 | sean.reifschneider | 2007-09-19 09:52:56 +0200 (Wed, 19 Sep 2007) | 2 lines

  issue1177: Ported Facundo's from urllib2 to urllib, accepting 2xx responses.
........
  r58207 | facundo.batista | 2007-09-19 16:02:03 +0200 (Wed, 19 Sep 2007) | 3 lines


  Annotated the correction to urllib.py, issue #1177
........
  r58208 | facundo.batista | 2007-09-19 17:10:06 +0200 (Wed, 19 Sep 2007) | 7 lines


  Issue #1772851.  Alters long.__hash__ from being *almost* completely
  predictable to being completely predictable.  The value of hash(n)
  is unchanged for any n that's small enough to be representable as an
  int, and also unchanged for the vast majority of long integers n of
  reasonable size.
........
  r58209 | thomas.wouters | 2007-09-19 19:27:29 +0200 (Wed, 19 Sep 2007) | 4 lines


  Fix obvious typo in threaded test.
........
  r58210 | thomas.wouters | 2007-09-19 19:27:43 +0200 (Wed, 19 Sep 2007) | 4 lines


  Whitespace cleanup.
........
diff --git a/Lib/test/test_hash.py b/Lib/test/test_hash.py
index eff0c7c..a0364f2 100644
--- a/Lib/test/test_hash.py
+++ b/Lib/test/test_hash.py
@@ -18,10 +18,19 @@
 
     def test_numeric_literals(self):
         self.same_hash(1, 1, 1.0, 1.0+0.0j)
+        self.same_hash(0, 0.0, 0.0+0.0j)
+        self.same_hash(-1, -1.0, -1.0+0.0j)
+        self.same_hash(-2, -2.0, -2.0+0.0j)
 
     def test_coerced_integers(self):
         self.same_hash(int(1), int(1), float(1), complex(1),
                        int('1'), float('1.0'))
+        self.same_hash(int(-2**31), float(-2**31))
+        self.same_hash(int(1-2**31), float(1-2**31))
+        self.same_hash(int(2**31-1), float(2**31-1))
+        # for 64-bit platforms
+        self.same_hash(int(2**31), float(2**31))
+        self.same_hash(int(-2**63), float(-2**63))
 
     def test_coerced_floats(self):
         self.same_hash(int(1.23e300), float(1.23e300))
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 04fd50a..b2542fc 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -357,7 +357,9 @@
             raise IOError('http protocol error', 0,
                           'got a bad status line', None)
 
-        if response.status == 200:
+        # According to RFC 2616, "2xx" code indicates that the client's
+        # request was successfully received, understood, and accepted.
+        if not (200 <= response.status < 300):
             return addinfourl(response.fp, response.msg, "http:" + url)
         else:
             return self.http_error(