Commit a37cfc64 authored by Benjamin Peterson's avatar Benjamin Peterson

Merged revisions...

Merged revisions 63402,63405,63411,63457,63467-63468,63480,63507-63508,63516,63534,63541 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r63402 | raymond.hettinger | 2008-05-16 23:13:36 -0500 (Fri, 16 May 2008) | 1 line

  Fix-up docstring
........
  r63405 | gregory.p.smith | 2008-05-17 02:17:34 -0500 (Sat, 17 May 2008) | 3 lines

  fix issue2381: test_subprocess fails if your sys.executable is on a
  path with a space in it.
........
  r63411 | lars.gustaebel | 2008-05-17 11:50:22 -0500 (Sat, 17 May 2008) | 8 lines

  Replace signatures with optional arguments in square brackets with
  keyword arguments and the actual default values.
  Fix references that point nowhere or to the wrong place.
  Add description of the ENCODING module-level variable.
  Fix the URL pointing to the GNU tar manual.
  Remove two obsolete examples.
  Add an example on how to use a generator with TarFile.extractall().
........
  r63457 | ronald.oussoren | 2008-05-18 15:09:54 -0500 (Sun, 18 May 2008) | 9 lines

  MacOSX: ctypes annotation in implementation of getproxies_macosx_sysconf

  getproxies_macosx_sysconf uses ctypes to call SystemConfiguration APIs. This
  checkin adds ctypes annotation to specify the right argument types for the
  API's that are used.

  This is needed to be able to use urllib on a 64-bit system, without
  annotations you'd get a hard crash.
........
  r63467 | andrew.kuchling | 2008-05-18 22:03:46 -0500 (Sun, 18 May 2008) | 1 line

  Re-organize the increasingly long list of deprecated modules
........
  r63468 | benjamin.peterson | 2008-05-19 06:55:54 -0500 (Mon, 19 May 2008) | 2 lines

  just MacOS (instead of MacOS 9)
........
  r63480 | neal.norwitz | 2008-05-20 00:21:57 -0500 (Tue, 20 May 2008) | 1 line

  Add html package so it gets installed and more tests work (from installed copy)
........
  r63507 | vinay.sajip | 2008-05-20 10:34:36 -0500 (Tue, 20 May 2008) | 1 line

  Fixed: #2914 (RFE for UTC support in TimedRotatingFileHandler) and #2929 (wrong filename used to delete old log files).
........
  r63508 | vinay.sajip | 2008-05-20 10:37:22 -0500 (Tue, 20 May 2008) | 1 line

  Updated with fixes for #2914 and #2929.
........
  r63516 | martin.v.loewis | 2008-05-21 02:31:31 -0500 (Wed, 21 May 2008) | 2 lines

  Add Robert Schuppenies.
........
  r63534 | brett.cannon | 2008-05-21 22:18:35 -0500 (Wed, 21 May 2008) | 1 line

  Add Quentin Gallet-Gilles for (at least) a fixer for markupbase.
........
  r63541 | raymond.hettinger | 2008-05-22 19:49:27 -0500 (Thu, 22 May 2008) | 1 line

  Docs for Issue 2819.
