Commit Graph

2124 Commits

Author SHA1 Message Date
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
Neal Norwitz bf8c19536e Georg fixed one of my bugs, so I'll repay him with 2 NEWS entries.
Now we're even. :-)
2006-08-15 04:14:57 +00:00
Georg Brandl 7a1af770b9 Patch #1536071: trace.py should now find the full module name of a
file correctly even on Windows.
2006-08-14 21:55:28 +00:00
Georg Brandl 3335a7ad63 Patch #1535500: fix segfault in BZ2File.writelines and make sure it
raises the correct exceptions.
2006-08-14 21:42:55 +00:00
Thomas Heller 1ce433e937 News item for rev 51281. 2006-08-14 16:20:04 +00:00
Marc-André Lemburg 757ea27b0f Readd NEWS items that were accidentally removed by r51276. 2006-08-14 11:44:34 +00:00
Thomas Heller 867200483b Apply the patch #1532975 plus ideas from the patch #1533481.
ctypes instances no longer have the internal and undocumented
'_as_parameter_' attribute which was used to adapt them to foreign
function calls; this mechanism is replaced by a function pointer in
the type's stgdict.

In the 'from_param' class methods, try the _as_parameter_ attribute if
other conversions are not possible.

This makes the documented _as_parameter_ mechanism work as intended.

Change the ctypes version number to 1.0.1.
2006-08-14 11:17:48 +00:00
Marc-André Lemburg 040f76b79c Slightly revised version of patch #1538956:
Replace UnicodeDecodeErrors raised during == and !=
compares of Unicode and other objects with a new
UnicodeWarning.

All other comparisons continue to raise exceptions.
Exceptions other than UnicodeDecodeErrors are also left
untouched.
2006-08-14 10:55:19 +00:00
Neal Norwitz 56423e5762 Fix segfault when doing string formatting on subclasses of long if
__oct__, __hex__ don't return a string.

Klocwork 308
2006-08-13 18:11:08 +00:00
Neal Norwitz 1872b1c01f Fix a couple of bugs exposed by the new __index__ code. The 64-bit buildbots
were failing due to inappropriate clipping of numbers larger than 2**31
with new-style classes. (typeobject.c)  In reviewing the code for classic
classes, there were 2 problems.  Any negative value return could be returned.
Always return -1 if there was an error.  Also make the checks similar
with the new-style classes.  I believe this is correct for 32 and 64 bit
boxes, including Windows64.

