Commit Graph

2194 Commits

Author SHA1 Message Date
Georg Brandl ff432e6f4a Patch #1663234: you can now run doctest on test files and modules
using "python -m doctest [-v] filename ...".
2007-03-06 13:37:45 +00:00
Georg Brandl 098cd69ff9 Bug #1674503: close the file opened by execfile() in an error condition. 2007-03-06 12:17:50 +00:00
Martin v. Löwis 3eb7648986 Patch #1121142: Implement ZipFile.open. 2007-03-06 10:41:24 +00:00
Georg Brandl d28b9fc686 Patch #1671450: add a section about subclassing builtin types to the
"extending and embedding" tutorial.
2007-03-06 10:02:47 +00:00
Georg Brandl 0fca97a5fb Patch #1674228: when assigning a slice (old-style), check for the
sq_ass_slice instead of the sq_slice slot.
2007-03-05 22:28:08 +00:00
Skip Montanaro f694b1b741 note MacPorts/BerkDB change in setup.py 2007-03-04 20:54:12 +00:00
Raymond Hettinger c37e5e04eb Add collections.NamedTuple 2007-03-01 06:16:43 +00:00
Jeremy Hylton cca75403c4 Add news about changes to metaclasses and __bases__ error checking. 2007-02-27 18:33:31 +00:00
Neal Norwitz 88516a6039 When printing an unraisable error, don't print exceptions. before the name.
This duplicates the behavior whening normally printing exceptions.
2007-02-26 22:41:45 +00:00
Jeremy Hylton c5ceb251b3 Fix crash in exec when unicode filename can't be decoded.
I can't think of an easy way to test this behavior.  It only occurs
when the file system default encoding and the interpreter default
encoding are different, such that you can open the file but not decode
its name.
2007-02-25 15:57:45 +00:00
Raymond Hettinger d36862cf78 Add itertools.izip_longest(). 2007-02-21 05:20:38 +00:00
Martin v. Löwis 382abeff0f Patch #1490190: posixmodule now includes os.chflags() and os.lchflags()
functions on platforms where the underlying system calls are available.
2007-02-19 10:55:19 +00:00
Lars Gustäbel 0713a68dc5 Moved misplaced news item. 2007-02-19 09:54:47 +00:00
Raymond Hettinger 00166c5532 Add merge() function to heapq. 2007-02-19 04:08:43 +00:00
Brett Cannon 971a012ce1 Update the encoding package's search function to use absolute imports when
calling __import__.  This helps make the expected search locations for encoding
modules be more explicit.

One could use an explicit value for __path__ when making the call to __import__
to force the exact location searched for encodings.  This would give the most
strict search path possible if one is worried about malicious code being
imported.  The unfortunate side-effect of that is that if __path__ was modified
on 'encodings' on purpose in a safe way it would not be picked up in future
__import__ calls.
2007-02-15 22:54:39 +00:00
Georg Brandl 983d100202 Patch #1494140: Add documentation for the new struct.Struct object. 2007-02-15 11:29:04 +00:00
Martin v. Löwis 45423a7571 Patch #1432399: Add HCI sockets. 2007-02-14 10:07:37 +00:00
Lars Gustäbel 5b1a785702 Patch #1647484: Renamed GzipFile's filename attribute to name. The
filename attribute is still accessible as a property that emits a
DeprecationWarning.
2007-02-13 16:09:24 +00:00
Martin v. Löwis b1cc1d407b Patch #1657276: Make NETLINK_DNRTMSG conditional.
Will backport.
2007-02-13 12:14:19 +00:00
Martin v. Löwis 84f6de9d7e Patch #1517891: Make 'a' create the file if it doesn't exist.
Fixes #1514451.
2007-02-13 10:10:39 +00:00
Martin v. Löwis c6d626ed9f Patch #698833: Support file decryption in zipfile. 2007-02-13 09:49:38 +00:00
Martin v. Löwis 07aa3ed372 Patch #685268: Consider a package's __path__ in imputil.
Will backport.
2007-02-13 08:34:45 +00:00
Martin v. Löwis 2bad58f5a4 Patch 1463026: Support default namespace in XMLGenerator.
Fixes #847665. Will backport.
2007-02-12 12:21:10 +00:00
Skip Montanaro 691acf2879 fix trace.py --ignore-dir 2007-02-11 18:24:37 +00:00
Martin v. Löwis 0a2032673c Bug #1600860: Search for shared python library in LIBDIR, not
lib/python/config, on "linux" and "gnu" systems.
Will backport.
2007-02-09 12:36:48 +00:00
Martin v. Löwis fd963265e2 Bug #1653736: Properly discard third argument to slot_nb_inplace_power.
Will backport.
2007-02-09 12:19:32 +00:00
Martin v. Löwis 4c11a92625 Bug #1653736: Complain about keyword arguments to time.isoformat.
Will backport to 2.5.
2007-02-08 09:13:36 +00:00
Lars Gustäbel 3f8aca1164 Patch #1652681: create nonexistent files in append mode and
allow appending to empty files.
2007-02-06 18:38:13 +00:00
Peter Astrand 5f9c6ae545 Applied patch 1124861.3.patch to solve bug #1124861: Automatically create pipes on Windows, if GetStdHandle fails. Will backport. 2007-02-06 15:37:50 +00:00
Brett Cannon 129bd52146 No more raising of string exceptions!
The next step of PEP 352 (for 2.6) causes raising a string exception to trigger
a TypeError.  Trying to catch a string exception raises a DeprecationWarning.
References to string exceptions has been removed from the docs since they are
now just an error.
2007-01-30 21:34:36 +00:00
Brett Cannon e05e6b0032 Add a test for slicing an exception. 2007-01-29 04:41:44 +00:00
Georg Brandl 4ba9e5bdc7 Patch #1634778: add missing encoding aliases for iso8859_15 and
iso8859_16.
2007-01-27 17:59:42 +00:00
Georg Brandl ab49684f55 Patch #1638243: the compiler package is now able to correctly compile
a with statement; previously, executing code containing a with statement
compiled by the compiler package crashed the interpreter.
2007-01-27 17:43:02 +00:00
Brett Cannon 07e1db317d Fix time.strptime's %U support. Basically rewrote the algorithm to be more
generic so that one only has to shift certain values based on whether the week
was specified to start on Monday or Sunday.  Cut out a lot of edge case code
compared to the previous version.  Also broke algorithm out into its own
function (that is private to the module).

