Merged revisions 73206,73232,73299,73683,74020,74185,74544,74643,74647,74817,74838-74839,74865,74946,75402,75459,75604,75696 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r73206 | georg.brandl | 2009-06-04 11:15:12 +0200 (Do, 04 Jun 2009) | 1 line
#3584: ignore trailing newlines when placing the caret for a SyntaxError location.
........
r73232 | georg.brandl | 2009-06-04 20:59:58 +0200 (Do, 04 Jun 2009) | 1 line
Add test for #3684.
........
r73299 | georg.brandl | 2009-06-08 20:41:36 +0200 (Mo, 08 Jun 2009) | 1 line
Typo fix.
........
r73683 | georg.brandl | 2009-06-29 16:44:49 +0200 (Mo, 29 Jun 2009) | 1 line
Fix error handling in PyCode_Optimize, by Alexander Schremmer at EuroPython sprint.
........
r74020 | georg.brandl | 2009-07-16 09:18:07 +0200 (Do, 16 Jul 2009) | 1 line
#5910: fix kqueue for calls with more than one event.
........
r74185 | georg.brandl | 2009-07-23 11:17:09 +0200 (Do, 23 Jul 2009) | 1 line
Fix the "pylocals" gdb command.
........
r74544 | georg.brandl | 2009-08-24 19:12:30 +0200 (Mo, 24 Aug 2009) | 1 line
#6775: fix python.org URLs in README.
........
r74643 | georg.brandl | 2009-09-04 08:59:20 +0200 (Fr, 04 Sep 2009) | 2 lines
Issue #2666: Handle BROWSER environment variable properly for unknown browser names in the webbrowser module.
........
r74647 | georg.brandl | 2009-09-04 10:17:04 +0200 (Fr, 04 Sep 2009) | 2 lines
Issue #5275: In Cookie's Cookie.load(), properly handle non-string arguments as documented.
........
r74817 | georg.brandl | 2009-09-16 11:05:11 +0200 (Mi, 16 Sep 2009) | 1 line
Make deprecation notices as visible as warnings are right now.
........
r74838 | georg.brandl | 2009-09-16 18:22:12 +0200 (Mi, 16 Sep 2009) | 1 line
Remove some more boilerplate from the actual tests in test_pdb.
........
r74839 | georg.brandl | 2009-09-16 18:36:39 +0200 (Mi, 16 Sep 2009) | 1 line
Make the pdb displayhook compatible with the standard displayhook: do not print Nones. Add a test for that.
........
r74865 | georg.brandl | 2009-09-17 09:49:37 +0200 (Do, 17 Sep 2009) | 1 line
#6912: add "with" block support to pindent.
........
r74946 | georg.brandl | 2009-09-19 10:43:16 +0200 (Sa, 19 Sep 2009) | 1 line
Update bug tracker reference.
........
r75402 | georg.brandl | 2009-10-14 17:51:48 +0200 (Mi, 14 Okt 2009) | 1 line
#7125: fix typo.
........
r75459 | georg.brandl | 2009-10-17 10:57:43 +0200 (Sa, 17 Okt 2009) | 1 line
Fix refleaks in _ctypes PyCSimpleType_New, which fixes the refleak seen in test___all__.
........
r75604 | georg.brandl | 2009-10-22 13:36:50 +0200 (Do, 22 Okt 2009) | 1 line
Fix stylesheet for multi-paragraph impl-details.
........
r75696 | georg.brandl | 2009-10-25 21:25:43 +0100 (So, 25 Okt 2009) | 1 line
Fix a demo.
........
diff --git a/Lib/Cookie.py b/Lib/Cookie.py
index b2f7427..99a94da 100644
--- a/Lib/Cookie.py
+++ b/Lib/Cookie.py
@@ -624,7 +624,9 @@
if type(rawdata) == type(""):
self.__ParseString(rawdata)
else:
- self.update(rawdata)
+ # self.update() wouldn't call our custom __setitem__
+ for k, v in rawdata.items():
+ self[k] = v
return
# end load()
diff --git a/Lib/multiprocessing/queues.py b/Lib/multiprocessing/queues.py
index 0294678..ea27991 100644
--- a/Lib/multiprocessing/queues.py
+++ b/Lib/multiprocessing/queues.py
@@ -109,7 +109,7 @@
self._rlock.release()
def qsize(self):
- # Raises NotImplementError on Mac OSX because of broken sem_getvalue()
+ # Raises NotImplementedError on Mac OSX because of broken sem_getvalue()
return self._maxsize - self._sem._semlock._get_value()
def empty(self):
diff --git a/Lib/pdb.py b/Lib/pdb.py
index e9f5632..3e5e898 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -198,7 +198,9 @@
"""Custom displayhook for the exec in default(), which prevents
assignment of the _ variable in the builtins.
"""
- print repr(obj)
+ # reproduce the behavior of the standard displayhook, not printing None
+ if obj is not None:
+ print repr(obj)
def default(self, line):
if line[:1] == '!': line = line[1:]
diff --git a/Lib/platform.py b/Lib/platform.py
index ee18749..90ad93d 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -10,7 +10,7 @@
"""
# This module is maintained by Marc-Andre Lemburg <mal@egenix.com>.
# If you find problems, please submit bug reports/patches via the
-# Python SourceForge Project Page and assign them to "lemburg".
+# Python bug tracker (http://bugs.python.org) and assign them to "lemburg".
#
# Note: Please keep this module compatible to Python 1.5.2.
#
diff --git a/Lib/test/test_kqueue.py b/Lib/test/test_kqueue.py
index 05c1013..b887dc0 100644
--- a/Lib/test/test_kqueue.py
+++ b/Lib/test/test_kqueue.py
@@ -162,6 +162,22 @@
server.close()
serverSocket.close()
+ def testPair(self):
+ kq = select.kqueue()
+ a, b = socket.socketpair()
+
+ a.send(b'foo')
+ event1 = select.kevent(a, select.KQ_FILTER_READ, select.KQ_EV_ADD | select.KQ_EV_ENABLE)
+ event2 = select.kevent(b, select.KQ_FILTER_READ, select.KQ_EV_ADD | select.KQ_EV_ENABLE)
+ r = kq.control([event1, event2], 1, 1)
+ self.assertTrue(r)
+ self.assertFalse(r[0].flags & select.KQ_EV_ERROR)
+ self.assertEquals(b.recv(r[0].data), b'foo')
+
+ a.close()
+ b.close()
+ kq.close()
+
def test_main():
test_support.run_unittest(TestKQueue)
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py
index 0708f81..1c067d7 100644
--- a/Lib/test/test_traceback.py
+++ b/Lib/test/test_traceback.py
@@ -34,6 +34,9 @@
def syntax_error_with_caret(self):
compile("def fact(x):\n\treturn x!\n", "?", "exec")
+ def syntax_error_with_caret_2(self):
+ compile("1 +\n", "?", "exec")
+
def syntax_error_without_caret(self):
# XXX why doesn't compile raise the same traceback?
import test.badsyntax_nocaret
@@ -49,6 +52,12 @@
self.assert_("^" in err[2]) # third line has caret
self.assert_(err[1].find("!") == err[2].find("^")) # in the right place
+ err = self.get_exception_format(self.syntax_error_with_caret_2,
+ SyntaxError)
+ self.assert_("^" in err[2]) # third line has caret
+ self.assert_(err[2].count('\n') == 1) # and no additional newline
+ self.assert_(err[1].find("+") == err[2].find("^")) # in the right place
+
def test_nocaret(self):
if is_jython:
# jython adds a caret in this case (why shouldn't it?)
diff --git a/Lib/threading.py b/Lib/threading.py
index c1791d7..1182f19 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -133,7 +133,7 @@
def release(self):
if self.__owner is not current_thread():
- raise RuntimeError("cannot release un-aquired lock")
+ raise RuntimeError("cannot release un-acquired lock")
self.__count = count = self.__count - 1
if not count:
self.__owner = None
@@ -227,7 +227,7 @@
def wait(self, timeout=None):
if not self._is_owned():
- raise RuntimeError("cannot wait on un-aquired lock")
+ raise RuntimeError("cannot wait on un-acquired lock")
waiter = _allocate_lock()
waiter.acquire()
self.__waiters.append(waiter)
@@ -269,7 +269,7 @@
def notify(self, n=1):
if not self._is_owned():
- raise RuntimeError("cannot notify on un-aquired lock")
+ raise RuntimeError("cannot notify on un-acquired lock")
__waiters = self.__waiters
waiters = __waiters[:n]
if not waiters:
diff --git a/Lib/traceback.py b/Lib/traceback.py
index 3d877ee..ed0f256 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -190,7 +190,7 @@
if badline is not None:
lines.append(' %s\n' % badline.strip())
if offset is not None:
- caretspace = badline[:offset].lstrip()
+ caretspace = badline.rstrip('\n')[:offset].lstrip()
# non-space whitespace (likes tabs) must be kept for alignment
caretspace = ((c.isspace() and c or ' ') for c in caretspace)
# only three spaces to account for offset1 == pos 0
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 6cf8942..5cc0653 100644
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -625,7 +625,9 @@
# and prepend to _tryorder
for cmdline in _userchoices:
if cmdline != '':
- _synthesize(cmdline, -1)
+ cmd = _synthesize(cmdline, -1)
+ if cmd[1] is None:
+ register(cmdline, None, GenericBrowser(cmdline), -1)
cmdline = None # to make del work if _userchoices was empty
del cmdline
del _userchoices