Add a test of classic classes too.
2006-08-12 18:44:06 +00:00
Neal Norwitz 8a87f5d37e Patch #1538606, Patch to fix __index__() clipping.
I modified this patch some by fixing style, some error checking, and adding
XXX comments.  This patch requires review and some changes are to be expected.
I'm checking in now to get the greatest possible review and establish a
baseline for moving forward.  I don't want this to hold up release if possible.
2006-08-12 17:03:09 +00:00
Georg Brandl 0a7d1bb168 logging's atexit hook now runs even if the rest of the module has
already been cleaned up.
2006-08-11 07:26:10 +00:00
Neal Norwitz 003c9e2952 Fix the failures on cygwin (2006-08-10 fixed the actual locking issue).
The first hunk changes the colon to an ! like other Windows variants.
We need to always wait on the child so the lock gets released and
no other tests fail.  This is the try/finally in the second hunk.
2006-08-11 06:09:41 +00:00
Tim Peters 4643c2fda1 Followup to bug #1069160.
PyThreadState_SetAsyncExc():  internal correctness changes wrt
refcount safety and deadlock avoidance.  Also added a basic test
case (relying on ctypes) and repaired the docs.
2006-08-10 22:45:34 +00:00
Guido van Rossum c69ac2527d Fix title -- it's rc1, not beta3. 2006-08-10 18:09:25 +00:00
Guido van Rossum 133f4e465b News item for SF bug 1112549. 2006-08-10 17:42:50 +00:00
Martin v. Löwis ab2f8f7bd5 __hash__ may now return long int; the final hash
value is obtained by invoking hash on the long int.
Fixes #1536021.
2006-08-09 07:57:39 +00:00
Thomas Heller ab1049c046 memcmp() can return values other than -1, 0, and +1 but tp_compare
must not.
2006-08-08 17:37:00 +00:00
Andrew MacIntyre 16ee33adfc test_threading now skips testing alternate thread stack sizes on
platforms that don't support changing thread stack size.
2006-08-06 12:37:03 +00:00
Georg Brandl 7e3ba2a699 Bug #1535165: fixed a segfault in input() and raw_input() when
sys.stdin is closed.
2006-08-06 08:23:54 +00:00
Georg Brandl 9908d1656c Bug #1535182: really test the xreadlines() method of bz2 objects. 2006-08-06 07:06:33 +00:00
Georg Brandl 212b587a52 Patch #1534922: correct and enhance unittest docs. 2006-08-05 06:10:54 +00:00
Bob Ippolito e6c9f982a0 Fix #1530559, struct.pack raises TypeError where it used to convert.
Passing float arguments to struct.pack when integers are expected
now triggers a DeprecationWarning.
2006-08-04 23:59:21 +00:00
Thomas Heller db7b443d8a Fix #1534738: win32 debug version of _msi must be _msi_d.pyd, not _msi.pyd.
Fix the name of the pdb file as well.
2006-08-04 19:49:31 +00:00
Thomas Heller 1798489547 Fix #1530448 - fix ctypes build failure on solaris 10.
The '-mimpure-text' linker flag is required when linking _ctypes.so.
2006-08-04 18:57:34 +00:00
Thomas Heller 74d36f0d95 On Windows, make PyErr_Warn an exported function again. 2006-08-04 18:17:40 +00:00
Georg Brandl e9462c72bd Change fix for segfaulting property(), add a NEWS entry and a test. 2006-08-04 18:03:37 +00:00
Neil Schemenauer 06ded09d40 Fix the 'compiler' package to generate correct code for MAKE_CLOSURE.
In the 2.5 development cycle, MAKE_CLOSURE as changed to take free
variables as a tuple rather than as individual items on the stack.
Closes patch #1534084.
2006-08-04 16:20:30 +00:00
Neal Norwitz 0cbd805a10 Bug #1333982: string/number constants were inappropriately stored
in the byte code and co_consts even if they were not used, ie
immediately popped off the stack.
2006-08-04 05:09:28 +00:00
Neal Norwitz 4ffedadb10 Bug #1191458: tracing over for loops now produces a line event
on each iteration.  I'm not positive this is the best way to handle
this.  I'm also not sure that there aren't other cases where
the lnotab is generated incorrectly.  It would be great if people
that use pdb or tracing could test heavily.