Fixes bug #1643943 (thanks Biran Nahas for the report).
2007-01-25 20:22:02 +00:00
Thomas Heller 4378215474 Fix for #1643874: When calling SysAllocString, create a PyCObject
which will eventually call SysFreeString to free the BSTR resource.
2007-01-25 18:34:14 +00:00
Brett Cannon f5bee30e30 Fix crasher for when an object's __del__ creates a new weakref to itself.
Patch only fixes new-style classes; classic classes still buggy.

Closes bug #1377858.  Already backported.
2007-01-23 23:21:22 +00:00
Martin v. Löwis 6c5c502b91 Make PyTraceBack_Here use the current thread, not the
frame's thread state. Fixes #1579370.
Will backport.
2007-01-23 21:11:47 +00:00
Thomas Wouters 6ed1965308 Add news entry about last checkin (oops.) 2007-01-23 13:50:49 +00:00
Lars Gustäbel d2e22903d3 Patch #1507247: tarfile.py: use current umask for intermediate
directories.
2007-01-23 11:17:33 +00:00
Georg Brandl dd7b0525e9 Patch #1627441: close sockets properly in urllib2. 2007-01-21 10:35:10 +00:00
Georg Brandl b84c13792d Bug #1486663: don't reject keyword arguments for subclasses of builtin
types.
2007-01-21 10:28:43 +00:00
Martin v. Löwis aef4c6bc00 Patch #1610575: Add support for _Bool to struct. 2007-01-21 09:33:07 +00:00
Martin v. Löwis 4885e7d098 Prefix AST symbols with _Py_. Fixes #1637022.
Will backport.
2007-01-19 06:42:22 +00:00
Georg Brandl b26b1c6d6b Bug #1629125: fix wrong data type (int -> Py_ssize_t) in PyDict_Next docs. 2007-01-17 21:19:58 +00:00
Sjoerd Mullender 33a0a06d31 Fixed ntpath.expandvars to not replace references to non-existing
variables with nothing.  Also added tests.
This fixes bug #494589.
2007-01-16 16:42:38 +00:00
Marc-André Lemburg fa3d08b4a9 Add news items for the recent pybench and platform changes. 2007-01-16 13:03:06 +00:00
Guido van Rossum bb2cc698c1 Patch #1635058 by Mark Roberts: ensure that htonl and friends never accept or
return negative numbers, per the underlying C implementation.
2007-01-14 17:03:32 +00:00
Brett Cannon 093b67061a Deprecate the sets module. 2007-01-13 00:29:49 +00:00
Thomas Heller 6fd4549bc6 patch #1610795: BSD version of ctypes.util.find_library, by Martin
Kammerhofer.
2007-01-12 20:21:53 +00:00
Thomas Heller 8138c26a83 Fixes for 64-bit Windows: In ctypes.wintypes, correct the definitions
of HANDLE, WPARAM, LPARAM data types.  Make parameterless foreign
function calls work.
2007-01-11 21:18:56 +00:00
Matthias Klose a398e2d059 - idle: Honor the "Cancel" action in the save dialog (Debian bug #299092). 2007-01-11 11:44:04 +00:00
Thomas Heller fb9d78733e Change the ctypes version number to "1.1.0". 2007-01-10 20:12:13 +00:00
Vinay Sajip ab41c109fa Added entry about addition of _open() method to logging.FileHandler. 2007-01-09 14:51:36 +00:00
Vinay Sajip c9137263d5 Added entries about removal of some bare except clauses from logging. 2007-01-08 18:52:36 +00:00
Neal Norwitz 72cd02c041 Prevent crash on shutdown which can occur if we are finalizing
and the module dict has been cleared already and some object
raises a warning (like in a __del__).

Will backport.
2007-01-05 05:25:22 +00:00
Gregory P. Smith 8b96a35d14 Support linking of the bsddb module against BerkeleyDB 4.5.x
(will backport to 2.5)
2007-01-05 01:59:42 +00:00
Martin v. Löwis 7b7c9d4208 Bug #1566280: Explicitly invoke threading._shutdown from Py_Main,
to avoid relying on atexit.
Will backport to 2.5.
2007-01-04 21:06:12 +00:00
Brett Cannon 92d54d5e9c Add EnvironmentVarGuard to test.test_support. Provides a context manager to
temporarily set or unset environment variables.
2007-01-04 00:23:49 +00:00
Lars Gustäbel a7ba6fc548 Patch #1504073: Fix tarfile.open() for mode "r" with a fileobj argument.
Will backport to 2.5.
2006-12-27 10:30:46 +00:00
Andrew M. Kuchling 7166232399 [Rest of patch #1182394] Add ._current() method so that we can use the written-in-C .hexdigest() method 2006-12-27 03:31:24 +00:00
Lars Gustäbel a4b2381b20 Patch #1262036: Prevent TarFiles from being added to themselves under
certain conditions.

Will backport to 2.5.
2006-12-23 17:57:23 +00:00
Lars Gustäbel 6baa502769 Patch #1230446: tarfile.py: fix ExFileObject so that read() and tell()
work correctly together with readline().

Will backport to 2.5.
2006-12-23 16:40:13 +00:00
Raymond Hettinger 94547f7646 Bug #1590891: random.randrange don't return correct value for big number
Needs to be backported.
2006-12-20 06:42:06 +00:00
Georg Brandl ebbeed781d Patch #1484695: The tarfile module now raises a HeaderError exception
if a buffer given to frombuf() is invalid.
2006-12-19 22:06:46 +00:00
Vinay Sajip 76fdb8c050 Added news on recent changes to logging 2006-12-14 08:53:55 +00:00
Brett Cannon 6d9520c4f0 Add test.test_support.guard_warnings_filter . This function returns a context
manager that protects warnings.filter from being modified once the context is
exited.
2006-12-13 23:09:53 +00:00
Matthias Klose ebde1498e7 - Fix the build of the library reference in info format. 2006-12-09 12:15:27 +00:00
Georg Brandl b130743e97 Patch #1608267: fix a race condition in os.makedirs() is the directory
to be created is already there.
2006-12-09 09:08:29 +00:00
Georg Brandl 87fa559479 Patch #1610437: fix a tarfile bug with long filename headers. 2006-12-06 22:21:18 +00:00
Matthias Klose d149d0c76a - Fix build failure on kfreebsd and on the hurd. 2006-12-03 17:16:41 +00:00
Martin v. Löwis a00bcac003 Patch #1371075: Make ConfigParser accept optional dict type
for ordering, sorting, etc.
2006-12-03 12:01:53 +00:00
Martin v. Löwis 046c4d13be Patch #1544279: Improve thread-safety of the socket module by moving
the sock_addr_t storage out of the socket object.
Will backport to 2.5.
2006-12-03 11:23:45 +00:00
Martin v. Löwis 8609da9b17 Move IDLE news into NEWS.txt. 2006-12-03 09:54:46 +00:00
Thomas Heller ef583a4992 Fix #1563807: _ctypes built on AIX fails with ld ffi error.
The contents of ffi_darwin.c must be compiled unless __APPLE__ is
defined and __ppc__ is not.

Will backport.
2006-11-28 20:21:54 +00:00
Martin v. Löwis 4d542ec13c Disable _XOPEN_SOURCE on NetBSD 1.x.
Will backport to 2.5
2006-11-25 15:39:19 +00:00
Thomas Heller 25d208bd46 Fix bug #1598620: A ctypes structure cannot contain itself. 2006-11-24 18:45:39 +00:00
Martin v. Löwis 4ebbefe677 Patch #1362975: Rework CodeContext indentation algorithm to
avoid hard-coding pixel widths. Also make the text's scrollbar
a child of the text frame, not the top widget.
2006-11-22 08:50:02 +00:00
Martin v. Löwis 2607e6c021 Conditionalize definition of _CRT_SECURE_NO_DEPRECATE
and _CRT_NONSTDC_NO_DEPRECATE.
Will backport.
2006-11-21 18:20:25 +00:00
Neal Norwitz 4fe442383d Bug #1599782: Fix segfault on bsddb.db.DB().type().
The problem is that _DB_get_type() can't be called without the GIL
because it calls a bunch of PyErr_* APIs when an error occurs.
There were no other cases in this file that it was called without the GIL.
Removing the BEGIN/END THREAD around _DB_get_type() made everything work.

Will backport.
2006-11-21 05:26:22 +00:00
Neal Norwitz 45e230a8e1 Speed up function calls into the math module by using METH_O.
There should be no functional changes. However, the error msgs are
slightly different.  Also verified that the module dict is not NULL on init.
2006-11-19 21:26:53 +00:00
Martin v. Löwis 07529354db Patch #1070046: Marshal new-style objects like InstanceType
in xmlrpclib.
2006-11-19 18:51:54 +00:00
Martin v. Löwis cffcc8b195 Make cStringIO.truncate raise IOError for negative
arguments (even for -1). Fixes the last bit of
#1359365.
2006-11-19 10:41:41 +00:00
Georg Brandl 283a1353a0 Patch [ 1586791 ] better error msgs for some TypeErrors 2006-11-19 08:48:30 +00:00
Martin v. Löwis bba003ef24 Patch #1472877: Fix Tix subwidget name resolution.
Will backport to 2.5.
2006-11-18 18:42:11 +00:00
Martin v. Löwis ef5fd3e7c9 Patch #1594554: Always close a tkSimpleDialog on ok(), even
if an exception occurs.
Will backport to 2.5.
2006-11-18 18:05:35 +00:00
Martin v. Löwis c73a4a4f51 Patch #1538878: Don't make tkSimpleDialog dialogs transient if
the parent window is withdrawn. This mirrors what dialog.tcl
does.
Will backport to 2.5.
2006-11-18 18:00:23 +00:00
Georg Brandl 25aabf4cbb Bug #1588217: don't parse "= " as a soft line break in binascii's
a2b_qp() function, instead leave it in the string as quopri.decode()
does.
2006-11-16 17:08:45 +00:00
Georg Brandl 540821183b Bug #1597824: return the registered function from atexit.register()
to facilitate usage as a decorator.
2006-11-16 16:50:59 +00:00
Martin v. Löwis 45cd4ff95d Patch #1360200: Use unmangled_version RPM spec field to deal with
file name mangling.
Will backport to 2.5.
2006-11-12 18:56:03 +00:00
Martin v. Löwis 36cbc08f3f Patch #1359217: Ignore 2xx response before 150 response.
Will backport to 2.5.
2006-11-12 18:48:13 +00:00
Martin v. Löwis 056dac1bcf Bug #1067760: Deprecate passing floats to file.seek. 2006-11-12 18:24:26 +00:00
Martin v. Löwis 065f0c8a06 Patch #1355023: support whence argument for GzipFile.seek. 2006-11-12 10:41:39 +00:00
Martin v. Löwis 040a927cd1 Patch #1065257: Support passing open files as body in
HTTPConnection.request().
2006-11-12 10:32:47 +00:00
Andrew M. Kuchling 77c7ac26b7 Reword entry 2006-11-10 13:14:01 +00:00
Andrew M. Kuchling 978d8286ae [Patch #1514543] mailbox (Maildir): avoid losing messages on name clash
Two changes:

Where possible, use link()/remove() to move files into a directory; this
makes it easier to avoid overwriting an existing file.

Use _create_carefully() to create files in tmp/, which uses O_EXCL.

Backport candidate.
2006-11-09 21:16:46 +00:00
Andrew M. Kuchling b5686da24f [Patch #1514544 by David Watson] use fsync() to ensure data is really on disk 2006-11-09 13:51:14 +00:00
Andrew M. Kuchling a3e5d3757c [Bug #1569790] mailbox.Maildir.get_folder() loses factory information
Both the Maildir and MH classes had this bug; the patch fixes both classes
and adds a test.

Will backport to 25-maint.
2006-11-09 13:27:07 +00:00
Martin v. Löwis 038cad7ee4 Patch #1592250: Add elidge argument to Tkinter.Text.search. 2006-11-09 11:27:32 +00:00
Martin v. Löwis b2bba739c5 Patch #838546: Make terminal become controlling in pty.fork().
Will backport to 2.5.
2006-11-09 11:06:03 +00:00
Martin v. Löwis 5361e9a54e Patch #1351744: Add askyesnocancel helper for tkMessageBox. 2006-11-08 07:35:55 +00:00
Martin v. Löwis a346c09291 News entry for 52662. 2006-11-08 06:48:36 +00:00
Neal Norwitz 85dbec6da7 Bug #1588287: fix invalid assertion for `1,2` in debug builds.
Will backport
2006-11-04 19:25:22 +00:00
Martin v. Löwis 5310e5078a - Patch #1060577: Extract list of RPM files from spec file in
bdist_rpm
Will backport to 2.5.
2006-11-04 18:14:06 +00:00
Georg Brandl b9f4ad3a9a Bug #1576657: when setting a KeyError for a tuple key, make sure that
the tuple isn't used as the "exception arguments tuple".
2006-10-29 18:31:42 +00:00
Georg Brandl 2c9838e30f Bug #1586613: fix zlib and bz2 codecs' incremental en/decoders. 2006-10-29 14:39:09 +00:00
Georg Brandl 3354f285b9 Patch #1583880: fix tarfile's problems with long names and posix/
GNU modes.
2006-10-29 09:16:12 +00:00
Georg Brandl 5addf70078 Bug #1586448: the compiler module now emits the same bytecode for
list comprehensions as the builtin compiler, using the LIST_APPEND
opcode.
2006-10-29 08:53:06 +00:00
Georg Brandl 8f99f81dfc Fix codecs.EncodedFile which did not use file_encoding in 2.5.0, and
fix all codecs file wrappers to work correctly with the "with"
statement (bug #1586513).
2006-10-29 08:39:22 +00:00
Neal Norwitz 21997afb0c Fix bug #1565514, SystemError not raised on too many nested blocks.
It seems like this should be a different error than SystemError, but
I don't have any great ideas and SystemError was raised in 2.4 and earlier.

Will backport.
2006-10-28 21:19:07 +00:00
Georg Brandl 2756278304 Patch #1552024: add decorator support to unparse.py demo script. 2006-10-27 20:39:43 +00:00
Thomas Heller 112d1a64ac Modulefinder now handles absolute and relative imports, including
tests.

Will backport to release25-maint.
2006-10-27 19:05:53 +00:00
Thomas Heller df08f0b9a0 WindowsError.str should display the windows error code,
not the posix error code; with test.
Fixes #1576174.

Will backport to release25-maint.
2006-10-27 18:31:36 +00:00
Martin v. Löwis ee82c0e6b7 Patch #1567274: Support SMTP over TLS. 2006-10-27 07:13:28 +00:00
Martin v. Löwis b5bc537c5e Patch #1549049: Rewrite type conversion in structmember.
Fixes #1545696 and #1566140. Will backport to 2.5.
2006-10-27 06:16:31 +00:00
Martin v. Löwis 1b2f627f96 - Patch #1560695: Add .note.GNU-stack to ctypes' sysv.S so that
ctypes isn't considered as requiring executable stacks.
Will backport to 2.5.
2006-10-22 10:55:15 +00:00
Martin v. Löwis aac1316222 Add check for the PyArg_ParseTuple format, and declare
it if it is supported.
2006-10-19 10:58:46 +00:00
Thomas Heller d2ea4a2584 ctypes callback functions only support 'fundamental' result types.
Check this and raise an error when something else is used - before
this change ctypes would hang or crash when such a callback was
called.  This is a partial fix for #1574584.

Will backport to release25-maint.
2006-10-17 19:30:48 +00:00
Martin v. Löwis fefbc2029c Forward-port r52358:
- Bug #1578513: Cross compilation was broken by a change to configure.
Repair so that it's back to how it was in 2.4.3.
2006-10-17 18:59:23 +00:00
Brett Cannon d80e0c8677 Fix turtle so that you can launch the demo2 function on its own instead of only
when the module is launched as a script.
2006-10-16 03:09:52 +00:00
Martin v. Löwis 012bc7253b Bug #1567666: Emulate GetFileAttributesExA for Win95.
Will backport to 2.5.
2006-10-15 09:43:39 +00:00
Martin v. Löwis 18aaa568fd Patch #1576166: Support os.utime for directories on Windows NT+. 2006-10-15 08:43:33 +00:00
Martin v. Löwis c9e82f6234 Patch #1576954: Update VC6 build directory; remove redundant
files in VC7. Will backport to 2.5.
2006-10-15 07:54:40 +00:00
Neal Norwitz cbeb687c68 Update the peephole optimizer to remove more dead code (jumps after returns)
and inline jumps to returns.
2006-10-14 21:33:38 +00:00
Georg Brandl 2c1375c8db Bug #1545497: when given an explicit base, int() did ignore NULs
embedded in the string to convert.
2006-10-12 11:27:59 +00:00
Georg Brandl 5597e261b2 Bug #1548891: The cStringIO.StringIO() constructor now encodes unicode
arguments with the system default encoding just like the write()
method does, instead of converting it to a raw buffer.
2006-10-12 09:47:12 +00:00
Georg Brandl a4c8e32a1f Bug #1565919: document set types in the Language Reference. 2006-10-12 08:22:53 +00:00
Georg Brandl d076153ee8 Bug #813342: Start the IDLE subprocess with -Qnew if the parent
is started with that option.
2006-10-12 07:57:21 +00:00
Martin v. Löwis f43893a878 Bug #1565150: Fix subsecond processing for os.utime on Windows. 2006-10-09 20:44:25 +00:00
Georg Brandl 412a9ea10e Patch #1572724: fix typo ('=' instead of '==') in _msi.c. 2006-10-09 19:03:06 +00:00
Andrew M. Kuchling 99994790a0 Add news item for rev. 52211 change 2006-10-09 17:10:12 +00:00
Hye-Shik Chang b788346573 Bug #1572832: fix a bug in ISO-2022 codecs which may cause segfault
when encoding non-BMP unicode characters.  (Submitted by Ray Chason)
2006-10-08 13:48:34 +00:00
Georg Brandl 846f73a530 Add missing NEWS entry for rev. 52129. 2006-10-08 07:11:54 +00:00
Martin v. Löwis 8b274265f0 Add MSVC8 project files to create wininst-8.exe. 2006-10-04 15:25:28 +00:00
Armin Rigo 7ccbca93a2 Forward-port of r52136,52138: a review of overflow-detecting code.
* unified the way intobject, longobject and mystrtoul handle
  values around -sys.maxint-1.

* in general, trying to entierely avoid overflows in any computation
  involving signed ints or longs is extremely involved.  Fixed a few
  simple cases where a compiler might be too clever (but that's all
  guesswork).

* more overflow checks against bad data in marshal.c.

* 2.5 specific: fixed a number of places that were still confusing int
  and Py_ssize_t.  Some of them could potentially have caused
  "real-world" breakage.

* list.pop(x): fixing overflow issues on x was messy.  I just reverted
  to PyArg_ParseTuple("n"), which does the right thing.  (An obscure
  test was trying to give a Decimal to list.pop()... doesn't make
  sense any more IMHO)

* trying to write a few tests...
2006-10-04 12:17:45 +00:00
Martin v. Löwis 820d6ac9d7 Fix integer negation and absolute value to not rely
on undefined behaviour of the C compiler anymore.
Will backport to 2.5 and 2.4.
2006-10-04 05:47:34 +00:00
Brett Cannon 373d90b365 Convert test_imp over to unittest. 2006-10-03 23:23:14 +00:00
Martin v. Löwis ebe26709d2 Fix test for uintptr_t. Fixes #1568842.
Will backport.
2006-10-02 14:55:51 +00:00
Georg Brandl 44a7b3a765 Bug #1546052: clarify that PyString_FromString(AndSize) copies the
string pointed to by its parameter.
2006-09-30 12:02:57 +00:00
Georg Brandl a92979a1db Bug #1446043: correctly raise a LookupError if an encoding name given
to encodings.search_function() contains a dot.
2006-09-30 11:22:28 +00:00
Georg Brandl 4ddfcd3b60 Bug #1556784: allow format strings longer than 127 characters in
datetime's strftime function.
2006-09-30 11:17:34 +00:00
Georg Brandl 154324a8c3 Bug #1560617: in pyclbr, return full module name not only for classes,
but also for functions.
2006-09-30 11:06:47 +00:00
Georg Brandl 05b3c450a8 Bug #1457823: cgi.(Sv)FormContentDict's constructor now takes
keep_blank_values and strict_parsing keyword arguments.
2006-09-30 10:58:01 +00:00
Georg Brandl 8d1e5bffc1 Bug #1566602: correct failure of posixpath unittest when $HOME ends
with a slash.
2006-09-30 09:13:21 +00:00
Georg Brandl fb25773862 Bug #1566663: remove obsolete example from datetime docs. 2006-09-30 09:06:45 +00:00
Georg Brandl 3267d28f9d Bug #1566800: make sure that EnvironmentError can be called with any
number of arguments, as was the case in Python 2.4.
2006-09-30 09:03:42 +00:00
Georg Brandl 5d59c09834 Patch #1567691: super() and new.instancemethod() now don't accept
keyword arguments any more (previously they accepted them, but didn't
use them).
2006-09-30 08:43:30 +00:00
Georg Brandl 8c6674511b Bug #1565661: in webbrowser, split() the command for the default
GNOME browser in case it is a command with args.
2006-09-30 07:31:57 +00:00
Gregory P. Smith f8508cca47 wording change 2006-09-30 06:08:20 +00:00
Andrew M. Kuchling 43889c0b9f Add news item for rev. 51815 2006-09-27 16:37:30 +00:00
Brett Cannon 11b3535280 Make the error message for when the time data and format do not match clearer. 2006-09-26 23:38:24 +00:00
Georg Brandl c7986cee76 Fix a bug in traceback.format_exception_only() that led to an error
being raised when print_exc() was called without an exception set.
In version 2.4, this printed "None", restored that behavior.
2006-09-24 12:50:24 +00:00
Georg Brandl a10d3afed2 Fix a bug in the parser's future statement handling that led to "with"
not being recognized as a keyword after, e.g., this statement:
from __future__ import division, with_statement
2006-09-24 12:35:36 +00:00
Georg Brandl 2c94bf7d41 Fix webbrowser.BackgroundBrowser on Windows. 2006-09-24 10:36:01 +00:00
Neal Norwitz 3a23017bb2 Bug #1557232: fix seg fault with def f((((x)))) and def f(((x),)).
These tests should be improved.  Hopefully this fixes variations when
flipping back and forth between fpdef and fplist.

Backport candidate.
2006-09-22 08:18:10 +00:00
Neal Norwitz 4a8fbdb1b2 Fix %zd string formatting on Mac OS X so it prints negative numbers.
In addition to testing positive numbers, verify negative numbers work in configure.
In order to avoid compiler warnings on OS X 10.4, also change the order of the check
for the format character to use (PY_FORMAT_SIZE_T) in the sprintf format
for Py_ssize_t.  This patch changes PY_FORMAT_SIZE_T from "" to "l" if it wasn't
defined at configure time.  Need to verify the buildbot results.

Backport candidate (if everyone thinks this patch can't be improved).
2006-09-22 08:16:26 +00:00
Jack Diederich d10a0f7766 added itertools.count(-n) fix 2006-09-21 20:34:49 +00:00
Brett Cannon c8939d23fe Make python.vim output more deterministic. 2006-09-20 19:28:35 +00:00
Brett Cannon f6aa86e33b Allow exceptions to be directly sliced again
(e.g., ``BaseException(1,2,3)[0:2]``).

Discovered in Python 2.5.0 by Thomas Heller and reported to python-dev.  This
should be backported to 2.5 .
2006-09-20 18:43:13 +00:00
Brett Cannon 9adeab7b96 Accidentally didn't commit Misc/NEWS entry on when __unicode__() was removed
from exceptions.
2006-09-20 18:34:28 +00:00
Gregory P. Smith 2fa067982c Fixes a bug with bsddb.DB.stat where the flags and txn keyword
arguments are transposed.  (reported by Louis Zechtzer)
..already committed to release24-maint
..needs committing to release25-maint
2006-09-19 17:35:04 +00:00
Martin v. Löwis 43fd99c8f8 Patch #1557515: Add RLIMIT_SBSIZE. 2006-09-16 17:36:37 +00:00
Georg Brandl ec6c2dfb63 Forward-port of rev. 51857:
Building with HP's cc on HP-UX turned up a couple of problems.
_PyGILState_NoteThreadState was declared as static inconsistently.
Make it static as it's not necessary outside of this module.

Some tests failed because errno was reset to 0. (I think the tests
that failed were at least: test_fcntl and test_mailbox).
Ensure that errno doesn't change after a call to Py_END_ALLOW_THREADS.
This only affected debug builds.
2006-09-11 09:38:35 +00:00
Neal Norwitz bcc119a22c Forward port of 51850 from release25-maint branch.
As mentioned on python-dev, reverting patch #1504333 because it introduced
an infinite loop in rev 47154.

This patch also adds a test to prevent the regression.
2006-09-11 04:24:09 +00:00
Nick Coghlan b3c18f87e4 Add missing NEWS entry for rev 51803 2006-09-08 10:04:38 +00:00
Gustavo Niemeyer c36bede6ff Fixed subprocess bug #1531862 again, after removing tests
offending buildbot
2006-09-07 00:48:33 +00:00
Marc-André Lemburg 9614868ece Add news item for bug fix of SF bug report #1546372. 2006-09-06 20:40:22 +00:00
Georg Brandl 4e933137af Fix missing import of the types module in logging.config. 2006-09-06 20:05:58 +00:00
Neal Norwitz ca460d9722 with and as are now keywords. There are some generated files I can't recreate. 2006-09-06 06:28:06 +00:00
Georg Brandl 98775dfebc Bug #1550983: emit better error messages for erroneous relative
imports (if not in package and if beyond toplevel package).
2006-09-06 06:09:31 +00:00
Georg Brandl 74bb783c2f Bug #1551427: fix a wrong NULL pointer check in the win32 version
of os.urandom().
2006-09-06 06:03:59 +00:00
Neal Norwitz 314bef9fff Revert 51758 because it broke all the buildbots 2006-09-06 03:58:34 +00:00
Gustavo Niemeyer 8cb64eaaf3 Fixing #1531862: Do not close standard file descriptors in the
subprocess module.
2006-09-06 01:58:52 +00:00
Hye-Shik Chang 2cad3e9299 Fix a typo: 2013 -> 0213 2006-09-05 12:14:57 +00:00
Hye-Shik Chang 199f1db1fa Fix a few bugs on cjkcodecs found by Oren Tirosh:
- gbk and gb18030 codec now handle U+30FB KATAKANA MIDDLE DOT correctly.
- iso2022_jp_2 codec now encodes into G0 for KS X 1001, GB2312
  codepoints to conform the standard.
- iso2022_jp_3 and iso2022_jp_2004 codec can encode JIS X 2013:2
  codepoints now.
2006-09-05 12:07:09 +00:00
Neal Norwitz dac090d3e6 Bug #1520864 (again): unpacking singleton tuples in list comprehensions and
generator expressions (x for x, in ... ) works again.

Sigh, I only fixed for loops the first time, not list comps and genexprs too.
I couldn't find any more unpacking cases where there is a similar bug lurking.

This code should be refactored to eliminate the duplication.  I'm sure
the listcomp/genexpr code can be refactored.  I'm not sure if the for loop
can re-use any of the same code though.

Will backport to 2.5 (the only place it matters).
2006-09-05 03:53:08 +00:00
Neal Norwitz 4bc2c0919b Patch #1540470, for OpenBSD 4.0. Backport candidate for 2.[34]. 2006-09-05 02:57:01 +00:00
Neal Norwitz d34e4272e0 Add a NEWS entry for str.rpartition() change 2006-09-05 02:36:20 +00:00
Neal Norwitz 919d5cc163 This was found by Guido AFAIK on p3yk (sic) branch. 2006-09-05 02:35:08 +00:00
Neal Norwitz a22975fb35 Fix SF bug #1546288, crash in dict_equal. 2006-09-05 02:24:03 +00:00
Tim Peters c10c9d0d6b "Conceptual" merge of rev 51711 from the 2.5 branch.
i_divmod():  As discussed on Python-Dev, changed the overflow
checking to live happily with recent gcc optimizations that
assume signed integer arithmetic never overflows.

This differs from the corresponding change on the 2.5 and 2.4
branches, using a less obscure approach, but one that /may/
tickle platform idiocies in their definitions of LONG_MIN.
The 2.4 + 2.5 change avoided introducing a dependence on
LONG_MIN, at the cost of substantially goofier code.
2006-09-05 02:18:09 +00:00
Nick Coghlan bb0996ccc5 NEWS entry on trunk for decimal module changes 2006-09-03 01:20:46 +00:00
Neal Norwitz 69e8897505 Bug #1550714: fix SystemError from itertools.tee on negative value for n.
Needs backport to 2.5.1 and earlier.
2006-09-02 02:58:13 +00:00
Neal Norwitz 6aefa916a9 Bug #1548092: fix curses.tparm seg fault on invalid input. Needs backport to 2.5.1 and earlier. 2006-09-02 02:50:35 +00:00
Neal Norwitz 4f096d9487 Patch #1542451: disallow continue anywhere under a finally
I'm undecided if this should be backported to 2.5 or 2.5.1.
Armin suggested to wait (I'm of the same opinion).  Thomas W thinks
it's fine to go in 2.5.
2006-08-21 19:47:08 +00:00
Georg Brandl 8c036ccf93 Patch #1542948: fix urllib2 header casing issue. With new test. 2006-08-20 13:15:39 +00:00
Neal Norwitz 8a26706d75 SF #1542693: Remove semi-colon at end of PyImport_ImportModuleEx macro 2006-08-19 04:25:29 +00:00
Georg Brandl 648c110671 Bug #1541682: Fix example in the "Refcount details" API docs.
Additionally, remove a faulty example showing PySequence_SetItem applied
to a newly created list object and add notes that this isn't a good idea.
2006-08-18 07:27:59 +00:00
Neal Norwitz 92422fb33b Add template for 2.6 on HEAD 2006-08-18 03:57:54 +00:00
Martin v. Löwis 2eb8c4f292 Bug #1541863: uuid.uuid1 failed to generate unique identifiers
on systems with low clock resolution.
2006-08-18 03:47:18 +00:00
Neil Schemenauer 4c6b0d5bec Fix a bug in the ``compiler`` package that caused invalid code to be
generated for generator expressions.
2006-08-16 23:38:05 +00:00
Andrew M. Kuchling c13324e313 Grammar fix 2006-08-16 17:11:18 +00:00
Marc-André Lemburg 574cfea993 Add NEWS item mentioning the reverted distutils version number patch. 2006-08-16 16:11:01 +00:00
Thomas Heller b4a0cf17c4 Remove the special casing of Py_None when converting the return value
of the Python part of a callback function to C.  If it cannot be
converted, call PyErr_WriteUnraisable with the exception we got.
Before, arbitrary data has been passed to the calling C code in this
case.

(I'm not really sure the NEWS entry is understandable, but I cannot
find better words)
2006-08-16 15:10:12 +00:00
Andrew M. Kuchling f9b5b8e9f8 Wording/typo fixes 2006-08-16 14:21:14 +00:00
Thomas Heller b0aa98fd4f The __repr__ method of a NULL py_object does no longer raise an
exception.  Remove a stray '?' character from the exception text
when the value is retrieved of such an object.

Includes tests.
2006-08-16 14:07:44 +00:00
Anthony Baxter 581795902d news entry for 51307 2006-08-16 13:08:25 +00:00
Martin v. Löwis a09fd6efdd Build _hashlib on Windows. Build OpenSSL with masm assembler code.
Fixes #1535502.
2006-08-16 12:55:10 +00:00
Kurt B. Kaiser d112bc7958 Patch #1540892: site.py Quitter() class attempts to close sys.stdin
before raising SystemExit, allowing IDLE to honor quit() and exit().

M    Lib/site.py
M    Lib/idlelib/PyShell.py
M    Lib/idlelib/CREDITS.txt
M    Lib/idlelib/NEWS.txt
M    Misc/NEWS
2006-08-16 05:01:42 +00:00
Anthony Baxter b409666e8c preparing for 2.5c1 2006-08-16 03:42:26 +00:00
Neal Norwitz b476fdf7c3 Fix the test for SocketServer so it should pass on cygwin and not fail
sporadically on other platforms.  This is really a band-aid that doesn't
fix the underlying issue in SocketServer.  It's not clear if it's worth
it to fix SocketServer, however, I opened a bug to track it:

	http://python.org/sf/1540386
2006-08-15 04:58:28 +00:00