]> granicus.if.org Git - python/log
python
21 years agoThe Python implementation of datetime was changed in ways that no longer
Tim Peters [Sat, 8 Feb 2003 03:46:31 +0000 (03:46 +0000)]
The Python implementation of datetime was changed in ways that no longer
tickle the 2.2.2 __cmp__ bug test_datetime used to tickle, so the
workarounds for that bug no longer make sense in the test suite (which I'm
still trying to keep as closely in synch as possible with Zope3's
version).

21 years agotimedelta comparison and datetime addition: as the Python implementation
Tim Peters [Sat, 8 Feb 2003 03:28:59 +0000 (03:28 +0000)]
timedelta comparison and datetime addition:  as the Python implementation
of datetime does, accept instances of subclasses too.

21 years agoFix compatibility for earlier versions of Python (than 2.3), which
Barry Warsaw [Sat, 8 Feb 2003 03:18:58 +0000 (03:18 +0000)]
Fix compatibility for earlier versions of Python (than 2.3), which
doesn't have UserDict.DictMixin.

21 years agoComparison for timedelta, time, date and datetime objects: __eq__ and
Tim Peters [Fri, 7 Feb 2003 22:50:28 +0000 (22:50 +0000)]
Comparison for timedelta, time, date and datetime objects:  __eq__ and
__ne__ no longer complain if they don't know how to compare to the other
thing.  If no meaningful way to compare is known, saying "not equal" is
sensible.  This allows things like

    if adatetime in some_sequence:
and
    somedict[adatetime] = whatever

to work as expected even if some_sequence contains non-datetime objects,
or somedict non-datetime keys, because they only call __eq__.

It still complains (raises TypeError) for mixed-type comparisons in
contexts that require a total ordering, such as list.sort(), use as a
key in a BTree-based data structure, and cmp().

21 years agoMerge the test part of the below checkin to the sandbox and Zope3, so
Guido van Rossum [Fri, 7 Feb 2003 21:49:01 +0000 (21:49 +0000)]
Merge the test part of the below checkin to the sandbox and Zope3, so
the tests will remain in sync:

"""
Tres discovered a weird bug when a datetime is pickled, caused by the
shadowing of __year, __month, __day and the use of proxies.

Here's a quick fix and a quick unit test.  I don't quite understand
why this wasn't caught by the pickling unit tests.
"""

21 years agoReserve a range for Zope, not specifically for Zope 3.
Guido van Rossum [Fri, 7 Feb 2003 20:56:38 +0000 (20:56 +0000)]
Reserve a range for Zope, not specifically for Zope 3.

21 years agoFix SF bug #642168, help() fails for some builtin topics
Neal Norwitz [Fri, 7 Feb 2003 20:49:40 +0000 (20:49 +0000)]
Fix SF bug #642168, help() fails for some builtin topics

Fix pydoc when doing help for:  and, or, not, UNICODE.

Will backport.

21 years agoUpdate URL
Andrew M. Kuchling [Fri, 7 Feb 2003 20:22:33 +0000 (20:22 +0000)]
Update URL

21 years agoSF patch #682514, mmapmodule.c write fix for LP64 executables
Neal Norwitz [Fri, 7 Feb 2003 19:44:56 +0000 (19:44 +0000)]
SF patch #682514, mmapmodule.c write fix for LP64 executables

Make length an int so we get the right value from
PyArg_ParseTuple(args, "s#", &str, &length)

Will backport.

21 years agoSomehow, copy() of a classic class object was handled
Guido van Rossum [Fri, 7 Feb 2003 17:53:23 +0000 (17:53 +0000)]
Somehow, copy() of a classic class object was handled
atomically, but deepcopy() didn't support this at all.
I don't see any reason for this, so I'm adding ClassType
to the set of types that are deep-copied atomically.

21 years agoAdd support for copy_reg.dispatch_table.
Guido van Rossum [Fri, 7 Feb 2003 17:30:18 +0000 (17:30 +0000)]
Add support for copy_reg.dispatch_table.

Rewrote copy() and deepcopy() without avoidable try/except statements;
getattr(x, name, None) or dict.get() are much faster than try/except.