Also:
 * Remove dead/duplicated code that wasn't used/necessary
   because we already handled the docstring prior to entering the loop.
 * add some debugging code into the compiler (#if 0'd out).
2006-08-04 04:58:47 +00:00
Neal Norwitz ff4b63b80f Bug #1531405, format_exception no longer raises an exception if
str(exception) raised an exception.
2006-08-04 04:50:21 +00:00
Martin v. Löwis 961b91bd3c Correction of patch #1455898: In the mbcs decoder, set final=False
for stream decoder, but final=True for the decode function.
2006-08-02 13:53:55 +00:00
Anthony Baxter 5d32a9f188 pre-release machinations 2006-08-02 07:43:09 +00:00
Neal Norwitz 9b0ca79213 Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
a socket operation on a socket with a timeout, the exception will be
caught correctly.  Previously, the exception was not caught.
2006-08-02 06:46:21 +00:00
Neal Norwitz c5e060dee6 _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t instead of long. 2006-08-02 06:14:22 +00:00
Ronald Oussoren 26cad08748 This fixes bug #1527397: PythonLauncher runs scripts with the wrong working
directory. It also fixes a bug where PythonLauncher failed to launch scripts
when the scriptname (or the path to the script) contains quotes.
2006-08-01 21:00:57 +00:00
Georg Brandl 07fec3aa5a os.urandom no longer masks unrelated exceptions like SystemExit or
KeyboardInterrupt.
2006-08-01 18:49:24 +00:00
Martin v. Löwis 0907f4dc5b Drop usage of test -e in configure as it is not portable.
Fixes #1439538
Will backport to 2.4
Also regenerate pyconfig.h.in.
2006-07-30 14:09:47 +00:00
Martin v. Löwis 77621585e4 Mention Cygwin in distutils error message about a missing VS 2003.
Fixes #1257728.
2006-07-30 13:27:31 +00:00
Martin v. Löwis 1f30c3777c Base __version__ on sys.version_info, as distutils is
no longer maintained separatedly.
2006-07-30 13:14:05 +00:00
Martin v. Löwis 4e67838d6c Don't copy directory stat times in shutil.copytree on Windows
Fixes #1525866.
2006-07-30 13:00:31 +00:00
Georg Brandl e34ac7ce7a Bug #1002398: The documentation for os.path.sameopenfile now correctly
refers to file descriptors, not file objects.
2006-07-30 11:07:23 +00:00
Neal Norwitz f71ec5a0ac Bug #1515471: string.replace() accepts character buffers again.
Pass the char* and size around rather than PyObject's.
2006-07-30 06:57:04 +00:00
Neal Norwitz 07aadb14f3 Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
This provides the proper warning for struct.pack().
PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
As mentioned by Tim Peters on python-dev.
2006-07-30 06:55:48 +00:00
Neal Norwitz 0d62a06206 Patch #1531113: Fix augmented assignment with yield expressions.
Also fix a SystemError when trying to assign to yield expressions.
2006-07-30 06:53:31 +00:00
Fred Drake fbdeaad069 expunge the xmlcore changes:
41667, 41668 - initial switch to xmlcore
  47044        - mention of xmlcore in What's New
  50687        - mention of xmlcore in the library reference

re-apply xmlcore changes to xml:
  41674        - line ending changes (re-applied manually), directory props
  41677        - add cElementTree wrapper
  41678        - PSF licensing for etree
  41812        - whitespace normalization
  42724        - fix svn:eol-style settings
  43681, 43682 - remove Python version-compatibility cruft from minidom
  46773        - fix encoding of \r\n\t in attr values in saxutils
  47269        - added XMLParser alias for cElementTree compatibility

additional tests were added in Lib/test/test_sax.py that failed with
the xmlcore changes; these relate to SF bugs #1511497, #1513611
2006-07-29 16:56:15 +00:00
Fred Drake 5391216050 update target version number 2006-07-29 13:22:49 +00:00
Georg Brandl edd9b0dfb3 Bug #1441397: The compiler module now recognizes module and function
docstrings correctly as it did in Python 2.4.
2006-07-29 09:33:26 +00:00
Thomas Heller 1393d6a4ca Patch #1529514: More openbsd platforms for ctypes.
Regenerated Modules/_ctypes/libffi/configure with autoconf 2.59.

Approved by Neal.
2006-07-28 21:43:20 +00:00
Phillip J. Eby 84b7d3a932 Fix svn merge spew. 2006-07-28 21:31:54 +00:00
Phillip J. Eby f7575d0cb7 Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
with PEP 302.  This was fixed by adding an ``imp.NullImporter`` type that is
used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
excessive filesystem operations during imports.
2006-07-28 21:12:07 +00:00
Georg Brandl 4793aa39a9 Patch #1529686: also run test_email_codecs with regrtest.py. 2006-07-28 18:31:39 +00:00
Matt Fleming ec9265094a Allow socketmodule to compile on NetBSD -current, whose bluetooth API
differs from both Linux and FreeBSD. Accepted by Neal Norwitz.
2006-07-28 11:27:27 +00:00
Gregory P. Smith 641cddf0fa - pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
methods now allow their database parameter to be None as the
  sleepycat API allows.

Also adds an appropriate test case for DBEnv.dbrename and dbremove.
2006-07-28 01:35:25 +00:00
Tim Peters 9cab593c0e News about the repaired memory leak in defaultdict. 2006-07-28 00:30:00 +00:00
Tim Peters 6f6814706e Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
lost that tests are sorted by name before being run.  ``DocTestFinder``
has been changed to sort the list of tests it returns.
2006-07-27 23:44:37 +00:00
Barry Warsaw 00decd7835 Patch #1520294: Support for getset and member descriptors in types.py,
inspect.py, and pydoc.py.  Specifically, this allows for querying the type of
an object against these built-in C types and more importantly, for getting
their docstrings printed in the interactive interpreter's help() function.

This patch includes a new built-in module called _types which provides
definitions of getset and member descriptors for use by the types.py module.
These types are exposed as types.GetSetDescriptorType and
types.MemberDescriptorType.  Query functions are provided as
inspect.isgetsetdescriptor() and inspect.ismemberdescriptor().  The
implementations of these are robust enough to work with Python implementations
other than CPython, which may not have these fundamental types.

The patch also includes documentation and test suite updates.

I commit these changes now under these guiding principles:

1. Silence is assent.  The release manager has not said "no", and of the few
   people that cared enough to respond to the thread, the worst vote was "0".

2. It's easier to ask for forgiveness than permission.

3. It's so dang easy to revert stuff in svn, that you could view this as a
   forcing function. :)

Windows build patches will follow.
2006-07-27 23:43:15 +00:00
Georg Brandl 6cea7d74ad Amend news entry. 2006-07-27 15:38:33 +00:00
Tim Peters 3e246a811d News for patch #1529686. 2006-07-27 15:09:20 +00:00
Martin v. Löwis 997ceffe07 Bump distutils version to 2.5, as several new features
have been introduced since 2.4.
2006-07-27 06:38:16 +00:00
Tim Peters bc24eee333 Bug #1521947: possible bug in mystrtol.c with recent gcc.
In general, C doesn't define anything about what happens when
an operation on a signed integral type overflows, and PyOS_strtol()
did several formally undefined things of that nature on signed
longs.  Some version of gcc apparently tries to exploit that now,
and PyOS_strtol() could fail to detect overflow then.

Tried to repair all that, although it seems at least as likely to me
that we'll get screwed by bad platform definitions for LONG_MIN
and/or LONG_MAX now.  For that reason, I don't recommend backporting
this.

Note that I have no box on which this makes a lick of difference --
can't really test it, except to note that it didn't break anything
on my boxes.

Silent change:  PyOS_strtol() used to return the hard-coded 0x7fffffff
in case of overflow.  Now it returns LONG_MAX.  They're the same only on
32-bit boxes (although C doesn't guarantee that either ...).
2006-07-27 01:14:53 +00:00
Andrew M. Kuchling 10c2b55057 Put news item in right section 2006-07-26 17:22:21 +00:00
Andrew M. Kuchling 93c928ebca Minor grammar fix 2006-07-26 17:19:39 +00:00
Andrew M. Kuchling 55b0a0eb0d [Bug #1471938] Fix build problem on Solaris 8 by conditionalizing the use of mvwgetnstr(); it was conditionalized a few lines below. Fix from Paul Eggert. I also tried out the STRICT_SYSV_CURSES case and am therefore removing the 'untested' comment. 2006-07-26 17:16:52 +00:00
Martin v. Löwis 9298eff5f9 Bug #978833: Really close underlying socket in _socketobject.close.
Fix httplib.HTTPConnection.getresponse to not close the
socket if it is still needed for the response.
2006-07-26 12:12:56 +00:00
Georg Brandl 0619a329e8 Bug #1459963: properly capitalize HTTP header names. 2006-07-26 07:40:17 +00:00
Georg Brandl cf0c1729dc NEWS entry for #1525766. 2006-07-26 07:23:32 +00:00
Ronald Oussoren 3075e16c51 Fix bug #1517990: IDLE keybindings on OSX
This adds a new key definition for OSX, which is slightly different from the
classic mac definition.

Also add NEWS item for a couple of bugfixes I added recently.
2006-07-25 20:28:55 +00:00
Brett Cannon f23ad3d65e Add comment for changes to test_ossaudiodev. 2006-07-25 17:32:20 +00:00
Martin v. Löwis 2b2d2974e7 Revert incomplete checkin. 2006-07-25 10:11:14 +00:00
Martin v. Löwis e093a3ada9 Bug #978833: Really close underlying socket in _socketobject.close.
Will backport to 2.4.
2006-07-25 10:05:47 +00:00