Commit Graph

2391 Commits

Author SHA1 Message Date
Michael W. Hudson 8e1afab111 NEWS blurb for fix of:
[ 1124295 ] Function's __name__ no longer accessible in restricted mode
2005-02-17 14:55:21 +00:00
Brett Cannon 46d9623875 spwdmodule.c should only be built when either HAVE_GETSPNAM or HAVE_GETSPENT is
defined.
2005-02-16 00:07:19 +00:00
Brett Cannon ced04e0936 Add mention of patch #1095802 (fixing "Macintosh" references to represent OS
X).
2005-02-13 22:53:22 +00:00
Brett Cannon 4380242580 Modified test for tzset to not rely on tm->tm_zone's existence. Also added
sanity checks on tzname if HAVE_TZNAME defined.

Closes bug #1096244.  Thanks Gregory Bond.
2005-02-10 20:48:03 +00:00
Raymond Hettinger bab4143348 SF patch #1116583: NameError in cookielib domain check 2005-02-05 01:31:19 +00:00
Jeremy Hylton ab630507de Add NEWS item about future parser bug. 2005-02-04 18:44:06 +00:00
Guido van Rossum d064142579 Security fix PSF-2005-001 for SimpleXMLRPCServer.py. 2005-02-03 15:01:24 +00:00
Michael W. Hudson faa7648ffe More bug #1077106 stuff, sorry -- modem induced impatiece!
This should go on whatever bugfix branches the other fetches up on.
2005-01-31 17:09:25 +00:00
Martin v. Löwis 1d11de6dbd Revert os.py 1.75, and directly implement update.
Fixes #1110478 and #1100235.
2005-01-29 13:29:23 +00:00
Martin v. Löwis 13a1fde4da Partially revert #1074011; don't try to fflush stdin.
Backported to 2.3 and 2.4.
2005-01-27 18:56:16 +00:00
Fred Drake 9c131f2879 add missing word 2005-01-23 15:16:08 +00:00
Martin v. Löwis 8e3ca8af26 Flush std{in,out,err} before closing it. Fixes #1074011.
Will backport to 2.4 and 2.3.
2005-01-23 09:41:49 +00:00
Martin v. Löwis c300175547 Patch #579435: Shadow Password Support Module 2005-01-23 09:27:24 +00:00
Martin v. Löwis 4d394dfebb Truncate st_?time before comparing it with ST_?TIME in the tests. 2005-01-23 09:19:22 +00:00
Thomas Heller d6c6e2224b distutils/command/install.py change. 2005-01-20 19:20:16 +00:00
Michael W. Hudson 46e6d92dc1 tweaks, small updates 2005-01-18 15:53:59 +00:00
Skip Montanaro 058858151d Document the reconvert module. 2005-01-16 20:48:27 +00:00
Martin v. Löwis fe33d0ba87 Default stat_float_times to true. 2005-01-16 08:57:39 +00:00
Martin v. Löwis 22b457e03b Added SEEK_* constants. Fixes #711830. 2005-01-16 08:40:58 +00:00
Andrew McNamara f69d94f6c0 Moved reader \r and \n processing from the iterator to the state machine -
this allows for better handling of newline characters in quoted fields (and
hopefully resolves Bug 967934).
2005-01-13 11:30:54 +00:00
Skip Montanaro 0af3ade6aa Add strptime() constructor to datetime class. Thanks to Josh Spoerri for
the changes.
2005-01-13 04:12:31 +00:00
Andrew McNamara 7f2053eff3 Add counting of source iterator lines to the reader object - handy for
user error messages (otherwise difficult to do without instrumenting
the source).
2005-01-12 11:17:16 +00:00
Andrew McNamara 0f0599ddc1 When quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fields
to floats.
2005-01-12 09:45:18 +00:00
Andrew McNamara c89f284df8 When using QUOTE_NONNUMERIC, we now test for "numericness" with
PyNumber_Check, rather than trying to convert to a float.  Reimplemented
writer - now raises exceptions when it sees a quotechar but neither
doublequote or escapechar are set. Doublequote results are now more
consistent (eg, single quote should generate """", rather than "",
which is ambiguous).
2005-01-12 07:44:42 +00:00
Andrew McNamara 31d8896ee2 Rename csv.set_field_limit to csv.field_size_limit (since it both sets and
gets).
2005-01-12 03:45:10 +00:00
Andrew McNamara a08eecb638 Add news about csv module updates. 2005-01-12 03:25:27 +00:00
Raymond Hettinger a422c34b70 SF 1098985: set objects cannot be marshalled 2005-01-11 03:03:27 +00:00
Skip Montanaro afd77d980e Add definitions for "up" and "down" commands that print/display the current
Python file/line when the current C execution frame is inside
PyEval_EvalFrame.  These are commented out by default because GDB sometimes
crashes as a result (seems like a GDB bug).

Add a pyframe command that displays the current Python stack frame.  If the
marked lines are uncommented, it will also cause Emacs/XEmacs to display the
current file/line.
2005-01-08 21:56:43 +00:00
Brett Cannon e6539c4401 In _DummyThread objects the lock stored in __block (allocated thanks to
_Thread.__init__) was never used.  This is a waste since locks use OS
primitives that are in limited supply.  So the lock is deleted in
_DummyThread.__init__ .

Closes bug #1089632.
2005-01-08 02:43:53 +00:00
Raymond Hettinger 97db05de3e SF #75103: imghdr -- identify JPEGs in EXIF format 2005-01-07 08:15:41 +00:00
Raymond Hettinger c34f8673a1 Teach the peephole optimizer to fold simple constant expressions. 2005-01-02 06:17:33 +00:00
Andrew M. Kuchling 3b585b30c0 [Bug #1083110] calling .flush() on decompress objects causes a segfault due to an uninitialized pointer: fixes the problem and adds a test case 2004-12-28 20:10:48 +00:00
Walter Dörwald 3673369951 Add NEWS entry about bug #1076985. 2004-12-22 12:50:50 +00:00
Sean Reifschneider 7caafe7018 Changing the idle wrapper to use Python and execvp() to pass arguments to
idle.
2004-12-21 02:22:29 +00:00
Raymond Hettinger 6065d32325 SF bug #951915: fix bug in StringIO.truncate - length not changed
(Patch by Armin Rigo.)
2004-12-20 23:51:53 +00:00
Raymond Hettinger b0900e6a21 SF #1085304: Make array.array pickle-able 2004-12-16 16:23:40 +00:00
Marc-André Lemburg bb4f1bdd8b locale.py now uses an updated locale alias table (built using
Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
alias file); the encoding lookup was enhanced to use Python's
encoding alias table

As sige-effect, this fixes SF bug [ 1080864 ] locale.py doesn't recognize
valid locale setting.
2004-12-10 21:58:14 +00:00
Raymond Hettinger 3557f42658 Combined several entries. 2004-12-07 12:02:02 +00:00
Raymond Hettinger a6b45cc31d Eliminate the deprecated option to return None instead of a tuple of arguments in __reduce__(). 2004-12-07 07:05:57 +00:00
Brett Cannon 84667c063a Change code in setup.py for parsing LDFLAGS and CPPFLAGS to use optparse
instead of getopt.  Required making use of gettext._ as optional (optparse
changed OK'ed by Greg Ward in private email).
2004-12-07 03:25:18 +00:00
Brett Cannon 516592f4ff setup.py now uses the library directories specified in LDFLAGS (``-L``
directories) and the include directories specified in CPPFLAGS (``-I``
directories) for compiling the extension modules.

This has led to the core being compiled with the values in the shell's
CPPFLAGS.  It has also removed the need for special casing to use Fink and
DarwinPorts under darwin since the needed directories can now be specified in
LDFLAGS and CPPFLAGS (e.g., DarwinPorts users can now do
``LDFLAGS=-L/opt/local/lib; CPPFLAGS=-I/opt/local/include; ./configure`` for
everything to work properly).

Parsing the values in the environment variables is done with getopt.  While optparse
would have been a nicer solution it cannot be used because of dependency issues
at execution time; optparse uses gettext which uses struct which will not have
been compiled when the code is imported.  If optparse ever makes its
importation of gettext optional by catching ImportError and setting _() to an
identity function then it can be used.
2004-12-07 00:42:59 +00:00
Raymond Hettinger c7979f16ec Removed deprecated tzparse module. 2004-12-05 11:38:18 +00:00
Raymond Hettinger b2594050ea Added optional None arguments to itertools.islice(). 2004-12-05 09:25:51 +00:00
Raymond Hettinger 3489cad30a Removed the deprecated bin parameter from the pickle module. 2004-12-05 05:20:42 +00:00
Raymond Hettinger 4ebe364277 Remove the deprecated statcache module. 2004-12-05 04:55:14 +00:00
Raymond Hettinger 1bc82f891c Removed deprecated method arguments from the shelve module. 2004-12-05 03:58:17 +00:00
Raymond Hettinger 6c92d76abc Removed deprecated method from pstats. 2004-12-05 03:28:00 +00:00
Raymond Hettinger f3fa9460de Removed deprecated use_statcache argument. 2004-12-05 01:58:09 +00:00
Raymond Hettinger 664347be94 SF bug #1078905: Docs for unittest run() methods are misleading 2004-12-04 21:21:53 +00:00
Raymond Hettinger 784ab76c87 Remove the deprecated whrandom module. 2004-12-04 10:50:51 +00:00
Raymond Hettinger 665174834a Remove PyRange_New(). 2004-12-03 11:45:13 +00:00
Raymond Hettinger f9245578c9 Acknowledge contribution of a thorough tutorial review. 2004-12-03 08:33:32 +00:00
Raymond Hettinger 3b0c7c20a1 SF patch #1077353: add key= argument to min and max
(First draft of patch contributed by Steven Bethard.)
2004-12-03 08:30:39 +00:00
Raymond Hettinger 4901a1f267 Add key= argument to heapq.nsmallest() and heapq.nlargest(). 2004-12-02 08:59:14 +00:00
Anthony Baxter 4277ed8d0a whoops! 2004-11-30 11:53:10 +00:00
Anthony Baxter e2648eeb14 doodedoodedoo on the way to 2.4 final 2004-11-30 01:28:55 +00:00
Anthony Baxter e48bad7a24 preparing for 2.4 final (wooooooo!) 2004-11-29 01:40:31 +00:00
Kurt B. Kaiser 4c79a83e0c Hye-Shik Chang's fix for Bug 875692.
Improve signal handling, especially when using threads, by forcing an early
re-execution of PyEval_EvalFrame() "periodic" code when things_to_do is not
cleared by Py_MakePendingCalls().

M Misc/NEWS
M Python/ceval.c
2004-11-23 18:06:08 +00:00
Anthony Baxter 5cc727ad7b 2.4rc1 2004-11-18 12:32:27 +00:00
Raymond Hettinger 39e92ead4b Mark PyRange_New() as deprecated. 2004-11-18 09:41:45 +00:00
Skip Montanaro 0bb2a65dbd split functionality into pystack and pystackv commands. The former will
work with core dumps because it avoids calling any Python API routines.  The
latter prints all the local variable values as well as the stack frames but
won't work with core dumps because it relies on _PyObject_Dump to print
variables.
2004-11-17 16:04:15 +00:00
Tim Peters bbc0d4409c SF bug 1065388: calendar day/month name lookup too slow
__getitem__() methods:  compute only the new spellings needed to satisfy
the given indexing object.  This is purely an optimization (it should
have no effect on visible semantics).
2004-11-13 16:18:32 +00:00
Raymond Hettinger 96b49a51d0 SF patch 1062495: Modules/zipimport.c does not compile on solaris (Contributed by Niki W. Waibel.)
Simple renaming to avoid a conflict that prevented compilation on Solaris.
2004-11-10 13:13:05 +00:00
Tim Peters 50c6bdb1d6 test_doctest.py test_pdb_set_trace_nested(): A new test from Jim Fulton
showing that doctest's pdb.set_trace() support was dramatically broken.

doctest.py _OutputRedirectingPdb.trace_dispatch():  Return a local trace
function instead of (implicitly) None.  Else interaction with pdb was
bizarre, noticing only 'call' events.  Amazingly, the existing set_trace()
tests didn't care.
2004-11-08 22:07:37 +00:00
Tim Peters fb1ffb0ebb SF bug 1061968: threads: segfault or Py_FatalError at exit
PyGILState_Ensure():  The fix in 2.4a3 for bug 1010677 reintroduced thread
shutdown race bug 225673.  Repaired by (once again) ensuring the GIL is
held whenever deleting a thread state.

Alas, there's no useful test case for this shy bug.  Four years ago, only
Guido could provoke it, on his box, and today only Armin can provoke it
on his box.  I've never been able to provoke it (but not for lack of
trying!).

This is a critical fix for 2.3.5 too, since the fix for 1010677 got
backported there already and so also reintroduced 225673.  I don't intend to
backport this fix.  For whoever (if anyone) does, there are other thread
fixes in 2.4 that need backporting too, and I bet they need to happen first
for this patch to apply cleanly.
2004-11-08 04:30:21 +00:00
Jeremy Hylton def9d2a17c Fix for SF bug 988120 via patch 1061941.
If read() returned less than the number of bytes request, the full amount was subtracted from length instead of the actually read amount.
2004-11-07 16:13:49 +00:00
Brett Cannon 7d28e96a41 Add comment about removal of CoreServices/CoreFoundation compilation against
the core on OS X (also specifically mention removal of
PyMac_GetAppletScriptFile() ).
2004-11-07 01:19:00 +00:00
Tim Peters 90cf212cef Essentially SF patch 1061679: add missing __all__ to pickletools.py.
Harmless.
2004-11-06 23:45:48 +00:00
Brett Cannon b12efd3f8a Comment cleanup. 2004-11-06 19:56:45 +00:00
Anthony Baxter b0c6630794 post-release 2004-11-04 05:23:17 +00:00
Skip Montanaro 599bd5e1e1 Fix bug 1052242. Also includes rewrite of test case using unittest and
avoiding use of popen.
2004-11-04 04:31:30 +00:00
Anthony Baxter 9f41f3a192 release shenanigans 2004-11-03 06:21:37 +00:00
Barry Warsaw 8c72eae237 SF patch #1056967, changes the semantics of Template.safe_substitute() to not
raise a ValueError for dangling delimiters (the delimiter itself is returned).
2004-11-01 03:52:43 +00:00
Tim Peters ead8b7ab30 SF 1055820: weakref callback vs gc vs threads
In cyclic gc, clear weakrefs to unreachable objects before allowing any
Python code (weakref callbacks or __del__ methods) to run.

This is a critical bugfix, affecting all versions of Python since weakrefs
were introduced.  I'll backport to 2.3.
2004-10-30 23:09:22 +00:00
Hye-Shik Chang 337614993e Patch #1044395: Allow configure option --enable-shared in FreeBSD.
(Submitted by James William Pye, Patch revised by Jiwon Seo)
2004-10-26 09:53:46 +00:00
Hye-Shik Chang 182ac85147 SF #737473: Show up-to-date source code in tracebacks always.
And add an optional argument 'filename' to linecache.checkcache()
to enable checking caches per-file.
2004-10-26 09:16:42 +00:00
Raymond Hettinger 561fbf138d SF bug #1054139: serious string hashing error in 2.4b1
_PyString_Resize() readied strings for mutation but did not invalidate
the cached hash value.
2004-10-26 01:52:37 +00:00
Raymond Hettinger 2ef7e6c8f2 SF bug #1052503: pdb runcall should accept keyword arguments 2004-10-24 00:32:24 +00:00
Raymond Hettinger 9047c8f73d SF bug #1048870: call arg of lambda not updating 2004-10-24 00:10:06 +00:00
Tim Peters acaffe65a3 Move to version 2 of the PSF license, approved by the Board earlier today. 2004-10-23 03:43:54 +00:00
Brett Cannon 06a30b087e Fix minor reST error in Misc/NEWS.
Applies patch #1051866.  Thanks Felix Wiemann.
2004-10-22 06:22:54 +00:00
Sean Reifschneider 054541e924 Latest version for beta 1. 2004-10-21 23:35:45 +00:00
Andrew M. Kuchling 66e80baea2 Add item 2004-10-20 11:56:15 +00:00
Raymond Hettinger c64aab8400 SF bug #902037: relative on-disk SYSTEM id handling is incorrect 2004-10-20 08:21:57 +00:00
Raymond Hettinger e54e726f0b SF patch #1038388: __main__ for whichdb.py
(Contributed by Oleg Broytmann.)
2004-10-20 07:17:16 +00:00
Andrew M. Kuchling 9414ded8f3 Delete empty sections in beta1 news 2004-10-19 19:56:55 +00:00
Andrew M. Kuchling 0d19bae30e Add item 2004-10-19 19:54:41 +00:00
Brett Cannon 8abcc5d533 Add support for %U and %W to contribute to calculating the date when the year
and day of the week are specified.

Closes bug #1045381.
2004-10-18 01:37:57 +00:00
Brett Cannon be8370dc9c Add sections for 2.4b2 2004-10-18 01:32:09 +00:00
Anthony Baxter 6a587c160b release shenanigans 2004-10-15 08:07:21 +00:00
Anthony Baxter a024034b94 Patch 1046644 - improved distutils support for SWIG. 2004-10-14 10:02:08 +00:00
Anthony Baxter 22dcf66f84 Patch 983206: distutils obeys LDSHARED env var. Removed the code in
Python's own setup.py that did the same thing (and tested on Solaris,
where LDSHARED is needed...)
2004-10-13 15:54:17 +00:00
Anthony Baxter e4f8a48b8f 969574 2004-10-13 14:55:56 +00:00
Andrew M. Kuchling 518d393e0e Fix PEP number 2004-10-12 15:32:10 +00:00
Fredrik Lundh 5b3687df2e Added Peter Astrand's subprocess module. 2004-10-12 15:26:28 +00:00
Barry Warsaw 418de1f23c Added note about the new usegmt argument to email.Utils.formatdate(). 2004-10-11 14:32:47 +00:00
Tim Peters 7f468f29f4 SF patch 1044089: New C API function PyEval_ThreadsInitialized(), by Nick
Coghlan, for determining whether PyEval_InitThreads() has been called.
Also purged the undocumented+unused _PyThread_Started int.
2004-10-11 02:40:51 +00:00
Tim Peters 8470558a04 PyInterpreterState_New(), PyThreadState_New(): use malloc/free directly.
This appears to finish repairs for SF bug 1041645.

This is a critical bugfix.
2004-10-10 02:47:33 +00:00
Tim Peters 263091e388 find_key(): This routine wasn't thread-correct, and accounts for the
release-build failures noted in bug 1041645.

This is a critical bugfix.  I'm not going to backport it, though (no time).
2004-10-10 01:58:44 +00:00
Andrew M. Kuchling 3afe4f371c Add helpful comment 2004-10-07 12:30:54 +00:00
Andrew M. Kuchling 6f5932502d Take out Guido's name and put in the PSF 2004-10-07 12:27:31 +00:00
Andrew M. Kuchling 895f245954 Update two URLs 2004-10-07 12:23:12 +00:00
Andrew M. Kuchling 166e625d6c Add -m to man page 2004-10-07 12:04:50 +00:00
Raymond Hettinger db29e0fe8c SF patch #1035498: -m option to run a module as a script
(Contributed by Nick Coghlan.)
2004-10-07 06:46:25 +00:00
Brett Cannon 4f35c71543 Locale data that contains regex metacharacters are now properly escaped.
Closes bug #1039270.
2004-10-06 02:11:37 +00:00
Tim Peters 130e37f3e2 Read the text files to be compared in universal-newline mode. 2004-10-03 19:03:19 +00:00
Just van Rossum dd3c83734d added plistlib news item 2004-10-03 16:27:09 +00:00
David Goodger 1cbf206d32 SF bug #997050: Document, test, & check for non-string values in ConfigParser. Moved the new string-only restriction added in rev. 1.65 to the SafeConfigParser class, leaving existing ConfigParser & RawConfigParser behavior alone, and documented the conditions under which non-string values work. 2004-10-03 15:55:09 +00:00
David Goodger 68a1abdade SF bug #1017864: ConfigParser now correctly handles default keys, processing them with ``ConfigParser.optionxform`` when supplied, consistent with the handling of config file entries and runtime-set options. 2004-10-03 15:40:25 +00:00
Barry Warsaw bb11386730 Big email 3.0 API changes, with updated unit tests and documentation.
Briefly (from the NEWS file):

- Updates for the email package:
  + All deprecated APIs that in email 2.x issued warnings have been removed:
    _encoder argument to the MIMEText constructor, Message.add_payload(),
    Utils.dump_address_pair(), Utils.decode(), Utils.encode()
  + New deprecations: Generator.__call__(), Message.get_type(),
    Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
    the Parser constructor.  These will be removed in email 3.1.
  + Support for Python earlier than 2.3 has been removed (see PEP 291).
  + All defect classes have been renamed to end in 'Defect'.
  + Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
    added to messages that claim to be multipart but really aren't.
  + Updates to documentation.
2004-10-03 03:16:19 +00:00
Raymond Hettinger 565ea5ae37 SF bug#1038917 fix typos (Contributed by George Yoshida.) 2004-10-02 11:02:59 +00:00
Tim Peters cf8997f6f8 Noted the fix to deque gc. 2004-10-01 02:13:16 +00:00
Brett Cannon bfef869510 Add note about inclusion of DarwinPorts directories in setup.py on darwin. 2004-09-28 04:08:11 +00:00
Tim Peters a80a2c8e67 Updated doctest doc news. 2004-09-26 05:13:18 +00:00
Brett Cannon 35ae3dd5aa Add warning notation about using 'bomb' setting. 2004-09-25 01:39:56 +00:00
Raymond Hettinger 596ba4d89e Granted Noam Raphael's request for minor improvements to the re module and
its documentation.

* Documented that the compiled re methods are supposed to be more full
  featured than their simpilified function counterparts.

* Documented the existing start and stop position arguments for the
  findall() and finditer() methods of compiled regular expression objects.

* Added an optional flags argument to the re.findall() and re.finditer()
  functions.  This aligns their API with that for re.search() and
  re.match().
2004-09-24 03:41:05 +00:00
Tim Peters 862f0593d8 Introduced a Py_IS_NAN macro, which probably works on the major platforms
today.  pyconfig.h can override it if not, and can also override
Py_IS_INFINITY now.  Py_IS_NAN and Py_IS_INFINITY are overridden now
for Microsoft compilers, using efficient MS-specific spellings.
2004-09-23 19:11:32 +00:00
Tim Peters 307fa78107 SF bug #513866: Float/long comparison anomaly.
When an integer is compared to a float now, the int isn't coerced to float.
This avoids spurious overflow exceptions and insane results.  This should
compute correct results, without raising spurious exceptions, in all cases
now -- although I expect that what happens when an int/long is compared to
a NaN is still a platform accident.

Note that we had potential problems here even with "short" ints, on boxes
where sizeof(long)==8.  There's #ifdef'ed code here to handle that, but
I can't test it as intended.  I tested it by changing the #ifdef to
trigger on my 32-bit box instead.

I suppose this is a bugfix candidate, but I won't backport it.  It's
long-winded (for speed) and messy (because the problem is messy).  Note
that this also depends on a previous 2.4 patch that introduced
_Py_SwappedOp[] as an extern.
2004-09-23 08:06:40 +00:00
Raymond Hettinger 2c31a058eb SF patch #1031667: Fold tuples of constants into a single constant
Example:
>>> import dis
>>> dis.dis(compile('1,2,3', '', 'eval'))
  0           0 LOAD_CONST               3 ((1, 2, 3))
              3 RETURN_VALUE
2004-09-22 18:44:21 +00:00
Raymond Hettinger 0318a939dd Clarify that iteration is over headers, not Mime elements. 2004-09-22 18:03:47 +00:00
Raymond Hettinger ce96d8b684 Bug #1030125: rfc822 __iter__ problem
Add iteration support to the Message class.
2004-09-22 17:17:32 +00:00
Brett Cannon 24a0045d58 Add a commented-out recipe on making trailing whitespace explicit.
If people think this is not too intrusive it could be uncommented.
2004-09-20 22:33:21 +00:00
Martin v. Löwis 729d47db09 Patch #1024670: Support int objects in PyLong_AsUnsignedLong[Mask]. 2004-09-20 06:17:46 +00:00
Brett Cannon 8b4e886ed9 When this file is sourced in, or used as, one's vimrc file it will set the proper settings to follow the style guidelines laid out in PEPs 7 & 8 as best it can without forcing extraneous settings.
Suggested settings are commented out and included at the end of the file.

The goal is to have this file prevent as much as possible from deviating from the style guidelines.  It is not meant to collect every cool macro possible for Python.  Any useful settings for features included with Vim can be included and commented out, but anything overly extraneous should be left out.
2004-09-19 05:43:13 +00:00
Martin v. Löwis f3c5611fef Patch #1029061: Always extract member names from the tarinfo. 2004-09-18 09:08:52 +00:00
Martin v. Löwis 39a317890f Patch #1025790: Add status code constants to httplib. 2004-09-18 09:03:49 +00:00
Tim Peters 528ca53b74 SF bug #1028306: date-datetime comparison
Treat comparing a date to a datetime like a mixed-type comparison.
2004-09-16 01:30:50 +00:00
Skip Montanaro 82d0eecf42 mention httplib ipv6 fix 2004-09-14 17:58:31 +00:00
Walter Dörwald 5011d0c683 Fix quoting. 2004-09-13 08:53:15 +00:00
Tim Peters 82076ef194 Reluctantly, rehabilitate doctest.master. 2004-09-13 00:52:51 +00:00
Andrew M. Kuchling 55be9eab38 Typo fix: 'comparisions' is not a word 2004-09-10 12:59:54 +00:00
Martin v. Löwis 23c48a12d9 Patch #808120: Add --force-arch=ARCH to bdist_rpm.py. 2004-09-10 06:32:54 +00:00
Martin v. Löwis 641d64812c Patch #808115: Add script support to bdist_rpm.py. 2004-09-10 06:25:01 +00:00
Walter Dörwald 69652035bc SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
decoding incomplete input (when the input stream is temporarily exhausted).
codecs.StreamReader now implements buffering, which enables proper
readline support for the UTF-16 decoders. codecs.StreamReader.read()
has a new argument chars which specifies the number of characters to
return. codecs.StreamReader.readline() and codecs.StreamReader.readlines()
have a new argument keepends. Trailing "\n"s will be stripped from the lines
if keepends is false. Added C APIs PyUnicode_DecodeUTF8Stateful and
PyUnicode_DecodeUTF16Stateful.
2004-09-07 20:24:22 +00:00
Jeremy Hylton 566d934745 compiler.transformer: correct lineno attribute when possible
SF patch #1015989

The basic idea of this patch is to compute lineno attributes for all AST nodes.  The actual
implementation lead to a lot of restructing and code cleanup.

The generated AST nodes now have an optional lineno argument to constructor.  Remove the
top-level asList(), since it didn't seem to serve any purpose.  Add an __iter__ to ast nodes.
Use isinstance() instead of explicit type tests.

Change transformer to use the new lineno attribute, which replaces three lines of code with one.
Use universal newlines so that we can get rid of special-case code for line endings.  Use
lookup_node() in a few more frequently called, but simple com_xxx methods().  Change string
exception to class exception.
2004-09-07 15:28:01 +00:00
Brett Cannon 2ad68e69b9 Ported test__locale to unittest. 2004-09-06 23:30:27 +00:00
Anthony Baxter f30bc11ce0 update version 2004-09-02 16:38:20 +00:00
Anthony Baxter e13943a1b0 release date 2004-09-02 16:37:15 +00:00
Andrew M. Kuchling 00873430c1 Add news item. 2004-08-31 13:50:43 +00:00
Andrew M. Kuchling 5a9618e069 Remove mpz, rotor 2004-08-31 13:43:19 +00:00
Andrew M. Kuchling 57269d0c7c Remove mpz, rotor, xreadlines modules 2004-08-31 13:37:25 +00:00
Anthony Baxter 1a4ddaecc7 SF patch #1007189, multi-line imports, for instance:
"from blah import (foo, bar
baz, bongo)"
2004-08-31 10:07:13 +00:00
Johannes Gijsbers 5ae9743ea6 Bug #1014775: update NEWS.help for changes in docutils. 2004-08-30 14:33:25 +00:00
Johannes Gijsbers 343cb8a768 Bug #1014770: apply some rest-foo and fix some docutils errors. 2004-08-30 14:27:11 +00:00
Johannes Gijsbers 4c11f6088a Patch #934356: if a module defines __all__, believe that rather than using
heuristics for filtering out imported names.
2004-08-30 14:13:04 +00:00
Johannes Gijsbers ae882f7984 Patch #941486: add os.path.lexists(). Also fix bug #940578 by using lexists in glob.glob. 2004-08-30 10:19:56 +00:00
Raymond Hettinger 356a4599ac Teach the random module about os.urandom().
* Use it for seeding when it is available.
* Provide an alternate generator based on it.
2004-08-30 06:14:31 +00:00
Tim Peters 47e52ee0c5 SF patch 936813: fast modular exponentiation
This checkin is adapted from part 2 (of 3) of Trevor Perrin's patch set.

BACKWARD INCOMPATIBILITY:  SHIFT must now be divisible by 5.  AFAIK,
nobody will care.  long_pow() could be complicated to worm around that,
if necessary.

long_pow():
  - BUGFIX:  This leaked the base and power when the power was negative
    (and so the computation delegated to float pow).
  - Instead of doing right-to-left exponentiation, do left-to-right.  This
    is more efficient for small bases, which is the common case.
  - In addition, if the exponent is large (more than FIVEARY_CUTOFF
    digits), precompute [a**i % c for i in range(32)], and go left to
    right 5 bits at a time.
l_divmod():
  - The signature changed so that callers who don't want the quotient,
    or don't want the remainder, can pass NULL in the slot they don't
    want.  This saves them from having to declare a vrbl for unwanted
    stuff, and remembering to decref it.
long_mod(), long_div(), long_classic_div():
  - Adjust to new l_divmod() signature, and simplified as a result.
2004-08-30 02:44:38 +00:00
Tim Peters 0973b99e1c SF patch 936813: fast modular exponentiation
This checkin is adapted from part 1 (of 3) of Trevor Perrin's patch set.

x_mul()
  - sped a little by optimizing the C
  - sped a lot (~2X) if it's doing a square; note that long_pow() squares
    often
k_mul()
  - more cache-friendly now if it's doing a square
KARATSUBA_CUTOFF
  - boosted; gradeschool mult is quicker now, and it may have been too low
    for many platforms anyway
KARATSUBA_SQUARE_CUTOFF
  - new
  - since x_mul is a lot faster at squaring now, the point at which
    Karatsuba pays for squaring is much higher than for general mult
2004-08-29 22:16:50 +00:00
Martin v. Löwis e064b41f5a Patch #914575: difflib side by side diff support, diff.py s/b/s HTML option. 2004-08-29 16:34:40 +00:00
Martin v. Löwis dc3883f671 Patch #934711: Expose platform-specific entropy. 2004-08-29 15:46:35 +00:00
Raymond Hettinger 6ab78cd0c0 SF feature request #992967: array.array objects should support sequences.
Made the constructor accept general iterables.
2004-08-29 07:50:43 +00:00
Brett Cannon cc8a4f6563 When building with --disable-toolbox-glue under Darwin, skip building any
Mac-specific modules.  Before all modules were compiled but would fail thanks
to a dependence on the code included when Python was built without the compiler
flag.

Closes bug #991962.
2004-08-26 01:44:07 +00:00
Dave Cole 3203efb55f Patch #1014930. Expose current parse location to XMLParser. 2004-08-26 00:37:31 +00:00
Martin v. Löwis cae9e673d6 Patch #970015: Replace - by _ in version and release. 2004-08-25 13:04:53 +00:00
Martin v. Löwis cf525241bb Patch #970019: Include version and release in the BuildRoot. 2004-08-25 13:00:34 +00:00
Martin v. Löwis 9f5c0c41ce Patch #736857, #736859: Add -e option to build_scripts. 2004-08-25 11:37:43 +00:00
Barry Warsaw 8bee76106e PEP 292 classes Template and SafeTemplate are added to the string module.
This patch includes test cases and documentation updates, as well as NEWS file
updates.

This patch also updates the sre modules so that they don't import the string
module, breaking direct circular imports.
2004-08-25 02:22:30 +00:00
Tim Peters c885443479 Stop producing or using OverflowWarning. PEP 237 thought this would
happen in 2.3, but nobody noticed it still was getting generated (the
warning was disabled by default).  OverflowWarning and
PyExc_OverflowWarning should be removed for 2.5, and left notes all over
saying so.
2004-08-25 02:14:08 +00:00
Raymond Hettinger 08158a0c65 Add Nick Coghlan for his patch solving an issue with joining string
subclasses.
2004-08-23 23:30:20 +00:00
Neal Norwitz 5268c3955a sf #1009373, #1005936. fix underscores in index entries in PDF files.
I couldn't test this, but it didn't break anything and the patch
reported fixed the problem.

Bugfix candidate.
2004-08-21 15:13:52 +00:00
Tim Peters 037b3ee44e Patch 1012740: cStringIO's truncate doesn't
truncate() left the stream position unchanged, which meant the
"truncated" data didn't go away:

>>> io.write('abc')
>>> io.truncate(0)
>>> io.write('xyz')
>>> io.getvalue()
'abcxyz'

Patch by Dima Dorfman.
2004-08-21 06:55:43 +00:00
Hye-Shik Chang 3ba5bfc766 Bug #1005737, #1007249: Fix several build problems and warnings
found on old/legacy C compilers of HP-UX, IRIX and Tru64.  (Reported
by roadkill, Richard Townsend, Maik Hertha and Minsik Kim)
2004-08-19 17:52:37 +00:00
Martin v. Löwis 336e85f56a Patch #900727: Add Py_InitializeEx to allow embedding without signals. 2004-08-19 11:31:58 +00:00
Hye-Shik Chang f64700a512 Add support for FreeBSD 6. 2004-08-18 15:13:41 +00:00
Martin v. Löwis 75b9da4aaf Patch #995126: Correct directory size, and generate GNU tarfiles by default. 2004-08-18 13:57:44 +00:00
Martin v. Löwis deacce2c87 Patch #800236: add HTTPResponse.getheaders(). 2004-08-18 12:46:26 +00:00
Johannes Gijsbers c473c99d16 Patch #1006219: let inspect.getsource show '@' decorators and add tests for
this (which are rather ugly, but it'll have to do until test_inspect gets a
major overhaul and a conversion to unittest). Thanks Simon Percivall!
2004-08-18 12:40:31 +00:00
Martin v. Löwis 318a12eb01 Patch #791776: Replace SMTPHandler.date_time with email.Utils.formatdate. 2004-08-18 12:27:40 +00:00
Martin v. Löwis fe84d17a6a Patch #764217: Add nametofont function, exists parameter. 2004-08-18 11:06:45 +00:00
Raymond Hettinger 9bb1f0592c Various alpha 3 updates. 2004-08-18 02:51:32 +00:00
Matthias Klose 2443d4ab5d - pygettext.py: Generate POT-Creation-Date header in ISO format. 2004-08-16 12:10:12 +00:00
Matthias Klose a2542bee59 The attached patch fixes FTBFS on GNU/k*BSD. The problem happens on GNU/k*BSD
because GNU/k*BSD uses gnu pth to provide pthreads, but will also happen on any
system that does the same.

python fails to build because it doesn't detect gnu pth in pthread
emulation. See C comments in patch for details.

patch taken from http://bugs.debian.org/264315
2004-08-16 11:35:51 +00:00
Matthias Klose 2e829c0214 - Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)). 2004-08-15 17:04:33 +00:00
Skip Montanaro e5069019e7 Add get_history_item and replace_history_item functions to the readline
module.  Closes patch #675551.  My apologies to Michal Vitecek for taking so
long to process this.
2004-08-15 14:32:06 +00:00
Brett Cannon add33601c2 Correct the order of application for decorators. Meant to be bottom-up and not
top-down.  Now matches the PEP.
2004-08-15 07:21:25 +00:00
Johannes Gijsbers 34c4120731 bug #989672: pdb.doc and the help messages for the help_d and help_u methods
of the pdb.Pdb class gives have been corrected. d(own) goes to a newer frame,
u(p) to an older frame, not the other way around.
2004-08-14 15:19:28 +00:00
Johannes Gijsbers 4ec40648a5 bug #990669: os.path.realpath() will resolve symlinks before normalizing the
path, as normalizing the path may alter the meaning of the path if it contains
symlinks.

Also add tests for infinite symlink loops and parent symlinks that need to be
resolved.
2004-08-14 15:01:53 +00:00
Johannes Gijsbers b112d6ed78 bug 990669: os.path.normpath may alter the meaning of a path if it contains
symbolic links. This has been documented in a comment since 1992, but is now in
the library reference as well.
2004-08-14 14:41:32 +00:00
Johannes Gijsbers 9d134b7386 bug #851123: shutil.copyfile will raise an exception when trying to copy a file
onto a link to itself. Thanks Gregory Ball.
2004-08-14 14:03:03 +00:00
Tim Peters 7c399d3e68 Removed item about an asyncore patch that got backed out. 2004-08-13 22:34:14 +00:00
Brett Cannon b3de2e13ba 'inspect' was not listing the functions in a module properly if the module was
reached through a symlink (was comparing path of module to path to function and
were not matching because of the symlink).  os.path.realpath() is now used to
solve this discrepency.

Closes bug #570300.  Thanks Johannes Gijsbers for the fix.
2004-08-13 18:46:24 +00:00
Neal Norwitz f076953eb1 SF patch #1005778, Fix seg fault if list object is modified during list.index()
Backport candidate
2004-08-13 03:18:29 +00:00
Tim Peters 79b52b7261 Boosted the stack reservation for python.exe and python_w.exe from the
default 1MB to 2 million bytes.  The test suite passes with -uall again
(test_compiler no longer drives WinXP into an insane state).
2004-08-12 18:37:10 +00:00
Michael W. Hudson 800ba2375a This is my patch:
[ 1005891 ] support --with-tsc on PPC

plus a trivial change to settscdump's docstring and a Misc/NEWS entry.
2004-08-12 18:19:17 +00:00
Michael W. Hudson 5e897959db This is my patch
[ 1004703 ] Make func_name writable

plus fixing a couple of nits in the documentation changes spotted by MvL
and a Misc/NEWS entry.
2004-08-12 18:12:44 +00:00
Michael W. Hudson 5523c2517f A NEWS entry for my last checked in change (I've gotten out of the
habit of these, sorry).
2004-08-12 18:09:00 +00:00
Dave Cole 331708b226 Patch #1003700: Add socketpair function to socket module. 2004-08-09 04:51:41 +00:00
Tim Peters 83b57355a8 Brief xrange news. 2004-08-08 07:24:22 +00:00
Tim Peters 3ddd60a83b Also deprecated the old Tester class, which is no longer used by anything
except internal tests.
2004-08-08 02:43:33 +00:00
Michael W. Hudson 8c47f4a657 eval_frame now has a PyAPI-style name 2004-08-07 20:11:22 +00:00
Jeremy Hylton 4c989ddc9c Subclasses of string can no longer be interned. The semantics of
interning were not clear here -- a subclass could be mutable, for
example -- and had bugs.  Explicitly interning a subclass of string
via intern() will raise a TypeError.  Internal operations that attempt
to intern a string subclass will have no effect.

Added a few tests to test_builtin that includes the old buggy code and
verifies that calls like PyObject_SetAttr() don't fail.  Perhaps these
tests should have gone in test_string.
2004-08-07 19:20:05 +00:00
Andrew M. Kuchling 955d00922c Add name 2004-08-07 14:17:50 +00:00
Andrew M. Kuchling b34a6bc19d Create section for 2.4a3; remove empty sections in 2.4a2 2004-08-07 14:03:33 +00:00
Andrew M. Kuchling 78d375fb86 Another typo 2004-08-07 14:00:39 +00:00
Andrew M. Kuchling 28025ecda4 Typo fix 2004-08-07 13:59:22 +00:00
Raymond Hettinger 52a21b8e65 SF patch #980695: efficient string concatenation
(Original patch by Armin Rigo).
2004-08-06 18:43:09 +00:00
Marc-André Lemburg c759f070ef Added new codecs and aliases for ISO_8859-11, ISO_8859-16 and
TIS-620.

Closes SF bug #1001895: Adding missing ISO 8859 codecs, especially Thai.
2004-08-05 12:43:30 +00:00
Anthony Baxter ff347cadc4 release date 2004-08-05 07:21:01 +00:00
Tim Peters 8485b56216 Edward Loper's cool and massive refactoring of doctest.py, merged from
the tim-doctest-merge-24a2 tag on the the tim-doctest-branch branch.
We did development on the branch in case it wouldn't land in time for
2.4a2, but the branch looked good:  Edward's tests passed there, ditto
Python's tests, and ditto the Zope3 tests.  Together, those hit doctest
heavily.
2004-08-04 18:46:34 +00:00
Hye-Shik Chang c81c695dc9 Add a proper pointer to SF bug item. 2004-08-04 17:40:38 +00:00
Hye-Shik Chang 7df44b384a SF #941229: Decode source code with sys.stdin.encoding in interactive
modes like non-interactive modes.  This allows for non-latin-1 users
to write unicode strings directly and sets Japanese users free from
weird manual escaping <wink> in shift_jis environments.
(Reviewed by Martin v. Loewis)
2004-08-04 17:36:41 +00:00
Hye-Shik Chang e9ddfbb412 SF #989185: Drop unicode.iswide() and unicode.width() and add
unicodedata.east_asian_width().  You can still implement your own
simple width() function using it like this:
    def width(u):
        w = 0
        for c in unicodedata.normalize('NFC', u):
            cwidth = unicodedata.east_asian_width(c)
            if cwidth in ('W', 'F'): w += 2
            else: w += 1
        return w
2004-08-04 07:38:35 +00:00
Hye-Shik Chang b5047fd019 Add a workaround for a problem that UTF-8 strings can be corrupted
or broken by basic ctype functions in 4.4BSD descendants.  This
will be fixed in their future development branches but they'll keep
the POSIX-incompatibility for their backward-compatiblities in near
future.
2004-08-04 06:33:51 +00:00
Martin v. Löwis 1fa649f2d5 Patch #986929: Add support for wish -sync and -use options. 2004-08-03 18:45:31 +00:00
Fred Drake f901abdd62 allow ctime(), gmtime(), and localtime() to take None as equivalent to an omitted arg
(closes SF bug #658254, patch #663482)
2004-08-03 17:58:55 +00:00
Martin v. Löwis 9513e34ac4 Patch #823072: add option to NOT use ~/.netrc in nntplib.NNTP(). 2004-08-03 14:36:32 +00:00
Martin v. Löwis 65a7975f16 Patch #994595: Recognize Basic auth even if other schemes are offered.
Will backport to 2.3.
2004-08-03 12:59:55 +00:00
Raymond Hettinger 66bd233225 Completed the patch for Bug #215126.
* Fixes an incorrect variable in a PyDict_CheckExact.
* Allow general mapping locals arguments for the execfile() function
  and exec statement.
* Add tests.
2004-08-02 08:30:07 +00:00
Anthony Baxter 32083f64a7 notes for @decorator 2004-08-02 06:24:59 +00:00
Tim Peters 94f9b86930 "Core" and "C API" news about new semantics for failing imports. 2004-08-02 03:48:03 +00:00
Neal Norwitz 0e67fd478f Fix SF #1001053, wave.open() with unicode filename fails
Backport candidate.
2004-08-01 22:48:06 +00:00
Greg Ward 9c8fe1a9b5 Mention upgrade of optparse to Optik 1.5a1. 2004-07-31 16:16:11 +00:00
Neal Norwitz 014f103705 SF bug #999776, zlib home page wrong
Backport candidate.
2004-07-29 03:55:56 +00:00
Marc-André Lemburg 17b6d28c64 New codec: [ 996067 ] hp-roman8 codec 2004-07-28 15:37:54 +00:00
Tim Peters 5cfb05eef0 Added a new fileno() method. ZODB's repozo.py wants this so it can
apply os.fsync() to the GzipFile backup files it creates.
2004-07-27 21:02:02 +00:00
Martin v. Löwis 544f1195b1 Patch #995766: Keyword argument support in cPickle. 2004-07-27 05:22:33 +00:00
Martin v. Löwis 7b9190b8fc Patch #998149: imaplib deleteacl and myrights. 2004-07-27 05:07:19 +00:00
Martin v. Löwis cc0f93233a Patch #605370: Add description[s] for RFC 2980 compliance. 2004-07-26 12:40:50 +00:00
Tim Peters 66bb6e661c SF bug 996392: math and cmath docs don't specify radians
Major rewrite of the math module docs.  Slapped in "radians" where
appropriate; grouped the functions into reasonable categories; supplied
many more words to address common confusions about some of the subtler
issues.
2004-07-24 23:00:24 +00:00
Marc-André Lemburg b314ce91d3 Add news item for u'%s' change. 2004-07-23 16:14:57 +00:00
Gustavo Niemeyer 7bd33c5e22 This change implements the following gettext features, as
discussed recently in python-dev:

In _locale module:

- bind_textdomain_codeset() binding

In gettext module:

- bind_textdomain_codeset() function
- lgettext(), lngettext(), ldgettext(), ldngettext(),
  which return translated strings encoded in
  preferred system encoding, if
  bind_textdomain_codeset() was not used.
- Added equivalent functionality in translate()
  function and catalog classes.

Every change was also documented.
2004-07-22 18:44:01 +00:00
Tim Peters aa1c7ff7e8 SF patch 995225: tarfile.py fix for bug #990325
Removes CVS keywords from this binary file, so that test_tarfile passes
regardless of whether Python is checked out with -kk.
2004-07-22 00:54:37 +00:00
Brett Cannon 8b3d92a977 Fix bug where a KeyError was raised if -O was being used for the interpreter
and Thread.__delete() was called after a Thread instance was created.  Problem
resulted from a currentThread() call in an 'assert' statement being optimized
out and dummy_thread.get_ident() always returning -1 and thus overwriting the
entry for the _MainThread() instance created in 'threading' at import time.

Closes bug #993394.
2004-07-21 02:21:58 +00:00
Neal Norwitz a4f651a2ae SF #857297 and 916874, improve handling of hard links when extracting 2004-07-20 22:07:44 +00:00
Neal Norwitz 0662f8a5ea SF #846659, fix bufsize violation and GNU longname/longlink extensions 2004-07-20 21:54:18 +00:00
Neil Schemenauer 3a313e3655 Check the type of values returned by __int__, __float__, __long__,
__oct__, and __hex__.  Raise TypeError if an invalid type is
returned.  Note that PyNumber_Int and PyNumber_Long can still
return ints or longs.  Fixes SF bug #966618.
2004-07-19 16:29:17 +00:00
Neil Schemenauer 66edb6295f Don't return spurious empty fields if 'keep_empty_values' is True.
Fixes SF bug #990307.
2004-07-19 15:38:11 +00:00
Tim Peters 90ee7eb18e Record that FCNTL.py has gone away; remove FCNTL hack in tempfile.py;
another hack remains in test___all__.py, but the problem that one
addresses is more general than *just* FCNTL, so leaving it alone.
2004-07-18 23:58:17 +00:00
Tim Peters 182b5aca27 Whitespace normalization, via reindent.py. 2004-07-18 06:16:08 +00:00
Hye-Shik Chang 2bb146f2f4 Bring CJKCodecs 1.1 into trunk. This completely reorganizes source
and installed layouts to make maintenance simple and easy.  And it
also adds four new codecs; big5hkscs, euc-jis-2004, shift-jis-2004
and iso2022-jp-2004.
2004-07-18 03:06:29 +00:00
Raymond Hettinger 76d962d700 Treat None as a constant. 2004-07-16 12:16:48 +00:00
Jim Fulton e827437f45 Summarized changes: threading.local, Py_CLEAR, Py_VISIT, improved type
tutorial.
2004-07-14 19:08:28 +00:00
Anthony Baxter fd4984d1fc install test/decimaltestdata as well 2004-07-12 09:33:39 +00:00
Tim Peters 5af0e41482 Bug #788520: Queue class has logic error when non-blocking
I don't agree it had a bug (see the report), so this is *not* a candidate
for backporting, but the docs were confusing and the Queue implementation
was old enough to vote.

Rewrote put/put_nowait/get/get_nowait from scratch, to use a pair of
Conditions (not_full and not_empty), sharing a common mutex.  The code
is 1/4 the size now, and 6.25x easier to understand.  For blocking
with timeout, we also get to reuse (indirectly) the tedious timeout
code from threading.Condition.  The Full and Empty exceptions raised
by non-blocking calls are now easy (instead of nearly impossible) to
explain truthfully:  Full is raised if and only if the Queue truly
is full when the non-blocking put call checks the queue size, and
similarly for Empty versus non-blocking get.

What I don't know is whether the new implementation is slower (or
faster) than the old one.  I don't really care.  Anyone who cares
a lot is encouraged to check that.
2004-07-12 00:45:14 +00:00
Tim Peters 183dabcd73 SF patch 986010: add missing doc for datetime C API, from
Anthony Tuininga.

This is a derived patch, taking the opportunity to add some organization
to the now-large pile of datetime-related macros, and to factor out
tedious repeated text.

Also improved some clumsy wording in NEWS.
2004-07-11 19:26:19 +00:00
Brett Cannon d2c5b4b549 SequenceMatcher(None, [], []).get_grouped_opcodes() now returns a generator
that behaves as if both lists has an empty string in each of them.

Closes bug #979794 (and duplicate bug #980117).
2004-07-10 23:54:07 +00:00
Brett Cannon e6f8a89d1a Debug output is now printed to sys.stderr .
Closes bug #980938.
2004-07-10 23:14:30 +00:00
Brett Cannon f50299c378 posixpath.realpath() now detects symlink loops and returns the path just before
the loop starts.

Closes bug #930024.  Thanks AM Kuchling.
2004-07-10 22:55:15 +00:00
Brett Cannon 711e7d97e4 Add PyArg_VaParseTupleAndKeywords(). Document this function and
PyArg_VaParse().

Closes patch #550732.  Thanks Greg Chapman.
2004-07-10 22:20:32 +00:00
Andrew M. Kuchling 79d7e92a5c Add item 2004-07-10 21:21:55 +00:00
Brett Cannon bdc36273a2 Make ntpath compress multiple slashes between drive letter and the rest of the
path.  Also clarifies UNC handling and adds appropriate tests.

Applies patch #988607 to fix bug #980327.  Thanks Paul Moore.
2004-07-10 20:42:22 +00:00
Brett Cannon e67511809b Add note about closing of bug #679953 and add Jimmy Burgett for helping out to
Misc/ACKS.
2004-07-10 19:13:42 +00:00
Andrew M. Kuchling 64ed298d7a Add an item 2004-07-10 18:43:32 +00:00
Marc-André Lemburg 88fcca6815 Added note about new codecs module APIs. 2004-07-10 16:16:06 +00:00
Raymond Hettinger 21f9fce968 Fix typo. 2004-07-10 16:11:03 +00:00
Raymond Hettinger 5aa478badf Module and tests:
* Map conditions to related signals.
* Make contexts unhashable.
* Eliminate used "default" attribute in exception definitions.
* Eliminate the _filterfunc in favor of a straight list.

Docs:
* Eliminate documented references to conditions that are not signals.
* Eliminate parenthetical notes such as "1/0 --> Inf" which are no
  longer true with the new defaults.
2004-07-09 10:02:53 +00:00
Anthony Baxter 563e449729 post-release fun 2004-07-09 07:30:10 +00:00
Anthony Baxter 275ce74f23 2.4a1 2004-07-08 06:01:42 +00:00
Anthony Baxter 3210b36a28 release dates 2004-07-08 05:59:43 +00:00
Michael W. Hudson 30ea2f223f This closes patch:
[ 960406 ] unblock signals in threads

although the changes do not correspond exactly to any patch attached to
that report.

Non-main threads no longer have all signals masked.

A different interface to readline is used.

The handling of signals inside calls to PyOS_Readline is now rather
different.

These changes are all a bit scary!  Review and cross-platform testing
much appreciated.
2004-07-07 17:44:12 +00:00
Tim Peters b8b20e22bc Made the explanation more accurate; trimmed trailing whitespace; fixed
a typo.
2004-07-07 02:46:03 +00:00
Guido van Rossum 5124b4a082 Add msg for bug #981530 (shutil.rmtree). Somehow that got missed in
the checkin.
2004-07-06 17:52:32 +00:00
Andrew M. Kuchling 81e3fb4b3a Typo fixes 2004-07-04 15:41:59 +00:00
Brett Cannon 41d13f61d2 Clarify last added comment (bug #754449). 2004-07-03 03:54:54 +00:00
Brett Cannon cc4e935ea5 threading.Thread objects will now print a traceback for an exception raised
during interpreter shutdown instead of masking it with another traceback about
accessing a NoneType when trying to print the exception out in the first place.

Closes bug #754449 (using patch #954922).
2004-07-03 03:52:35 +00:00
Fred Drake 0a4dd390bf Make weak references subclassable:
- weakref.ref and weakref.ReferenceType will become aliases for each
  other

- weakref.ref will be a modern, new-style class with proper __new__
  and __init__ methods

- weakref.WeakValueDictionary will have a lighter memory footprint,
  using a new weakref.ref subclass to associate the key with the
  value, allowing us to have only a single object of overhead for each
  dictionary entry (currently, there are 3 objects of overhead per
  entry: a weakref to the value, a weakref to the dictionary, and a
  function object used as a weakref callback; the weakref to the
  dictionary could be avoided without this change)

- a new macro, PyWeakref_CheckRefExact(), will be added

- PyWeakref_CheckRef() will check for subclasses of weakref.ref

This closes SF patch #983019.
2004-07-02 18:57:45 +00:00
Thomas Heller 04c673b6e2 SF #951851 fixed. 2004-07-02 08:56:20 +00:00
Raymond Hettinger 214b1c3aae SF Bug #215126: Over restricted type checking on eval() function
The builtin eval() function now accepts any mapping for the locals argument.
Time sensitive steps guarded by PyDict_CheckExact() to keep from slowing
down the normal case.  My timings so no measurable impact.
2004-07-02 06:41:07 +00:00
Raymond Hettinger 7c85fa4a52 Move Decimal from the sandbox into production. 2004-07-01 11:01:35 +00:00
Michael W. Hudson 7db865af40 tyop 2004-06-30 09:09:38 +00:00
Michael W. Hudson c30ba849cf restore NEWS entry for 957240 2004-06-30 09:06:29 +00:00
Andrew M. Kuchling 93b4b88e96 [Patch #974633] Check PyObject_MALLOC return for error 2004-06-29 14:03:04 +00:00
Brett Cannon 46d4ff2b72 Fix stupid mistake of forgetting to mention that the fix for bug #981299
entailed editing the urlparse module.
2004-06-29 04:08:23 +00:00
Brett Cannon fbac294d59 rsync is now a recognized protocol that uses "netloc" (i.e. specifies a network
location) in its addressing.

Closes bug #981299.
2004-06-29 04:02:40 +00:00
Barry Warsaw 11b91a0ea3 Added socket.getservbyport(), and make its second argument and that of
getservbyname() optional.  Update the tests and the docs.
2004-06-28 00:50:43 +00:00
Martin v. Löwis ef82d2fdfe Patch #923098: Share interned strings in marshal. 2004-06-27 16:51:46 +00:00
Brett Cannon f6af76da61 Modules/getpath.c now compiles properly under OS X when using the
--disable-framework build; header file was protected in an #if using the wrong
macro to check.

Closes bug #978645.
2004-06-26 04:03:06 +00:00
Fred Drake ec6229e352 Make distutils "install --home" support all platforms. 2004-06-25 23:02:59 +00:00
Raymond Hettinger 70b3a1ab0a Fix leak found by Eric Huss. 2004-06-25 22:20:33 +00:00
Tim Peters 9ddf40b4e1 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
The LaTeX is untested (well, so is the new API, for that matter).
Note that I also changed NULL to get spelled consistently in concrete.tex.
If that was a wrong thing to do, Fred should yell at me.
2004-06-20 22:41:32 +00:00
Tim Peters 1b6f7a9057 Bug 975996: Add _PyTime_DoubleToTimet to C API
New include file timefuncs.h exports private API function
_PyTime_DoubleToTimet() from timemodule.c.  timemodule should export
some other functions too (look for painful bits in datetimemodule.c).

Added insane-argument checking to datetime's assorted fromtimestamp()
and utcfromtimestamp() methods.  Added insane-argument tests of these
to test_datetime, and insane-argument tests for ctime(), localtime()
and gmtime() to test_time.
2004-06-20 02:50:16 +00:00
Brett Cannon 1c3fa18be7 shutil.move() will raise an exception when trying to move a directory into
itself.

Closes bug #919012  .  Thanks Johannes Gijsbers.
2004-06-19 21:11:35 +00:00
Brett Cannon b46ed71d70 Add news item about raising ValueError when timemodule.c code that uses
timestamps will lose precision thanks to time_t < double (bug #919012).
2004-06-19 20:50:47 +00:00
Brett Cannon c6c1f478d9 pydoc.stripid() is now case-insensitive for its regex to support platforms that
have pointer addresses in uppercase.

Closes bug #934282.  Thanks Robin Becker.
2004-06-19 01:02:51 +00:00
Skip Montanaro 56f6a4f225 allow developers to more easily build a profiling version of the interpreter
and modules by configuring with the --enable-profiling flag.
2004-06-18 02:47:22 +00:00
Raymond Hettinger b67ad7e671 Patch #826074: cmath.log optional base argument, fixes #823209
(Contributed by Andrew Gaul.)
2004-06-14 07:40:10 +00:00
Martin v. Löwis ad21945d03 Back out #957240. 2004-06-14 04:58:42 +00:00
Anthony Baxter c982bbde1c Bug 957381: rpmbuild builds a -debuginfo rpm on recent Redhat and Fedora releases.
Ignore it, rather than breaking.

Will backport.

(and r1.1000 for Misc/NEWS!)
2004-06-11 17:16:46 +00:00
Anthony Baxter 3ecdb250af Fix for bug #966623 - classes created with type() in an exec(, {}) don't
have a __module__. Test for this case.

Bugfix candidate, will backport.
2004-06-11 14:41:18 +00:00
Raymond Hettinger 57c2d930f6 Add a final permutation step to the tuple hash function.
Prevents a collision pattern that occurs with nested tuples.
(Yitz Gale provided code that repeatably demonstrated the weakness.)
2004-06-10 18:42:15 +00:00
Raymond Hettinger 33ecffb65a SF patch #969791: Add nlargest() and nsmallest() to heapq. 2004-06-10 05:03:17 +00:00
Martin v. Löwis 737ea82a5a Patch #774665: Make Python LC_NUMERIC agnostic. 2004-06-08 18:52:54 +00:00
Martin v. Löwis bdec50f027 Feature request #935915: Add os.path.devnull. 2004-06-08 08:29:33 +00:00
Martin v. Löwis f30d60edbc Patch #510695: Add TSC profiling for the VM. 2004-06-08 08:17:44 +00:00
Tim Peters 604c013ef2 SF 952807: Unpickling pickled instances of subclasses of datetime.date,
datetime.datetime and datetime.time could yield insane objects.  Thanks
to Jiwon Seo for the fix.

Bugfix candidate.  I'll backport it to 2.3.
2004-06-07 23:04:33 +00:00
Thomas Heller 90a764c5ee Fix a refcount bug in an obscure code corner. 2004-06-07 15:12:44 +00:00
Neal Norwitz c3cd9df95a Add some doc about using valgrind 2004-06-06 19:58:40 +00:00
Hye-Shik Chang 2400e93057 SF #877165: Give an info about what C++ compiler command should be
used in cygwin and mingw32. (Reported by Michael Droettboom)
2004-06-05 18:37:53 +00:00
Hye-Shik Chang 39aef79821 Fix a bug that robotparser starves memory when the server responses
in HTTP/0.9 due to dissonance of httplib.LineAndFileWrapper and
urllib.addbase.
2004-06-05 13:30:56 +00:00
Brett Cannon 0096e262ff Refactored site.py into functions. Also moved over to using sets.
New regression test suite.
2004-06-05 01:12:51 +00:00
Martin v. Löwis 642c8a11fd Patch #926209: Patch to setup.py to run on x86_64 Linux. 2004-06-04 13:55:13 +00:00
Martin v. Löwis 77ca6c4c84 Warn abou missing mutate flag to ioctl. Fixes #696535. 2004-06-03 12:47:26 +00:00
Hye-Shik Chang bc555e386b Fix the grammar a bit more. (Adjusted by Tony Meyer) 2004-06-03 11:10:58 +00:00
Martin v. Löwis eac324b90b Patch #957240: Add count parameter to asyncore.loop. 2004-06-03 09:18:35 +00:00
Martin v. Löwis 3e501dcfc7 One more attempt to fix the grammar. 2004-06-03 04:03:30 +00:00
Andrew M. Kuchling f7e836e6dd Don't build the pcre module any more 2004-06-02 17:42:56 +00:00
Hye-Shik Chang 5629d0e616 Fix grammar hopefully. :) 2004-06-02 16:52:49 +00:00
Hye-Shik Chang 974ed7cfa5 - SF #962502: Add two more methods for unicode type; width() and
iswide() for east asian width manipulation. (Inspired by David
Goodger, Reviewed by Martin v. Loewis)
- Move _PyUnicode_TypeRecord.flags to the end of the struct so that
no padding is added for UCS-4 builds. (Suggested by Martin v. Loewis)
2004-06-02 16:49:17 +00:00
Andrew M. Kuchling b6568b91fd Add a name (old change sitting in my tree) 2004-06-02 15:37:04 +00:00
Martin v. Löwis d8948725d2 Patch #954115: Fix os.stat handling of UNC roots.
Will backport to 2.3.
2004-06-02 09:57:56 +00:00
Martin v. Löwis e440e47e91 Patch #957398: Add public API for Generator Object/Type. 2004-06-01 15:22:42 +00:00
Raymond Hettinger 41bd02256f SF bug #942952: Weakness in tuple hash
(Basic approach and test concept by Tim Peters.)

* Improved the hash to reduce collisions.
* Added the torture test to the test suite.
2004-06-01 06:36:24 +00:00
Martin v. Löwis 173ecb6094 Copy from python-2.3.spec. Incorporate patch #961465:
Including changes from Ian Holsman to build under Red Hat 7.3.
Fixing some problems with the /usr/local path change.
2004-05-31 19:40:57 +00:00
Tim Peters 2f50e90818 SF patch 959726: sdist versus SVN
The disutils sdist command now ignores .svn directories.
2004-05-31 19:27:59 +00:00
Martin v. Löwis 2a6ba9097e Patch #963318: Add support for client-side cookie management. 2004-05-31 18:22:40 +00:00
Raymond Hettinger 027bb633b6 Add weakref support to sockets and re pattern objects. 2004-05-31 03:09:25 +00:00
Skip Montanaro 79cddc56b3 stupid, stupid, stupid... raw_input() already supports readline() if the
readline module is loaded.
2004-05-24 14:20:16 +00:00
Skip Montanaro 0dc23101a0 Exposed readline() function from the readline module. 2004-05-23 17:46:50 +00:00
Raymond Hettinger 059e170c1d SF bug #949329: sets.Set() --> set() 2004-05-19 19:56:44 +00:00
Raymond Hettinger 354433a59d SF patch #872326: Generator expression implementation
(Code contributed by Jiwon Seo.)

The documentation portion of the patch is being re-worked and will be
checked-in soon.  Likewise, PEP 289 will be updated to reflect Guido's
rationale for the design decisions on binding behavior (as described in
in his patch comments and in discussions on python-dev).

The test file, test_genexps.py, is written in doctest format and is
meant to exercise all aspects of the the patch.  Further additions are
welcome from everyone.  Please stress test this new feature as much as
possible before the alpha release.
2004-05-19 08:20:33 +00:00
Skip Montanaro beddfcb6d0 date typo in %changelog 2004-05-17 13:17:38 +00:00
Thomas Heller 2e7c8328ae Fix SF item #876278: Unbounded recursion in modulefinder.
Already backported to release23-maint.
2004-05-11 15:10:59 +00:00
Martin v. Löwis 456ab1d271 Swap public and system ID in start_doctype_decl. Fixes #780300. 2004-05-06 01:54:36 +00:00
Raymond Hettinger 0468e416c1 SF patch #947476: Apply freelist technique to lists
Re-use list object bodies.  Saves calls to malloc() and free() for
faster list instantiation and deallocation.
2004-05-05 05:37:53 +00:00
Thomas Heller cc10a85fdc Forgot to mention the SF number, and that Bob Ippolito provided the patch. 2004-04-22 17:28:25 +00:00
Thomas Heller 1328b52c6f Two new public API functions, Py_IncRef and Py_DecRef. Useful for
dynamic embedders of Python.
2004-04-22 17:23:49 +00:00
Hye-Shik Chang 0f5bf1ebdd SF #926075: Fixed the bug that returns a wrong pattern object for
a string or unicode object in sre.compile() when a different type
pattern with the same value exists.
2004-04-20 21:11:11 +00:00
Hye-Shik Chang 54f9439b7c Bug #934635: Fix a bug where the configure script couldn't detect
getaddrinfo() properly if the KAME stack had SCTP support.
(Submitted by SUZUKI Shinsuke)
2004-04-14 07:55:31 +00:00
Skip Montanaro d0c0c41fe9 note --trackcalls flag in trace module 2004-04-07 16:03:02 +00:00
Raymond Hettinger e2eda606a8 Improve accuracy of sequence and mapping checks. 2004-04-04 08:51:41 +00:00
Andrew MacIntyre 4e10ed3b86 If a file is opened with an explicit buffer size >= 1, repeated
close() calls would attempt to free() the buffer already free()ed on
the first close().     [bug introduced with patch #788249]

Making sure that the buffer is free()ed in file object deallocation is
a belt-n-braces bit of insurance against a memory leak.
2004-04-04 07:01:35 +00:00
Skip Montanaro 7a92d74c52 It would help if I deleted the old pystack!
Also, move pystack comment down next to it
2004-04-02 14:53:55 +00:00
Skip Montanaro 74d07f2bfa include local variables when dumping Python stack trace 2004-04-02 14:51:13 +00:00
Martin v. Löwis fb66cd2540 Patch #924497: find(1) all files with /usr/local/bin/python in them.
Backported to 2.3.
2004-03-31 18:59:04 +00:00
Brett Cannon 21beb4c2ce Fixed a caching bug in platform.platform() where the argument of 'terse' was
not taken into consideration when caching value.
2004-03-25 16:55:12 +00:00
Nicholas Bastin c69ebe8d50 Enable the profiling of C functions (builtins and extensions) 2004-03-24 21:57:10 +00:00
Nicholas Bastin c723a14bfb ...for work done at PyCon 2004 (and beyond...) 2004-03-23 23:29:01 +00:00
Brett Cannon 06c34798df Make socket.sslerror a subclass of socket.error .
Added socket.error to the socket module's C API.
2004-03-23 23:16:54 +00:00
Nicholas Bastin 824b1b2da8 Added command line options for profile.py - one for stats output file
and one for sort order when using stdout.  Uses optparse.
2004-03-23 18:44:39 +00:00
Nicholas Bastin 1eb4bfc657 Added global runctx function to profile to fix SF Bug #716587 2004-03-22 20:12:56 +00:00
Nicholas Bastin abce8a681c Changed file.name to be the object passed as the 'name' argument to file()
Fixes SF Bug #773356
2004-03-21 20:24:07 +00:00
Hye-Shik Chang c3a87b8dbb Bug #920575: Add a workaround for GNU libc nl_langinfo()'s returning NULL.
(Reported by Matthias Klose)
2004-03-21 19:34:30 +00:00
Andrew M. Kuchling e240d9bcc5 Update URLs 2004-03-21 18:48:22 +00:00
Nicholas Bastin a7604bf1b4 Moved tracebackobject to traceback.h, Closes SF Bug #497067 2004-03-21 18:37:23 +00:00
Just van Rossum 7139afd1f5 [693255] also back out corresponding NEWS item... 2004-03-21 16:26:32 +00:00
Martin v. Löwis 347c30d217 Patch #853488: Tix hlist missing entryconfigure and entrycget methods. 2004-03-21 15:29:41 +00:00
Raymond Hettinger ff5bc50bb0 Improve byte coding for multiple assignments.
Gives 30% speedup on "a,b=1,2" and 25% on "a,b,c=1,2,3".
2004-03-21 15:12:00 +00:00
Brett Cannon 4f65331483 Limit the nesting depth of a tuple passed as the second argument to
isinstance() or issubclass() to the recursion limit of the interpreter.
2004-03-20 22:52:14 +00:00
Brett Cannon cc45466b8f Remove non-existent paths. 2004-03-20 21:31:33 +00:00
Hye-Shik Chang 4a7ad1a27d Add an entry for addition of the ptcp154 codec. 2004-03-19 08:11:56 +00:00
Raymond Hettinger ade08ea8a8 Add news entries for the dictionary optimizations. 2004-03-18 09:48:12 +00:00
Raymond Hettinger 49f9bd15ff SF feature request #686323: Minor array module enhancements
array.extend() now accepts iterable arguments implements as a series
of appends.  Besides being a user convenience and matching the behavior
for lists, this the saves memory and cycles that would be used to
create a temporary array object.
2004-03-14 05:43:59 +00:00
Raymond Hettinger 6e2ee866fa Update the array overallocation scheme to match the approach used for
lists.  Speeds append() operations and reduces memory requirements
(because of more conservative overallocation).

Paves the way for the feature request for array.extend() to support
arbitrary iterable arguments.
2004-03-14 04:37:50 +00:00
Raymond Hettinger 2d95f1ad57 SF patch #911431: robot.txt must be robots.txt
(Contributed by George Yoshida.)
2004-03-13 20:27:23 +00:00
Raymond Hettinger 3aa82c07f7 SF bug #910986: copy.copy fails for array.array
Added support for the copy module.
2004-03-13 18:18:51 +00:00
Raymond Hettinger c1e4f9dd92 Use a new macro, PySequence_Fast_ITEMS to factor out code common to
three recent optimizations.  Aside from reducing code volume, it
increases readability.
2004-03-12 08:04:00 +00:00
Neil Schemenauer 4252a7a5d1 Make buffer objects based on mutable objects (like array) safe. 2004-03-11 02:42:45 +00:00
Raymond Hettinger 3e47f65e28 SF patch #907403: Improvements to cStringIO.writelines()
The writelines() method now accepts any iterable argument and writes
the lines one at a time rather than using ''.join(lines) followed by
a single write.  Results in considerable memory savings and makes the
method suitable for use with generator expressions.
2004-03-08 18:22:35 +00:00
Raymond Hettinger dd80f76265 SF patch #910929: Optimize list comprehensions
Add a new opcode, LIST_APPEND, and apply it to the code generation for
list comprehensions.  Reduces the per-loop overhead by about a third.
2004-03-07 07:31:06 +00:00
Raymond Hettinger 31017aed36 SF #904720: dict.update should take a 2-tuple sequence like dict.__init_
(Championed by Bob Ippolito.)

The update() method for mappings now accepts all the same argument forms
as the dict() constructor.  This includes item lists and/or keyword
arguments.
2004-03-04 08:25:44 +00:00
Skip Montanaro e2b61e0190 * explain flags in doc strings
* reverse order of files on the command line in pickle2db.py to make it
  symmetrical with db2pickle.py in the two-arg case (src, then dest)
2004-03-03 17:42:08 +00:00
Brett Cannon d1080a3418 Have strftime() check its time tuple argument to make sure the tuple's values
are within proper boundaries as specified in the docs.

This can break possible code (datetime module needed changing, for instance)
that uses 0 for values that need to be greater 1 or greater (month, day, and
day of year).

Fixes bug #897625.
2004-03-02 04:38:10 +00:00
Skip Montanaro 786ea6bc23 Add pystack definition to Misc/gdbinit with some explanation of its behavior
and add flag comments to ceval.c and main.c alerting people to the coupling
between pystack and the layout of those files.
2004-03-01 15:44:05 +00:00
Michael W. Hudson d3b33b5f6f "Fix" (for certain configurations of the planets, including
recent gcc on Linux/x86)

[ 899109 ] 1==float('nan')

by implementing rich comparisons for floats.

Seems to make comparisons involving NaNs somewhat less surprising
when the underlying C compiler actually implements C99 semantics.
2004-02-19 19:35:22 +00:00
Martin v. Löwis d3c810ed31 Patch #892673: Replace /usr/local/bin/python with
/usr/bin/env python'%{binsuffix}
Backported to 2.3.
2004-02-15 21:27:03 +00:00
Martin v. Löwis a79449e7a2 Patch #711838: Allow non-anonymous ftp urls in urllib2.
Backported to 2.3.
2004-02-15 21:19:18 +00:00
Raymond Hettinger fa7b9d8255 * Moved the responsibility for emptying the previous list from list_fill
to list_init.

* Replaced the code in list_extend with the superior code from list_fill.

* Eliminated list_fill.

Results:

* list.extend() no longer creates an intermediate tuple except to handle
  the special case of x.extend(x).  The saves memory and time.

* list.extend(x) runs
    about the same x is a list or tuple,
    a little faster when x is an iterable not defining __len__, and
    twice as fast when x is an iterable defining __len__.

* the code is about 15 lines shorter and no longer duplicates
  functionality.
2004-02-15 04:06:39 +00:00
Raymond Hettinger ab517d2eac Fine tune the speed/space trade-off for overallocating small lists.
The Py2.3 approach overallocated small lists by up to 8 elements.
The last checkin would limited this to one but slowed down (by 20 to 30%)
the creation of small lists between 3 to 8 elements.

This tune-up balances the two, limiting overallocation to 3 elements
(significantly reducing space consumption from Py2.3) and running faster
than the previous checkin.

The first part of the growth pattern (0, 4, 8, 16) neatly meshes with
allocators that trigger data movement only when crossing a power of two
boundary.  Also, then even numbers mesh well with common data alignments.
2004-02-14 18:34:46 +00:00
Gustavo Niemeyer a6e436e4b4 - Fixed #853061: allow BZ2Compressor.compress() to receive an empty string
as parameter.
2004-02-14 00:02:45 +00:00
Raymond Hettinger 4bb9540dd6 * Optimized list appends and pops by making fewer calls the underlying system
realloc().  This is achieved by tracking the overallocation size in a new
  field and using that information to skip calls to realloc() whenever
  possible.

* Simplified and tightened the amount of overallocation.  For larger lists,
  this overallocates by 1/8th (compared to the previous scheme which ranged
  between 1/4th to 1/32nd over-allocation).  For smaller lists (n<6), the
  maximum overallocation is one byte (formerly it could be upto eight bytes).
  This saves memory in applications with large numbers of small lists.

* Eliminated the NRESIZE macro in favor of a new, static list_resize function
  that encapsulates the resizing logic.  Coverting this back to macro would
  give a small (under 1%) speed-up.  This was too small to warrant the loss
  of readability, maintainability, and de-coupling.

* Some functions using NRESIZE had grown unnecessarily complex in their
  efforts to bend to the macro's calling pattern.  With the new list_resize
  function in place, those other functions could be simplified.  That is
  being saved for a separate patch.

* The ob_item==NULL check could be eliminated from the new list_resize
  function.  This would entail finding each piece of code that sets ob_item
  to NULL and adding a new line to invalidate the overallocation tracking
  field.  Rather than impose a new requirement on other pieces of list code,
  it was preferred to leave the NULL check in place and retain the benefits
  of decoupling, maintainability and information hiding (only PyList_New()
  and list_sort() need to know about the new field).  This approach also
  reduces the odds of breaking an extension module.

(Collaborative effort by Raymond Hettinger, Hye-Shik Chang, Tim Peters,
 and Armin Rigo.)
2004-02-13 11:36:39 +00:00
Michael W. Hudson ecfeb7f095 This is my patch #876198 plus a NEWS entry and a header frob.
Remove the ability to use (from C) arbitrary objects supporting the
read buffer interface as the co_code member of code objects.
2004-02-12 15:28:27 +00:00
Skip Montanaro 7befb9966e remove support for missing ANSI C header files (limits.h, stddef.h, etc). 2004-02-10 16:50:21 +00:00
Raymond Hettinger b32e640489 SF patch #875689: >100k alloc wasted on startup
(Contributed by Mike Pall.)

Make sure fill_free_list() is called only once rather than 106 times
when pre-allocating small ints.
2004-02-08 18:54:37 +00:00
Jim Fulton 8a1a594590 Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocol
2.  Failure to clear the error when attempts to get the __getstate__
  attribute fail caused intermittent errors and odd behavior.
2004-02-08 04:21:26 +00:00
Skip Montanaro db6080507d Remove support for --without-universal-newlines (see PEP 11). 2004-02-07 13:53:46 +00:00
Fred Drake 228765b0e1 added notes about weakref changes 2004-02-06 04:15:22 +00:00
Hye-Shik Chang ff83c2bacc Fix input() builtin function to respect compiler flags.
(SF patch 876178, patch by mwh, unittest by perky)
2004-02-02 13:39:01 +00:00
Martin v. Löwis 12af0485f8 Patch #874083: Bluetooth support for socket module. 2004-01-31 12:34:17 +00:00
Raymond Hettinger 756b3f3c15 * Move collections.deque() in from the sandbox
* Add unittests, newsitem, and whatsnew
* Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py
* Docs are forthcoming
2004-01-29 06:37:52 +00:00
Skip Montanaro d5a21fd387 add hotshotmain ref 2004-01-27 14:49:04 +00:00
Marc-André Lemburg 57cb68fe93 Add news item about change in encodings search function. 2004-01-20 18:24:34 +00:00
Hye-Shik Chang 84a9931b19 Add a news entry for importing of CJK codecs. 2004-01-17 14:59:36 +00:00
Skip Montanaro cd1f7430cb document PEP 11 progress so far. 2004-01-17 14:22:44 +00:00
Skip Montanaro ce59c04127 Remove support for SunOS 4.
Remove BAD_EXEC_PROTOYPE (leftover from IRIX 4 demolition).
2004-01-17 14:19:44 +00:00
Raymond Hettinger 0c4102760c SF Patch #864863: Bisect C implementation
(Contributed by Dmitry Vasiliev.)
2004-01-05 10:13:35 +00:00
Barry Warsaw 30ff12ffc2 Add note about new base64.py module support for RFC 3548. 2004-01-04 01:13:43 +00:00
Andrew MacIntyre f1ca7f561c complete backout of listobject.c v2.171 2003-12-28 07:43:56 +00:00
Andrew MacIntyre d57caed52c Performance of list([]) in 2.3 came up in a thread on comp.lang.python,
which can be reviewed via
http://coding.derkeiler.com/Archive/Python/comp.lang.python/2003-12/1011.html

Duncan Booth investigated, and discovered that an "optimisation" was
in fact a pessimisation for small numbers of elements in a source list,
compared to not having the optimisation, although with large numbers
of elements in the source list the optimisation was quite beneficial.

He posted his change to comp.lang.python (but not to SF).

Further research has confirmed his assessment that the optimisation only
becomes a net win when the source list has more than 100 elements.

I also found that the optimisation could apply to tuples as well,
but the gains only arrive with source tuples larger than about 320
elements and are nowhere near as significant as the gains with lists,
(~95% gain @ 10000 elements for lists, ~20% gain @ 10000 elements for
tuples) so I haven't proceeded with this.

The code as it was applied the optimisation to list subclasses as
well, and this also appears to be a net loss for all reasonable sized
sources (~80-100% for up to 100 elements, ~20% for more than 500
elements; I tested up to 10000 elements).

Duncan also suggested special casing empty lists, which I've extended
to all empty sequences.

On the basis that list_fill() is only ever called with a list for the
result argument, testing for the source being the destination has
now happens before testing source types.
2003-12-25 13:28:48 +00:00
Skip Montanaro 302e550403 Sync with python-mode project. Adds two changes:
* in py-checker-run, fall back to read-string if read-shell-command
  (XEmacs-specific) is not available.

* highlight variables would mask builtins as if they were keywords.
2003-12-18 21:53:33 +00:00
Raymond Hettinger 64958a15d7 Guido grants a Christmas wish:
sorted() becomes a regular function instead of a classmethod.
2003-12-17 20:43:33 +00:00
Raymond Hettinger c0d49d82de Fix typo and improve wording a bit. 2003-12-15 19:24:34 +00:00
Hye-Shik Chang 060ebedc40 Add an entry for addition of {str,unicode}.rsplit. 2003-12-15 18:51:19 +00:00
Jeremy Hylton 37c5f2a74f Add news item about processor support in urllib2. 2003-12-14 05:29:45 +00:00
Raymond Hettinger 8f5cdaa784 * Added a new method flag, METH_COEXIST.
* Used the flag to optimize set.__contains__(), dict.__contains__(),
  dict.__getitem__(), and list.__getitem__().
2003-12-13 11:26:12 +00:00
Raymond Hettinger d25c1c6351 Implement itertools.groupby()
Original idea by Guido van Rossum.
Idea for skipable inner iterators by Raymond Hettinger.
Idea for argument order and identity function default by Alex Martelli.
Implementation by Hye-Shik Chang (with tweaks by Raymond Hettinger).
2003-12-06 16:23:06 +00:00
Thomas Heller c7501d52ef distutils compilers now compile source files in the same order as they
are passed to the compiler.
2003-12-05 20:28:07 +00:00
Fred Drake 713ade69c5 Add news about removal of the PendingDeprecationWarning from apply(). 2003-12-05 17:43:47 +00:00
Walter Dörwald c8de4585a6 Add parameters indent, width and depth to pprint.pprint() and pprint.pformat()
and pass them along to the PrettyPrinter constructor.
2003-12-03 20:26:05 +00:00
Walter Dörwald 7a7ede54d4 Patch #750542: pprint now will pretty print subclasses of list, tuple
and dict too, as long as they don't overwrite __repr__().
2003-12-03 20:15:28 +00:00
Tim Peters 1d7323e4e7 Py_Finalize(): disabled the second call of cyclic gc, and added extensive
comments about why both calls to cyclic gc here can cause problems.

I'll backport to 2.3 maint.  Since the calls were introduced in 2.3,
that will be the end of it.
2003-12-01 21:35:27 +00:00
Raymond Hettinger 166958b5df As discussed on python-dev, added two extractor functions to the
operator module.
2003-12-01 13:18:39 +00:00
Guido van Rossum fd25acacaf Add news item for _winreg fix (SF bug 851056). 2003-11-30 22:10:15 +00:00
Guido van Rossum 6c9e130524 - Removed FutureWarnings related to hex/oct literals and conversions
and left shifts.  (Thanks to Kalle Svensson for SF patch 849227.)
  This addresses most of the remaining semantic changes promised by
  PEP 237, except for repr() of a long, which still shows the trailing
  'L'.  The PEP appears to promise warnings for operations that
  changed semantics compared to Python 2.3, but this is not
  implemented; we've suffered through enough warnings related to
  hex/oct literals and I think it's best to be silent now.
2003-11-29 23:52:13 +00:00
Thomas Heller b310591169 See SF #848614: distutils' msvccompiler now tries to detect that MSVC6
is installed but the registry settings are incomplete because the gui
has never been run.

Already backported to release23-maint.
2003-11-28 19:42:56 +00:00
Martin v. Löwis 94681fc4a3 Patch #849595: Add socket.shutdown() constants. 2003-11-27 19:40:22 +00:00
Raymond Hettinger 4f8f976576 Add optional fillchar argument to ljust(), rjust(), and center() string methods. 2003-11-26 08:21:35 +00:00
Raymond Hettinger bc0f2ab9bb Expose dict_contains() and PyDict_Contains() with is about 10% faster
than PySequence_Contains() and more clearly applicable to dicts.

Apply the new function in setobject.c where __contains__ checking is
ubiquitous.
2003-11-25 21:12:14 +00:00
Guido van Rossum baf0f8f24d - When method objects have an attribute that can be satisfied either
by the function object or by the method object, the function
  object's attribute usually wins.  Christian Tismer pointed out that
  that this is really a mistake, because this only happens for special
  methods (like __reduce__) where the method object's version is
  really more appropriate than the function's attribute.  So from now
  on, all method attributes will have precedence over function
  attributes with the same name.
2003-11-22 23:55:50 +00:00
Tim Peters 403a203223 SF bug 839548: Bug in type's GC handling causes segfaults.
Also SF patch 843455.

This is a critical bugfix.
I'll backport to 2.3 maint, but not beyond that.  The bugs this fixes
have been there since weakrefs were introduced.
2003-11-20 21:21:46 +00:00