21 years agoMade AskFile* dialogs movable-modal by default, by providing a dummy
Jack Jansen [Fri, 7 Feb 2003 15:45:40 +0000 (15:45 +0000)]
Made AskFile* dialogs movable-modal by default, by providing a dummy
eventProc (which simply drops all events on the floor). Also added a
method SetDefaultEventProc through which frameworks can set a global
event handler (which can still be overridden on a per-call basis
with the eventProc argument).

21 years agoAdd __getnewargs__ method to classes that need it.
Guido van Rossum [Fri, 7 Feb 2003 14:59:13 +0000 (14:59 +0000)]
Add __getnewargs__ method to classes that need it.

(Yes, this is an incompatibility.  I'll document it in PEP 307.)

21 years ago- make some links into the reference documentation relative for
Fred Drake [Fri, 7 Feb 2003 14:52:18 +0000 (14:52 +0000)]
- make some links into the reference documentation relative for
  off-line readers
- fix some minor typos and markup errors

21 years ago* Eliminated tuple re-use in imap(). Doing it correctly made the code
Raymond Hettinger [Fri, 7 Feb 2003 07:26:25 +0000 (07:26 +0000)]
* Eliminated tuple re-use in imap().  Doing it correctly made the code
  too hard to read.
* Simplified previous changes to izip() to make it easier to read.

21 years agoSF bug #681003: itertools issues
Raymond Hettinger [Fri, 7 Feb 2003 05:32:58 +0000 (05:32 +0000)]
SF bug #681003: itertools issues

* Fixed typo in exception message for times()
* Filled in missing times_traverse()
* Document reasons that imap() did not adopt a None fill-in feature
* Document that count(sys.maxint) will wrap-around on overflow
* Add overflow test to islice()
* Check that starmap()'s argument returns a tuple
* Verify that imap()'s tuple re-use is safe
* Make a similar tuple re-use (with safety check) for izip()

21 years agoFix SF bug #675259, os.environ leaks under FreeBSD and Mac OS X
Neal Norwitz [Fri, 7 Feb 2003 02:27:36 +0000 (02:27 +0000)]
Fix SF bug #675259, os.environ leaks under FreeBSD and Mac OS X

Even with the extra work to cleanup the env, *BSD still leaks.  Add a note.

Will backport.

21 years agoIntegrate the patch from expat.h 1.51; needed for some C compilers.
Fred Drake [Fri, 7 Feb 2003 02:15:56 +0000 (02:15 +0000)]
Integrate the patch from expat.h 1.51; needed for some C compilers.
Closes SF bug #680797.

21 years agoSF bug 666444: 'help' makes linefeed only under Win32.
Tim Peters [Fri, 7 Feb 2003 01:53:46 +0000 (01:53 +0000)]
SF bug 666444:  'help' makes linefeed only under Win32.
Reverting one of those irritating "security fixes".  fdopen() opens
files in binary mode.  That makes pydoc skip the \r\n on Windows that's
need to make the output readable in the shell.  Screw it.

21 years agoGot rid of macfs.
Jack Jansen [Thu, 6 Feb 2003 23:13:11 +0000 (23:13 +0000)]
Got rid of macfs.

21 years agoGot rid of macfs and FSSpecs.
Jack Jansen [Thu, 6 Feb 2003 23:12:23 +0000 (23:12 +0000)]
Got rid of macfs and FSSpecs.

21 years agoAdded a note about getting rid of macfs usage (MacPython).
Jack Jansen [Thu, 6 Feb 2003 23:10:45 +0000 (23:10 +0000)]
Added a note about getting rid of macfs usage (MacPython).

21 years agoGot rid of FSSpecs.
Jack Jansen [Thu, 6 Feb 2003 22:57:44 +0000 (22:57 +0000)]
Got rid of FSSpecs.

21 years agoMove _better_reduce from copy.py to copy_reg.py, and also use it in
Guido van Rossum [Thu, 6 Feb 2003 22:57:00 +0000 (22:57 +0000)]
Move _better_reduce from copy.py to copy_reg.py, and also use it in
pickle.py, where it makes save_newobj() unnecessary.  Tests pass.

21 years agoGot rid of macfs and FSSpecs in general (pathnames or FSRefs are now
Jack Jansen [Thu, 6 Feb 2003 22:32:35 +0000 (22:32 +0000)]
Got rid of macfs and FSSpecs in general (pathnames or FSRefs are now
used everywhere).

21 years agoFix a bug in the way __getnewargs__ was handled.
Guido van Rossum [Thu, 6 Feb 2003 21:25:12 +0000 (21:25 +0000)]
Fix a bug in the way __getnewargs__ was handled.

21 years agoUpdate doc to reflect code changes for obsoleting use_statcache parameter
Neal Norwitz [Thu, 6 Feb 2003 21:17:17 +0000 (21:17 +0000)]
Update doc to reflect code changes for obsoleting use_statcache parameter

21 years agoUse new name for GetoptError, and pass it two arguments
Andrew M. Kuchling [Thu, 6 Feb 2003 19:55:35 +0000 (19:55 +0000)]
Use new name for GetoptError, and pass it two arguments
Use re module instead of regex

21 years agoSupport all the new stuff supported by the new pickle code:
Guido van Rossum [Thu, 6 Feb 2003 19:53:22 +0000 (19:53 +0000)]
Support all the new stuff supported by the new pickle code:
- subclasses of list or dict
- __reduce__ returning a 4-tuple or 5-tuple
- slots

21 years agoA few naughty external scripts do 'raise getopt.error, "blah"', and
Andrew M. Kuchling [Thu, 6 Feb 2003 19:52:56 +0000 (19:52 +0000)]
A few naughty external scripts do 'raise getopt.error, "blah"', and
   now crash because two arguments are expected.  Add a default value
   to keep those scripts running.

21 years agoAdd DeprecationWarning when use_statcache argument is supplied
Andrew M. Kuchling [Thu, 6 Feb 2003 19:38:45 +0000 (19:38 +0000)]
Add DeprecationWarning when use_statcache argument is supplied
Fix use of GetoptError, so demo() now works

21 years agoRemove a debug print statement.
Guido van Rossum [Thu, 6 Feb 2003 19:30:38 +0000 (19:30 +0000)]
Remove a debug print statement.

21 years agoRemove another lie.
Michael W. Hudson [Thu, 6 Feb 2003 18:38:11 +0000 (18:38 +0000)]
Remove another lie.

21 years agoCorrect lie about METH_NOARGS functions.
Michael W. Hudson [Thu, 6 Feb 2003 18:37:11 +0000 (18:37 +0000)]
Correct lie about METH_NOARGS functions.

Backport candidate.

21 years agoSupport __reduce__ returning a 4-tuple or 5-tuple.
Guido van Rossum [Thu, 6 Feb 2003 18:18:23 +0000 (18:18 +0000)]
Support __reduce__ returning a 4-tuple or 5-tuple.

21 years agoTypo fixes
Andrew M. Kuchling [Thu, 6 Feb 2003 18:04:43 +0000 (18:04 +0000)]
Typo fixes

21 years agoA test suite for the copy module. This should provide full code
Guido van Rossum [Thu, 6 Feb 2003 17:52:15 +0000 (17:52 +0000)]
A test suite for the copy module.  This should provide full code
coverage.

21 years ago[Bug #680494] filecmp.py uses obsolete statcache module.
Andrew M. Kuchling [Thu, 6 Feb 2003 17:50:01 +0000 (17:50 +0000)]
[Bug #680494] filecmp.py uses obsolete statcache module.
   Simply replace all uses of statcache with os.stat.

Should I add a DeprecationWarning triggered if the use_statcache argument
is supplied, so we can remove it in 2.4?

21 years agoAdd test suite for filecmp.py, after some discussion on bug #680494.
Andrew M. Kuchling [Thu, 6 Feb 2003 17:42:45 +0000 (17:42 +0000)]
Add test suite for filecmp.py, after some discussion on bug #680494.

Right now the test cases create a files and a directory in the temp.
directory.  Raymond suggested checking files in to the test/ directory,
simplifying the setup/teardown methods; is that worth doing?

21 years agoSF bug 680864: test_datetime fails for non-unix epoch
Tim Peters [Thu, 6 Feb 2003 16:42:14 +0000 (16:42 +0000)]
SF bug 680864:  test_datetime fails for non-unix epoch
Apparently MAC OS 9 doesn't have POSIX-conforming timestamps.  A test
fails as a result, but at least for this specific test it's easy enough
to get the POSIX epoch out of it.

21 years agoNo need for a continuation line.
Jeremy Hylton [Thu, 6 Feb 2003 16:23:01 +0000 (16:23 +0000)]
No need for a continuation line.

21 years agoReplace hasattr() + getattr() with single getattr() and default value.
Jeremy Hylton [Thu, 6 Feb 2003 16:22:01 +0000 (16:22 +0000)]
Replace hasattr() + getattr() with single getattr() and default value.

21 years agoClarify that __module__ applies to various type of functions.
Guido van Rossum [Thu, 6 Feb 2003 16:16:50 +0000 (16:16 +0000)]
Clarify that __module__ applies to various type of functions.

21 years agoAdd news item about __module__ attribute on functions.
Jeremy Hylton [Thu, 6 Feb 2003 16:00:15 +0000 (16:00 +0000)]
Add news item about __module__ attribute on functions.

21 years agoComment typo fix
Andrew M. Kuchling [Thu, 6 Feb 2003 15:22:49 +0000 (15:22 +0000)]
Comment typo fix

21 years agoMention FutureWarning for large ints
Andrew M. Kuchling [Thu, 6 Feb 2003 15:14:04 +0000 (15:14 +0000)]
Mention FutureWarning for large ints

21 years agoFix description of filterwarnings() parameters (error noted by Richard Jones at
Andrew M. Kuchling [Thu, 6 Feb 2003 14:38:45 +0000 (14:38 +0000)]
Fix description of filterwarnings() parameters (error noted by Richard Jones at
http://mechanicalcat.net/cgi-bin/log/python/turning_warnings_off.html)

21 years agoProvide version changed info
Neal Norwitz [Thu, 6 Feb 2003 05:02:39 +0000 (05:02 +0000)]
Provide version changed info

21 years agoUpdated version of [ 558544 ] cmd.py: add instance-specific stdin/out
Anthony Baxter [Thu, 6 Feb 2003 01:45:11 +0000 (01:45 +0000)]
Updated version of [ 558544 ] cmd.py: add instance-specific stdin/out

This patch adds stdin, stdout as optional arguments to the cmd.Cmd
constructor (defaulting to sys.stdin, sys.stdout), and changes the Cmd
methods throughout to use self.stdout.write() and self.stdin.foo for
output and input. This allows much greater flexibility for using cmd -
for instance, hooking it into a telnet server.

Patch for library module and for documentation.

21 years agoSmall function call optimization and special build option for call stats.
Jeremy Hylton [Wed, 5 Feb 2003 23:13:00 +0000 (23:13 +0000)]
Small function call optimization and special build option for call stats.

-DCALL_PROFILE: Count the number of function calls executed.

When this symbol is defined, the ceval mainloop and helper functions
count the number of function calls made.  It keeps detailed statistics
about what kind of object was called and whether the call hit any of
the special fast paths in the code.

Optimization:

When we take the fast_function() path, which seems to be taken for
most function calls, and there is minimal frame setup to do, avoid
call PyEval_EvalCodeEx().  The eval code ex function does a lot of
work to handle keywords args and star args, free variables,
generators, etc.  The inlined version simply allocates the frame and
copies the arguments values into the frame.

The optimization gets a little help from compile.c which adds a
CO_NOFREE flag to code objects that don't have free variables or cell
variables.  This change allows fast_function() to get into the fast
path with fewer tests.

I measure a couple of percent speedup in pystone with this change, but
there's surely more that can be done.

21 years agoGot rid of macfs and made a bit more OSX-friendly.
Jack Jansen [Wed, 5 Feb 2003 23:10:46 +0000 (23:10 +0000)]
Got rid of macfs and made a bit more OSX-friendly.

21 years agoremoving old junk
Just van Rossum [Wed, 5 Feb 2003 22:59:07 +0000 (22:59 +0000)]
removing old junk

21 years agoRemoved unused import of macfs.
Jack Jansen [Wed, 5 Feb 2003 22:53:29 +0000 (22:53 +0000)]
Removed unused import of macfs.

21 years agoI don't think this script serves a useful purpose anymore, and I can't
Jack Jansen [Wed, 5 Feb 2003 22:52:16 +0000 (22:52 +0000)]
I don't think this script serves a useful purpose anymore, and I can't
be bothered to fix it.

21 years agoFix for SF #668433. I'm not explaining it here; ample comments are in
Guido van Rossum [Wed, 5 Feb 2003 22:39:45 +0000 (22:39 +0000)]
Fix for SF #668433.  I'm not explaining it here; ample comments are in
the code.

21 years agoRefactor the logic for setting f_builtins.
Jeremy Hylton [Wed, 5 Feb 2003 22:39:29 +0000 (22:39 +0000)]
Refactor the logic for setting f_builtins.

For the case where the current globals match the previous frame's
globals, eliminates three tests in two if statements.  For the case
where we just get __builtins__ from a module, eliminate a couple of
tests.

21 years ago[Patch #654421 from Matthew Mueller]
Andrew M. Kuchling [Wed, 5 Feb 2003 21:35:07 +0000 (21:35 +0000)]
[Patch #654421 from Matthew Mueller]
  gzip shouldn't raise ValueError on corrupt files

  Currently the gzip module will raise a ValueError if the file was
  corrupt (bad crc or bad size).  I can't see how that applies to
  reading a corrupt file.  IOError seems better, and it's what code
  will likely be looking for.

21 years agoMarkup fixes; in particular, the tables are now reasonable width
Andrew M. Kuchling [Wed, 5 Feb 2003 21:15:38 +0000 (21:15 +0000)]
Markup fixes; in particular, the tables are now reasonable width

21 years agodis(): Added an optional memo argument, so that multiple pickles in a
Tim Peters [Wed, 5 Feb 2003 19:55:53 +0000 (19:55 +0000)]
dis():  Added an optional memo argument, so that multiple pickles in a
file can be dumped without (bogus) complaint if the the pickles were
created using a single pickle memo.

21 years agoSF bug 681122: Built-in function dir() causes refcount leak in baseclasses.
Tim Peters [Wed, 5 Feb 2003 19:35:19 +0000 (19:35 +0000)]
SF bug 681122: Built-in function dir() causes refcount leak in baseclasses.

merge_class_dict():  This was missing a decref.

Bugfix candidate.

21 years ago[680789] Debug with long array takes forever
Tim Peters [Wed, 5 Feb 2003 18:29:34 +0000 (18:29 +0000)]
[680789] Debug with long array takes forever
Added array.array to the types repr.py knows about, after a suggestion
from Jurjen N.E. Bos.

21 years agoPatch #551977: Regression exceptions for cygwin
Jason Tishler [Wed, 5 Feb 2003 16:46:01 +0000 (16:46 +0000)]
Patch #551977: Regression exceptions for cygwin

Applied the skip test_ossaudiodev patch.

21 years agoGetting rid of macfs and FSSpecs.
Jack Jansen [Wed, 5 Feb 2003 15:49:19 +0000 (15:49 +0000)]
Getting rid of macfs and FSSpecs.

21 years agoGot rid of macfs
Jack Jansen [Wed, 5 Feb 2003 15:44:03 +0000 (15:44 +0000)]
Got rid of macfs

21 years agoAdded "Open File by Name" command which presens a filename dialog. If
Jack Jansen [Wed, 5 Feb 2003 15:41:09 +0000 (15:41 +0000)]
Added "Open File by Name" command which presens a filename dialog. If
the clipboard contains a filename that filename is used as the default.

21 years agoCast various floats to ints so we don't get warnings.
Jack Jansen [Wed, 5 Feb 2003 15:40:05 +0000 (15:40 +0000)]
Cast various floats to ints so we don't get warnings.

21 years agoThis patch reverts the following:
Jason Tishler [Wed, 5 Feb 2003 15:16:17 +0000 (15:16 +0000)]
This patch reverts the following:

It also prevents building against the real X headers, if installed.

After discussions with the Cygwin project lead, I believe that building
against the real X headers is OK. Especially, since the psuedo-X headers
are *not* installed by the Cygwin Tcl/Tk binary package.

21 years agoThis patch enables Cygwin Python to build _tkinter against Tcl/Tk 8.4.
Jason Tishler [Wed, 5 Feb 2003 15:06:46 +0000 (15:06 +0000)]
This patch enables Cygwin Python to build _tkinter against Tcl/Tk 8.4.
Note that this patch just reverts the lib_prefix (i.e., "cyg") portion
of my Tcl/Tk 8.3 patch. It seems that Cygwin Tcl/Tk is using a more
normal file naming convention again.

21 years agoFixed a few typos, and changed FSCreateResourceFile filename argument to unicode.
Jack Jansen [Wed, 5 Feb 2003 13:39:04 +0000 (13:39 +0000)]
Fixed a few typos, and changed FSCreateResourceFile filename argument to unicode.

21 years agoAdded itertools module.
Jack Jansen [Wed, 5 Feb 2003 13:36:50 +0000 (13:36 +0000)]
Added itertools module.

21 years agoUse os.path.realpath() in stead of abspath(), so the tests don't fail if
Jack Jansen [Wed, 5 Feb 2003 11:14:16 +0000 (11:14 +0000)]
Use os.path.realpath() in stead of abspath(), so the tests don't fail if
we have a symlink somewhere in the TESTFN path.

21 years agoSF patch #674396: Apply UserDict.DictMixin to expand dbshelve and dbojb
Raymond Hettinger [Wed, 5 Feb 2003 04:12:41 +0000 (04:12 +0000)]
SF patch #674396:  Apply UserDict.DictMixin to expand dbshelve and dbojb
   to have a full dictionary interface.

21 years agoBuild pickler_choices list in a lazier way.
Tim Peters [Wed, 5 Feb 2003 04:08:07 +0000 (04:08 +0000)]
Build pickler_choices list in a lazier way.

21 years agoMore typo repair.
Tim Peters [Wed, 5 Feb 2003 03:53:10 +0000 (03:53 +0000)]
More typo repair.

21 years agoTypo repair.
Tim Peters [Wed, 5 Feb 2003 03:46:17 +0000 (03:46 +0000)]
Typo repair.

21 years agocPickle: exempt two_tuple from GC -- it's a speed hack, and doesn't
Tim Peters [Tue, 4 Feb 2003 21:47:44 +0000 (21:47 +0000)]
cPickle:  exempt two_tuple from GC -- it's a speed hack, and doesn't
guarantee to keep valid pointers in its slots.

tests:  Moved ExtensionSaver from test_copy_reg into pickletester, and
use it both places.  Once extension codes get assigned, it won't be
safe to overwrite them willy nilly in test suites, and ExtensionSaver
does a thorough job of undoing any possible damage.

Beefed up the EXT[124] tests a bit, to check the smallest and largest
codes in each opcode's range too.

21 years agoIf a float is passed where a int is expected, issue a DeprecationWarning
Neil Schemenauer [Tue, 4 Feb 2003 20:59:40 +0000 (20:59 +0000)]
If a float is passed where a int is expected, issue a DeprecationWarning
instead of raising a TypeError.  Closes #660144 (again).

21 years agocPickle now generates proto 2 EXT[124] when appropriate.
Tim Peters [Tue, 4 Feb 2003 20:56:09 +0000 (20:56 +0000)]
cPickle now generates proto 2 EXT[124] when appropriate.
Moved such EXT tests as currently exist from TempAbstractPickleTests to
AbstractPickleTests, so that test_cpickle runs them too.

21 years agoRemove forward static reference since it is not required
Neal Norwitz [Tue, 4 Feb 2003 20:46:50 +0000 (20:46 +0000)]
Remove forward static reference since it is not required

21 years agoWhitespace normalization
Neal Norwitz [Tue, 4 Feb 2003 20:45:17 +0000 (20:45 +0000)]
Whitespace normalization

21 years agoMake sure filter() never returns tuple, str or unicode
Walter Dörwald [Tue, 4 Feb 2003 20:24:45 +0000 (20:24 +0000)]
Make sure filter() never returns tuple, str or unicode
subclasses. (Discussed in SF patch #665835)

21 years agoFix for [ 543344 ] Interpreter crashes when recoding; suggested
Marc-André Lemburg [Tue, 4 Feb 2003 19:35:03 +0000 (19:35 +0000)]
Fix for [ 543344 ] Interpreter crashes when recoding; suggested
by Michael Stone (mbrierst).

Python 2.1.4, 2.2.2 candidate.

21 years agosupports_unicode_filenames was not in the right location.
Fred Drake [Tue, 4 Feb 2003 19:13:07 +0000 (19:13 +0000)]
supports_unicode_filenames was not in the right location.

21 years agoUse size_t instead of int for various variables to prevent
Walter Dörwald [Tue, 4 Feb 2003 18:02:28 +0000 (18:02 +0000)]
Use size_t instead of int for various variables to prevent
signed/unsigned comparison warnings on the call to iconv().

Fix comment typos.

From SF patch #680146.

21 years agoAdded basic tests of copy_reg's extension registry.
Tim Peters [Tue, 4 Feb 2003 17:49:36 +0000 (17:49 +0000)]
Added basic tests of copy_reg's extension registry.

21 years agoAdd a test that checks that filter() honors the sq_item slot for
Walter Dörwald [Tue, 4 Feb 2003 17:04:01 +0000 (17:04 +0000)]
Add a test that checks that filter() honors the sq_item slot for
str and unicode subclasses not just for generating the output
but for testing too.

21 years agoPyUnicode_Resize() doesn't free its argument in case of a failure,
Walter Dörwald [Tue, 4 Feb 2003 16:57:49 +0000 (16:57 +0000)]
PyUnicode_Resize() doesn't free its argument in case of a failure,
so we can jump to the error handling code that does.
(Spotted by Neal Norwitz)

21 years agofilterstring() and filterunicode() in Python/bltinmodule.c
Walter Dörwald [Tue, 4 Feb 2003 16:28:00 +0000 (16:28 +0000)]
filterstring() and filterunicode() in Python/bltinmodule.c
blindly assumed that tp_as_sequence->sq_item always returns
a str or unicode object. This might fail with str or unicode
subclasses.

This patch checks whether the object returned from __getitem__
is a str/unicode object and raises a TypeError if not (and
the filter function returned true).

Furthermore the result for __getitem__ can be more than one
character long, so checks for enough memory have to be done.

21 years ago- Handle the img and MediaFormat modules not being available (by not
Jack Jansen [Tue, 4 Feb 2003 15:36:42 +0000 (15:36 +0000)]
- Handle the img and MediaFormat modules not being available (by not
providing the format info, only the raw data).
- Get rid of fsspecs.
- Make the demo program at least do something if img not available.

21 years agoChanged an edit instruction because of a changed parameter name (sigh).
Jack Jansen [Tue, 4 Feb 2003 15:35:07 +0000 (15:35 +0000)]
Changed an edit instruction because of a changed parameter name (sigh).

21 years agoUpdate to better reflect the usage of struct_time instances throughout;
Fred Drake [Tue, 4 Feb 2003 15:12:06 +0000 (15:12 +0000)]
Update to better reflect the usage of struct_time instances throughout;
continuing to call these "time tuples" is misleading at best.
Closes SF bug #671731; will backport to 2.2.x.

21 years agoTwiddle.
Fred Drake [Tue, 4 Feb 2003 15:01:37 +0000 (15:01 +0000)]
Twiddle.

21 years agoAdd refcount test.
Raymond Hettinger [Tue, 4 Feb 2003 05:47:30 +0000 (05:47 +0000)]
Add refcount test.

21 years agoTypo in comment.
Tim Peters [Tue, 4 Feb 2003 05:20:32 +0000 (05:20 +0000)]
Typo in comment.

21 years agocPickle can load pickles using proto 2 EXT[124] now, but can't yet
Tim Peters [Tue, 4 Feb 2003 05:06:17 +0000 (05:06 +0000)]
cPickle can load pickles using proto 2 EXT[124] now, but can't yet
generate these opcodes.

21 years agoRename the extension registry variables to have leading underscores --
Guido van Rossum [Tue, 4 Feb 2003 01:54:49 +0000 (01:54 +0000)]
Rename the extension registry variables to have leading underscores --
this clarifies that they are part of an internal API (albeit shared
between pickle.py, copy_reg.py and cPickle.c).

I'd like to do the same for copy_reg.dispatch_table, but worry that it
might be used by existing code.  This risk doesn't exist for the
extension registry.

21 years agoWhitespace normalization.
Tim Peters [Tue, 4 Feb 2003 00:38:20 +0000 (00:38 +0000)]
Whitespace normalization.

21 years agoTypo repair.
Tim Peters [Tue, 4 Feb 2003 00:30:46 +0000 (00:30 +0000)]
Typo repair.

21 years agoBrought some module variables into synch with pickle.py's current values.
Tim Peters [Tue, 4 Feb 2003 00:21:07 +0000 (00:21 +0000)]
Brought some module variables into synch with pickle.py's current values.
Imported the extension-registry dicts from copy_reg.py, in preparation for
tackling EXT[124].

21 years agoFix typo.
Walter Dörwald [Mon, 3 Feb 2003 23:05:27 +0000 (23:05 +0000)]
Fix typo.