........
parent 2c9c7a5f
...@@ -96,6 +96,12 @@ Number-theoretic and representation functions: ...@@ -96,6 +96,12 @@ Number-theoretic and representation functions:
Return the fractional and integer parts of *x*. Both results carry the sign of Return the fractional and integer parts of *x*. Both results carry the sign of
*x*, and both are floats. *x*, and both are floats.
.. function:: sum(iterable)
Return an accurate floating point sum of values in the iterable. Avoids
loss of precision by tracking multiple intermediate partial sums. The
algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the
typical case where the rounding mode is half-even.
.. function:: trunc(x) .. function:: trunc(x)
......
This diff is collapsed.
...@@ -1477,7 +1477,44 @@ details. ...@@ -1477,7 +1477,44 @@ details.
and some modules are being renamed or moved into packages. and some modules are being renamed or moved into packages.
Python 2.6 running in 3.0-warning mode will warn about these modules Python 2.6 running in 3.0-warning mode will warn about these modules
when they are imported. when they are imported.
The modules that have been renamed are:
* :mod:`ConfigParser` has become :mod:`configparser`.
* :mod:`copy_reg` has become :mod:`copyreg`.
* :mod:`htmlentitydefs` has become :mod:`html.entities`.
* :mod:`HTMLParser` has become :mod:`html.parser`.
* :mod:`repr` (the module) has become :mod:`reprlib`.
* :mod:`SocketServer` has become :mod:`socketserver`.
* :mod:`Tkinter` has become the :mod:`tkinter` package.
* :mod:`Queue` has become :mod:`queue`.
The list of deprecated modules is: The list of deprecated modules is:
:mod:`audiodev`,
:mod:`bgenlocations`,
:mod:`buildtools`,
:mod:`bundlebuilder`,
:mod:`Canvas`,
:mod:`compiler`,
:mod:`dircache`,
:mod:`dl`,
:mod:`fpformat`,
:mod:`gensuitemodule`,
:mod:`ihooks`,
:mod:`imageop`,
:mod:`imgfile`,
:mod:`linuxaudiodev`,
:mod:`mhlib`,
:mod:`multifile`,
:mod:`new`,
:mod:`popen2`,
:mod:`pure`,
:mod:`statvfs`,
:mod:`sunaudiodev`,
:mod:`test.testall`,
:mod:`toaiff`.
Various MacOS modules have been removed:
:mod:`_builtinSuites`, :mod:`_builtinSuites`,
:mod:`aepack`, :mod:`aepack`,
:mod:`aetools`, :mod:`aetools`,
...@@ -1487,68 +1524,57 @@ details. ...@@ -1487,68 +1524,57 @@ details.
:mod:`appletrunner`, :mod:`appletrunner`,
:mod:`argvemulator`, :mod:`argvemulator`,
:mod:`Audio_mac`, :mod:`Audio_mac`,
:mod:`audiodev`,
:mod:`autoGIL`, :mod:`autoGIL`,
:mod:`bgenlocations`,
:mod:`buildtools`,
:mod:`bundlebuilder`,
:mod:`Canvas`,
:mod:`Carbon`, :mod:`Carbon`,
:mod:`cfmfile`, :mod:`cfmfile`,
:mod:`CodeWarrior`, :mod:`CodeWarrior`,
:mod:`ColorPicker`, :mod:`ColorPicker`,
:mod:`compiler`,
:mod:`cd`,
:mod:`cddb`,
:mod:`cdplayer`,
:mod:`CL` and :mod:`cl`,
:mod:`cd`,
:mod:`cd`,
:mod:`dircache`,
:mod:`dl`,
:mod:`EasyDialogs`, :mod:`EasyDialogs`,
:mod:`Explorer`, :mod:`Explorer`,
:mod:`Finder`, :mod:`Finder`,
:mod:`FrameWork`, :mod:`FrameWork`,
:mod:`findertools`, :mod:`findertools`,
:mod:`fpformat`,
:mod:`gensuitemodule`,
:mod:`ic`, :mod:`ic`,
:mod:`icglue`, :mod:`icglue`,
:mod:`icopen`, :mod:`icopen`,
:mod:`ihooks`,
:mod:`imageop`,
:mod:`linuxaudiodev`,
:mod:`macerrors`, :mod:`macerrors`,
:mod:`MacOS`, :mod:`MacOS`,
:mod:`macostools`, :mod:`macostools`,
:mod:`macresource`, :mod:`macresource`,
:mod:`mhlib`,
:mod:`MiniAEFrame`, :mod:`MiniAEFrame`,
:mod:`multifile`,
:mod:`Nav`, :mod:`Nav`,
:mod:`Netscape`, :mod:`Netscape`,
:mod:`new`,
:mod:`OSATerminology`, :mod:`OSATerminology`,
:mod:`pimp`, :mod:`pimp`,
:mod:`PixMapWrapper`, :mod:`PixMapWrapper`,
:mod:`popen2`,
:mod:`pure`,
:mod:`StdSuites`, :mod:`StdSuites`,
:mod:`sv`,
:mod:`SystemEvents`, :mod:`SystemEvents`,
:mod:`Terminal`, :mod:`Terminal`,
:mod:`terminalcommand`, :mod:`terminalcommand`.
:mod:`test.testall`,
:mod:`toaiff`,
:mod:`videoreader`.
The modules that have been renamed are:
* :mod:`ConfigParser` has become :mod:`configparser`. A number of old IRIX-specific modules were deprecated:
* :mod:`copy_reg` has become :mod:`copyreg`. :mod:`cd`,
* :mod:`SocketServer` has become :mod:`socketserver`. :mod:`cddb`,
* :mod:`Queue` has become :mod:`queue`. :mod:`cdplayer`,
:mod:`CL` and :mod:`cl`,
:mod:`DEVICE`,
:mod:`ERRNO`,
:mod:`FILE`,
:mod:`FL` and :mod:`fl`,
:mod:`flp`,
:mod:`fm`,
:mod:`GET`,
:mod:`GLWS`,
:mod:`GL` and :mod:`gl`,
:mod:`IN`,
:mod:`IOCTL`,
:mod:`jpeg`,
:mod:`panelparser`,
:mod:`readcd`,
:mod:`SV` and :mod:`sv`,
:mod:`torgb`,
:mod:`videoreader`,
:mod:`WAIT`.
* The :mod:`bsddb.dbshelve` module now uses the highest pickling protocol * The :mod:`bsddb.dbshelve` module now uses the highest pickling protocol
available, instead of restricting itself to protocol 1. available, instead of restricting itself to protocol 1.
......
...@@ -153,10 +153,11 @@ class TimedRotatingFileHandler(BaseRotatingHandler): ...@@ -153,10 +153,11 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
If backupCount is > 0, when rollover is done, no more than backupCount If backupCount is > 0, when rollover is done, no more than backupCount
files are kept - the oldest ones are deleted. files are kept - the oldest ones are deleted.
""" """
def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None, delay=0): def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None, delay=0, utc=0):
BaseRotatingHandler.__init__(self, filename, 'a', encoding, delay) BaseRotatingHandler.__init__(self, filename, 'a', encoding, delay)
self.when = when.upper() self.when = when.upper()
self.backupCount = backupCount self.backupCount = backupCount
self.utc = utc
# Calculate the real rollover interval, which is just the number of # Calculate the real rollover interval, which is just the number of
# seconds between rollovers. Also set the filename suffix used when # seconds between rollovers. Also set the filename suffix used when
# a rollover occurs. Current 'when' events supported: # a rollover occurs. Current 'when' events supported:
...@@ -211,7 +212,10 @@ class TimedRotatingFileHandler(BaseRotatingHandler): ...@@ -211,7 +212,10 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
# the rest. Note that this code doesn't care about leap seconds. :) # the rest. Note that this code doesn't care about leap seconds. :)
if self.when == 'MIDNIGHT' or self.when.startswith('W'): if self.when == 'MIDNIGHT' or self.when.startswith('W'):
# This could be done with less code, but I wanted it to be clear # This could be done with less code, but I wanted it to be clear
t = time.localtime(currentTime) if utc:
t = time.gmtime(currentTime)
else:
t = time.localtime(currentTime)
currentHour = t[3] currentHour = t[3]
currentMinute = t[4] currentMinute = t[4]
currentSecond = t[5] currentSecond = t[5]
...@@ -242,13 +246,14 @@ class TimedRotatingFileHandler(BaseRotatingHandler): ...@@ -242,13 +246,14 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
else: else:
daysToWait = 6 - day + self.dayOfWeek + 1 daysToWait = 6 - day + self.dayOfWeek + 1
newRolloverAt = self.rolloverAt + (daysToWait * (60 * 60 * 24)) newRolloverAt = self.rolloverAt + (daysToWait * (60 * 60 * 24))
dstNow = t[-1] if not utc:
dstAtRollover = time.localtime(newRolloverAt)[-1] dstNow = t[-1]
if dstNow != dstAtRollover: dstAtRollover = time.localtime(newRolloverAt)[-1]
if not dstNow: # DST kicks in before next rollover, so we need to deduct an hour if dstNow != dstAtRollover:
newRolloverAt = newRolloverAt - 3600 if not dstNow: # DST kicks in before next rollover, so we need to deduct an hour
else: # DST bows out before next rollover, so we need to add an hour newRolloverAt = newRolloverAt - 3600
newRolloverAt = newRolloverAt + 3600 else: # DST bows out before next rollover, so we need to add an hour
newRolloverAt = newRolloverAt + 3600
self.rolloverAt = newRolloverAt self.rolloverAt = newRolloverAt
#print "Will rollover at %d, %d seconds from now" % (self.rolloverAt, self.rolloverAt - currentTime) #print "Will rollover at %d, %d seconds from now" % (self.rolloverAt, self.rolloverAt - currentTime)
...@@ -281,7 +286,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler): ...@@ -281,7 +286,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
if fileName[:plen] == prefix: if fileName[:plen] == prefix:
suffix = fileName[plen:] suffix = fileName[plen:]
if self.extMatch.match(suffix): if self.extMatch.match(suffix):
result.append(fileName) result.append(os.path.join(dirName, fileName))
result.sort() result.sort()
if len(result) < self.backupCount: if len(result) < self.backupCount:
result = [] result = []
...@@ -300,7 +305,10 @@ class TimedRotatingFileHandler(BaseRotatingHandler): ...@@ -300,7 +305,10 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
self.stream.close() self.stream.close()
# get the time that this sequence started at and make it a TimeTuple # get the time that this sequence started at and make it a TimeTuple
t = self.rolloverAt - self.interval t = self.rolloverAt - self.interval
timeTuple = time.localtime(t) if self.utc:
timeTuple = time.gmtime(t)
else:
timeTuple = time.localtime(t)
dfn = self.baseFilename + "." + time.strftime(self.suffix, timeTuple) dfn = self.baseFilename + "." + time.strftime(self.suffix, timeTuple)
if os.path.exists(dfn): if os.path.exists(dfn):
os.remove(dfn) os.remove(dfn)
...@@ -321,7 +329,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler): ...@@ -321,7 +329,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
while newRolloverAt <= currentTime: while newRolloverAt <= currentTime:
newRolloverAt = newRolloverAt + self.interval newRolloverAt = newRolloverAt + self.interval
#If DST changes and midnight or weekly rollover, adjust for this. #If DST changes and midnight or weekly rollover, adjust for this.
if self.when == 'MIDNIGHT' or self.when.startswith('W'): if (self.when == 'MIDNIGHT' or self.when.startswith('W')) and not self.utc:
dstNow = time.localtime(currentTime)[-1] dstNow = time.localtime(currentTime)[-1]
dstAtRollover = time.localtime(newRolloverAt)[-1] dstAtRollover = time.localtime(newRolloverAt)[-1]
if dstNow != dstAtRollover: if dstNow != dstAtRollover:
......
...@@ -240,7 +240,7 @@ class POP3: ...@@ -240,7 +240,7 @@ class POP3:
def rset(self): def rset(self):
"""Not sure what this does.""" """Unmark all messages marked for deletion."""
return self._shortcmd('RSET') return self._shortcmd('RSET')
......
...@@ -534,7 +534,7 @@ class ProcessTestCase(unittest.TestCase): ...@@ -534,7 +534,7 @@ class ProcessTestCase(unittest.TestCase):
# args is a string # args is a string
f, fname = self.mkstemp() f, fname = self.mkstemp()
os.write(f, "#!/bin/sh\n") os.write(f, "#!/bin/sh\n")
os.write(f, "exec %s -c 'import sys; sys.exit(47)'\n" % os.write(f, "exec '%s' -c 'import sys; sys.exit(47)'\n" %
sys.executable) sys.executable)
os.close(f) os.close(f)
os.chmod(fname, 0o700) os.chmod(fname, 0o700)
...@@ -576,7 +576,7 @@ class ProcessTestCase(unittest.TestCase): ...@@ -576,7 +576,7 @@ class ProcessTestCase(unittest.TestCase):
# call() function with string argument on UNIX # call() function with string argument on UNIX
f, fname = self.mkstemp() f, fname = self.mkstemp()
os.write(f, "#!/bin/sh\n") os.write(f, "#!/bin/sh\n")
os.write(f, "exec %s -c 'import sys; sys.exit(47)'\n" % os.write(f, "exec '%s' -c 'import sys; sys.exit(47)'\n" %
sys.executable) sys.executable)
os.close(f) os.close(f)
os.chmod(fname, 0o700) os.chmod(fname, 0o700)
......
...@@ -1271,6 +1271,24 @@ def proxy_bypass_environment(host): ...@@ -1271,6 +1271,24 @@ def proxy_bypass_environment(host):
if sys.platform == 'darwin': if sys.platform == 'darwin':
def _CFSetup(sc):
from ctypes import c_int32, c_void_p, c_char_p, c_int
sc.CFStringCreateWithCString.argtypes = [ c_void_p, c_char_p, c_int32 ]
sc.CFStringCreateWithCString.restype = c_void_p
sc.SCDynamicStoreCopyProxies.argtypes = [ c_void_p ]
sc.SCDynamicStoreCopyProxies.restype = c_void_p
sc.CFDictionaryGetValue.argtypes = [ c_void_p, c_void_p ]
sc.CFDictionaryGetValue.restype = c_void_p
sc.CFStringGetLength.argtypes = [ c_void_p ]
sc.CFStringGetLength.restype = c_int32
sc.CFStringGetCString.argtypes = [ c_void_p, c_char_p, c_int32, c_int32 ]
sc.CFStringGetCString.restype = c_int32
sc.CFNumberGetValue.argtypes = [ c_void_p, c_int, c_void_p ]
sc.CFNumberGetValue.restype = c_int32
sc.CFRelease.argtypes = [ c_void_p ]
sc.CFRelease.restype = None
def _CStringFromCFString(sc, value): def _CStringFromCFString(sc, value):
from ctypes import create_string_buffer from ctypes import create_string_buffer
length = sc.CFStringGetLength(value) + 1 length = sc.CFStringGetLength(value) + 1
...@@ -1307,6 +1325,7 @@ if sys.platform == 'darwin': ...@@ -1307,6 +1325,7 @@ if sys.platform == 'darwin':
return (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8) | parts[3] return (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8) | parts[3]
sc = cdll.LoadLibrary(find_library("SystemConfiguration")) sc = cdll.LoadLibrary(find_library("SystemConfiguration"))
_CFSetup(sc)
hostIP = None hostIP = None
...@@ -1319,6 +1338,8 @@ if sys.platform == 'darwin': ...@@ -1319,6 +1338,8 @@ if sys.platform == 'darwin':
proxyDict = sc.SCDynamicStoreCopyProxies(None) proxyDict = sc.SCDynamicStoreCopyProxies(None)
if proxyDict is None:
return False
try: try:
# Check for simple host names: # Check for simple host names:
...@@ -1372,11 +1393,11 @@ if sys.platform == 'darwin': ...@@ -1372,11 +1393,11 @@ if sys.platform == 'darwin':
from ctypes.util import find_library from ctypes.util import find_library
sc = cdll.LoadLibrary(find_library("SystemConfiguration")) sc = cdll.LoadLibrary(find_library("SystemConfiguration"))
_CFSetup(sc)
if not sc: if not sc:
return {} return {}
kSCPropNetProxiesHTTPEnable = sc.CFStringCreateWithCString(0, b"HTTPEnable", 0) kSCPropNetProxiesHTTPEnable = sc.CFStringCreateWithCString(0, b"HTTPEnable", 0)
kSCPropNetProxiesHTTPProxy = sc.CFStringCreateWithCString(0, b"HTTPProxy", 0) kSCPropNetProxiesHTTPProxy = sc.CFStringCreateWithCString(0, b"HTTPProxy", 0)
kSCPropNetProxiesHTTPPort = sc.CFStringCreateWithCString(0, b"HTTPPort", 0) kSCPropNetProxiesHTTPPort = sc.CFStringCreateWithCString(0, b"HTTPPort", 0)
......
...@@ -818,7 +818,7 @@ LIBSUBDIRS= tkinter site-packages test test/output test/data \ ...@@ -818,7 +818,7 @@ LIBSUBDIRS= tkinter site-packages test test/output test/data \
test/decimaltestdata \ test/decimaltestdata \
encodings \ encodings \
email email/mime email/test email/test/data \ email email/mime email/test email/test/data \
json json/tests \ html json json/tests \
sqlite3 sqlite3/test \ sqlite3 sqlite3/test \
logging bsddb bsddb/test csv wsgiref \ logging bsddb bsddb/test csv wsgiref \
lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \ lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
......
...@@ -227,6 +227,7 @@ Achim Gaedke ...@@ -227,6 +227,7 @@ Achim Gaedke
Lele Gaifax Lele Gaifax
Santiago Gala Santiago Gala
Yitzchak Gale Yitzchak Gale
Quentin Gallet-Gilles
Raymund Galvin Raymund Galvin
Nitin Ganatra Nitin Ganatra
Fred Gansevles Fred Gansevles
......
...@@ -17,6 +17,9 @@ the format to accommodate documentation needs as they arise. ...@@ -17,6 +17,9 @@ the format to accommodate documentation needs as they arise.
Permissions History Permissions History
------------------- -------------------
- Robert Schuppenies was given SVN access on 21 May 2008 by MvL,
for GSoC contributions.
- Rodrigo Bernardo Pimentel was given SVN access on 29 April 2008 by MvL, - Rodrigo Bernardo Pimentel was given SVN access on 29 April 2008 by MvL,
for GSoC contributions. for GSoC contributions.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment