Commit Graph

8721 Commits

Author SHA1 Message Date
Raymond Hettinger 6229713221 Eliminate unnecessary eval() in tests 2003-08-30 01:24:19 +00:00
Raymond Hettinger a56f6b6600 SF bug #793826: using itertools.izip to mutate tuples
Avoid Armin Rigo's dastardly exercise in re-entrancy.
2003-08-29 23:09:58 +00:00
Andrew M. Kuchling b738041c5d Rework previous fix slightly; the &0x20 test seems useless, and the isprint() check mustn't prevent the meta-bit check at the end 2003-08-29 18:50:59 +00:00
Andrew M. Kuchling e8792c1f65 Add tests for meta- bit set 2003-08-29 18:49:05 +00:00
Andrew M. Kuchling 72cdb70296 [Bug #790356] unctrl() doesn't work for full printable charset. Fix by Dave Cinege. 2003-08-29 18:40:03 +00:00
Andrew M. Kuchling e752e20605 Add simple unit test for ascii.unctrl() function 2003-08-29 18:37:37 +00:00
Andrew M. Kuchling ff638ea6db [Bug #776542] open_https() generates a bad Authorization header because it calls .putheader() wrongly. Reported by Steffen Ries. 2003-08-29 18:12:23 +00:00
Brett Cannon 953c6f508b Make sure parentheses are escaped when used in the format string.
Closes bug #796149 .  Will be backported.
2003-08-29 02:28:54 +00:00
Gregory P. Smith 6676f6edc1 Support DBEnv.set_shm_key() to allow multi-threaded multi-process
database environments to use shared memory on systems supporting it.
2003-08-28 21:50:30 +00:00
Jeremy Hylton ead21f596c Fix SF bug [ 788011 ] compiler.compileFile fails on csv.py
Bug fix candidate.
2003-08-28 02:09:26 +00:00
Thomas Heller 4651f53949 Fix typo in docstring: The switch is '-x', not '-s'.
Will backport to 2.3 myself.
2003-08-27 20:19:35 +00:00
Thomas Heller 611dbc338e Remove a typo. (Or is this some markup I don't understand? ;-) 2003-08-27 10:48:12 +00:00
Raymond Hettinger 9bfe533c69 SF bug #795506: Wrong handling of string format code for float values.
Adding missing support for '%F'.

Will backport to 2.3.1.
2003-08-27 04:55:52 +00:00
Jason Tishler 063606a0d5 test_largefile can leave its temp file open if one of many tests fail. On
platforms (e.g., Cygwin) that are "particular" about open files, this will
cause other regression tests that use the same temp file to fail:

    $ ./python.exe -E -tt Lib/test/regrtest.py -l
    test_largefile test_mmap test_mutants
    test_largefile
    test test_largefile failed -- got -1794967295L, but expected 2500000001L
    test_mmap
    test test_mmap crashed -- exceptions.IOError: [Errno 13] Permission denied: '@test'
    test_mutants
    test test_mutants crashed -- exceptions.IOError: [Errno 13] Permission denied: '@test'

This patch solves the problem by adding missing "try/finally" blocks. Note
that the "large" size of this patch is due to many white space changes --
otherwise, the patch is small.

I tested this patch under Red Hat Linux 8.0 too.
2003-08-26 11:59:27 +00:00
Barry Warsaw c86c24e44d Bump the version number for the standalone mimelib package. 2003-08-19 04:05:25 +00:00
Barry Warsaw 622d60b5a2 test_rfc2231_no_language_or_charset_in_filename(),
test_rfc2231_no_language_or_charset_in_boundary(),
test_rfc2231_no_language_or_charset_in_charset(): New tests for proper
decoding of some RFC 2231 headers.

Backport candidate (as was the Utils.py 1.25 change) to both Python
2.3.1 and 2.2.4 -- will do momentarily.
2003-08-19 03:54:24 +00:00
Barry Warsaw 6208369ff3 get_param(): Update the docstring to explain how CHARSET and LANGUAGE
can be None, and what to do in that situation.

get_filename(), get_boundary(), get_content_charset(): Make sure these
handle RFC 2231 headers without a CHARSET field.

Backport candidate (as was the Utils.py 1.25 change) to both Python
2.3.1 and 2.2.4 -- will do momentarily.
2003-08-19 03:53:02 +00:00
Barry Warsaw 0b6f0d8810 decode_rfc2231(): We need to urllib.unquote() the value even if the
charset and language fields are not present, e.g. as in:

    title*0="This%20is%20encoded"
2003-08-19 03:49:34 +00:00
Raymond Hettinger 6a1801271a Improvements to set.py:
* Relaxed the argument restrictions for non-operator methods.  They now
  allow any iterable instead of requiring a set.  This makes the module
  a little easier to use and paves the way for an efficient C
  implementation which can take better advantage of iterable arguments
  while screening out immutables.

* Deprecated Set.update() because it now duplicates Set.union_update()

* Adapted the tests and docs to include the above changes.

* Added more test coverage including testing identities and checking
  to make sure non-restartable generators work as arguments.

Will backport to Py2.3.1 so that the interface remains consistent
across versions.  The deprecation of update() will be changed to
a FutureWarning.
2003-08-17 08:34:09 +00:00
Raymond Hettinger 1954035a47 Keep doctests in sync with the docs. 2003-08-16 00:59:59 +00:00
Raymond Hettinger ee562fc084 Make sets.py compatible with Py2.2 2003-08-15 21:17:04 +00:00
Walter Dörwald c8cb5d9d69 Make a copy of L before appending, so the global L remains
unchanged (and sys.gettotalrefcount() remains constant).

Fix a few typos.
2003-08-15 17:52:39 +00:00
Michael W. Hudson b2c7de4667 Fix for
[ 784825 ] fix obscure crash in descriptor handling

Should be applied to release23-maint and in all likelyhood
release22-maint, too.

Certainly doesn't apply to release21-maint.
2003-08-15 13:07:47 +00:00
Kurt B. Kaiser b785518d05 IDLE didn't start correctly when Python was installed in "Program Files"
on W2K and XP.  Python Bugs 780451, 784183

Backported to 2.2-maint
2003-08-14 14:54:28 +00:00
Andrew M. Kuchling 69f31eb80c [Patch #739124] Add use_default_colors() to curses module 2003-08-13 23:11:04 +00:00
Walter Dörwald a54b92b2eb Add a unicode prefix to the characters in the UnicodeEncodeError and
UnicodeTranslateError message.
2003-08-12 17:34:49 +00:00
Walter Dörwald fd196bd263 Enhance message for UnicodeEncodeError and UnicodeTranslateError.
If there is only one bad character it will now be printed in a
form that is a valid Python string.
2003-08-12 17:32:43 +00:00
Brett Cannon c83124ab79 Fix bug in test_bad_timezone where test was assuming locale knew of PDT. 2003-08-11 19:06:13 +00:00
Andrew M. Kuchling b2f89ee71a Comment typo fixes 2003-08-11 16:20:39 +00:00
Jason Tishler 0fd54d8050 Unconditionally opening the temp file in text mode causes this test to fail
under Cygwin. The attached patch corrects this problem.

I tested this patch under Red Hat Linux 8.0 too.
2003-08-11 12:13:14 +00:00
Jack Jansen a290e3d7c6 Bug fix for #780461: 'sysu' gestalt selector is meaningless on MacOSX,
but attempting to get it resulted in a crash. Fixed. Backport candidate.
2003-08-11 11:08:49 +00:00
Brett Cannon 5187a3bcdb Fix handling of bad locale setup where time.tzname[0] == time.tzname[1] and
time.daylight is true.  Add an explicit test for this situation.

Fixed some wording in docstrings.
2003-08-11 07:24:05 +00:00
Raymond Hettinger 3081d59f92 SF bug #778964: bad seed in python 2.3 random
The default seed is time.time().
Multiplied by 256 before truncating so that fractional seconds are used.
This way, two successive calls to random.seed() are much more likely
to produce different sequences.
2003-08-09 18:30:57 +00:00
Martin v. Löwis 39a682f5f2 Add HIDDEN. Fixes #777664. 2003-08-09 09:53:51 +00:00
Raymond Hettinger cffb9dee67 SF patch #747364: BaseHTTPServer doesn't need StringIO intermediary
(Contributed by Andrew Dalke.)
2003-08-09 05:01:41 +00:00
Kurt B. Kaiser 3f42a6d267 IDLEfork Bug 782759
backported to 23-maint
2003-08-09 01:51:28 +00:00
Raymond Hettinger 5475f2394a SF bug #770485: cStringIO does not set closed attr 2003-08-08 12:20:03 +00:00
Raymond Hettinger b5a420883c Modified itertools.izip() to match the behavior of __builtin__.zip()
which can now take zero arguments.
2003-08-08 05:10:41 +00:00
Raymond Hettinger 77fe69bd08 Re-sync doc tests with the doc updates. 2003-08-08 04:33:19 +00:00
Brett Cannon f5c96fb74d Fix docstring in LocaleTime. 2003-08-08 01:53:05 +00:00
Michael W. Hudson e723e453a1 Repair refcounting on error return from type_set_bases.
Include a test case that failed for one of my efforts to repair this.
2003-08-07 14:58:10 +00:00
Mark Hammond 7edd0a9b21 Demonstrate and fix [ 783882 ] os.lstat crashes with Unicode filename.
Will also check in on the 2.3 branch.
2003-08-06 02:46:58 +00:00
Walter Dörwald 5301d9c10d Remove useless import. 2003-08-05 15:55:38 +00:00
Walter Dörwald b27cca6634 Check both __div__ and __truediv__ in division tests.
(From SF patch #543867)
2003-08-05 15:34:34 +00:00
Raymond Hettinger f8a52d38ad Removed deprecated functions 2003-08-05 12:23:19 +00:00
Martin v. Löwis 0d8e16c7ad Support trailing dots in DNS names. Fixes #782510. Will backport to 2.3. 2003-08-05 06:19:47 +00:00
Martin v. Löwis 8db4403a76 Correct URL of normalization file. Fixes #781065. Will backport to 2.3. 2003-08-05 05:59:13 +00:00
Martin v. Löwis 249d50a25f Make sure eol_convention is an ASCII string. Fixes #774680.
Will backport to 2.3.
2003-08-05 05:51:20 +00:00
Brett Cannon 474335ce17 Re-introduce caching of TimeRE and compiled regexes with added thread-safety.
Also remove now unnecessary property attributes for thread safety
(no longer have lazy attributes) and code simplicity reasons.

Timezone storage has been reworked to be simpler and more flexible.  All values
in LocaleTime instances are lower-cased.  This is all done to simplify the
module.

The module now assumes nothing beyond the strptime function will be exposed for
general use beyond providing functionality for strptime.
2003-08-05 04:02:49 +00:00
Brett Cannon 8ab27dfa13 Touch-up to docstrings. 2003-08-05 03:52:04 +00:00
Skip Montanaro ed9bf12848 protect against test problems with Jython 2003-08-03 23:30:40 +00:00
Skip Montanaro d5cf0b86df added test for bug 782369 2003-08-03 23:02:10 +00:00
Skip Montanaro c1b4154587 more extension marshal tests and conversion to unittest - was surprised to
see how much of the file was not covered by the build process
2003-08-02 15:02:33 +00:00
Raymond Hettinger eaef615116 As discussed on python-dev, changed builtin.zip() to handle zero arguments
by returning an empty list instead of raising a TypeError.
2003-08-02 07:42:57 +00:00
Kurt B. Kaiser 220fecf0f4 Added a banner to the shell startup message discussing possible
warnings from personal firewall software.  Added the same text
to README.txt, updated NEWS.txt for release.

M NEWS.txt
M PyShell.py
M README.txt
2003-07-27 03:24:19 +00:00
Kurt B. Kaiser 7fbc3046df Update for release. 2003-07-27 00:56:41 +00:00
Brett Cannon 2c24d42d32 Fixes bug of having default argument for TimeRE's __init__ that caused the
LocaleTime instance to only be created once and thus not be recreated when
the locale changed.
2003-07-24 20:02:28 +00:00
Brett Cannon 175ddb5b30 Remove caching of TimeRE (and thus LocaleTime) instance. Error was being
caught when executing test_strptime, test_logging, and test_time in that order
when the testing of "%c" occured.  Suspect the cache was not being recreated
(the test passed when test_logging was forced to re-establish the locale).
2003-07-24 06:27:17 +00:00
Kurt B. Kaiser 6145a624b8 1. Python Bug 775541: Calltips error when docstring is None. Introduced
by patch 769142.  Fixed by patch 776062. KBK will backport net result
   to IDLE release22-maint and IDLEfork.
2. Update NEWS.txt and idlever for release.
2003-07-23 15:42:14 +00:00
Tim Peters 5943b4ac10 Restored commented-out line checked in by mistake. 2003-07-23 00:30:39 +00:00
Tim Peters 9390dd5b4a locale-restoration code: Don't leave comparison to None implicit. For
all I know, the original locale may be '' (I don't think that's possible,
but ...), and if so we would certainly want to restore it.
2003-07-23 00:30:11 +00:00
Tim Peters 36f7e938f2 Fred wasn't kidding -- there really are docs for the locale module <wink>.
Obtain the original locale in the documented way.  This way actually
works for me.

Restore the original locale at the end, instead of forcing to "C".

Move the locale fiddling into the test driver instead of doing it as a
side effect of merely importing the module.  I don't know why the test
is mucking with locale (and also added a comment saying so), but it
surely has no justification for doing that as an import side-effect.
Now whenever the locale-changing code executes, the locale-restoring code
will also get run.
2003-07-23 00:05:07 +00:00
Brett Cannon d1deac06e7 Fix error in test of not comparing against 0 item of a list 2003-07-22 21:07:16 +00:00
Jason Tishler c23f39ca9d Patch #775784: YA Cygwin expected regression test skip patch
This patch just adds test_ioctl to the list of expected skips for Cygwin.
2003-07-22 18:35:58 +00:00
Thomas Heller 354e3d90d3 Change the zipimport implementation to accept files containing
arbitrary bytes before the actual zip compatible archive.  Zipfiles
containing comments at the end of the file are still not supported.

Add a testcase to test_zipimport, and update NEWS.

This closes sf #775637 and sf #669036.
2003-07-22 18:10:15 +00:00
Skip Montanaro 5d6ceb4aae more generic reference to python interpreter 2003-07-22 14:37:42 +00:00
Tim Peters 291f14e3d3 Windows fix: When PYTHONCASEOK is set, or for any other reason imports
are satisfied in a case-insensitive manner, the attempt to import (the
non-existent) fcntl gets satisfied by FCNTL.py instead, and the tempfile
module defines a Unix-specific _set_cloexec() function in that case.  As
a result, temp files can't be created then (blows up with an AttributeError
trying to reference fcntl.fcntl).  This just popped up in the spambayes
project, where there is no apparent workaround (which is why I'm pushing
this in now).
2003-07-22 02:50:01 +00:00
Barry Warsaw e3ea281280 readerThread(): Add max_retries to both DeadlockWrap() calls. This
may cause some tests to fail but it prevents them from hanging.
2003-07-21 23:01:34 +00:00
Jack Jansen 749f481478 Backport from r23c1-branch:
Pimp crashed if you tried to install a non-installable package, in stead
of printing a decent error message. Fixes #773450..
2003-07-21 20:47:11 +00:00
Barry Warsaw e676c5ef3e test01_join(): Fix a test failure when run with "python -O". The
setting of sCursor happened in an assert.
2003-07-21 18:43:33 +00:00
Jeremy Hylton 6d58bf69ee Repair operator error. 2003-07-18 17:45:33 +00:00
Jeremy Hylton bdf3b509ed SF patch 773476: NameError when there are no prefixes. 2003-07-18 17:24:07 +00:00
Just van Rossum a920a8895e up the b/w compatibility requirement to 2.2 2003-07-18 15:31:40 +00:00
Jeremy Hylton 969a7003f9 Make sure mimetypes is reinitialized before running the tests.
If some other test comes along and uses mimetypes, it will be
initialized from the system files.
2003-07-18 15:13:37 +00:00
Jeremy Hylton 096d986f3b Restore the locale to "C" on exit.
If this doesn't happen, it leaves the locale in a state that can cause
other tests to fail.  For example, running test_strptime,
test_logging, and test_time in that order.
2003-07-18 03:19:20 +00:00
Jeremy Hylton bd9f520907 Reflow long line. 2003-07-17 16:31:00 +00:00
Just van Rossum 2d4e988c35 back out the darwin supports_unicode_filenames patch; it causes deep problems with the tests 2003-07-17 15:11:49 +00:00
Jeremy Hylton e9a92aa03a Patch from John Anderson to enable VC 7.1 support.
I tested against VC 7.0 and it caused no problems there.
2003-07-17 14:41:07 +00:00
Raymond Hettinger 71adf7e9d8 Doctest now examines all docstrings by default. Previously, it would
skip over functions with private names (as indicated by the underscore
naming convention).  The old default created too much of a risk that
user tests were being skipped inadvertently.  Note, this change could
break code in the unlikely case that someone had intentionally put
failing tests in the docstrings of private functions.  The breakage
is easily fixable by specifying the old behavior when calling testmod()
or Tester().  The more likely case is that the silent failure was
unintended and that the user needed to be informed so the test could be
fixed.
2003-07-16 19:25:22 +00:00
Raymond Hettinger 43d790c087 Exercise Jim Fulton's new doctest extension for running doctests in a
unittest environment.  Since his extension finds docstrings in private
functions, it exposed a bug in the difflib doctests.
2003-07-16 04:34:56 +00:00
Raymond Hettinger 83325e9087 Fix faulty doctests. There is no results attribute.
Note, these tests were not getting exercised because
doctest skips over private functions.
2003-07-16 04:32:32 +00:00
Raymond Hettinger f3590623e9 Extend last change to cover TestSuites as well as TestCases. 2003-07-16 04:29:42 +00:00
Mark Hammond bb4a47c818 Prevent failure on the mac, where "mbcs" is not the file system
encoding.  Use sys.getfilesystemencoding().
2003-07-16 03:46:38 +00:00
Kurt B. Kaiser cca912279a Update to reflect the current status of the configuration system.
Extensions must still be configured manually and there is currently one
set of extension key bindings for all platforms.

Bring NEWS.txt up to date.

Update CREDITS.txt and idlever.py for release.

M NEWS.txt
M config-extensions.def
M extend.txt
M help.txt
M idlever.py
2003-07-16 03:10:43 +00:00
Raymond Hettinger 21d9987cb5 run_unittest() to support TestCase instances as well as classes. Helps with doctests. 2003-07-16 02:59:32 +00:00
Raymond Hettinger 19db13bcc7 Fixed test and converted to unittest format.
Checking // would call floor division but did not test that
true division had become the default with 'from __future__ import division'.
2003-07-15 21:03:13 +00:00
Raymond Hettinger 158af581ae Fixed test and converted to unittest format.
Checking // would call floor division but did not test that
true division had become the default with 'from __future__ import division'.
2003-07-15 20:57:35 +00:00
Jeremy Hylton 42d90161e2 SF patch 763201: handling of SyntaxErrors in symbol table build
Bug fix candidate.
2003-07-15 20:24:27 +00:00
Walter Dörwald f393fc6e51 Add various test cases from SF patch 543867. 2003-07-15 18:47:27 +00:00
Walter Dörwald c171172614 Make the prefix 7 spaces long, so the lines are properly aligned. 2003-07-15 10:34:02 +00:00
Fred Drake f425b1ec42 stylistic nits:
- wrap some long lines
- shorten others
- fix indentation
2003-07-14 21:37:17 +00:00
Skip Montanaro 6d06815b56 Give dumbdbm a sync() method which Shelve can call. Should solve some
database corruption problems with Spambayes.
2003-07-14 12:15:15 +00:00
Raymond Hettinger 92f200b569 SF bug #770601: CGIHTTPServer and environment variables (bug + solution)
(contributed by Vincent Delft.)

The script updated os.environ but failed to pass the whole environment
to the child process (the CGI script).
2003-07-14 06:56:32 +00:00
Tim Peters 7a6c733c3b Make close() identical to __del__() for a dumbdbm database. Make
closing idempotent (it used to raise a nuisance exception on the 2nd
close attempt).

Bugfix candidate?  Probably, but arguable.
2003-07-13 17:21:10 +00:00
Raymond Hettinger 4a4296ec29 SF patch #765238: fix fnmatch.__all__
(Contributed by George Yoshida.)
2003-07-13 16:06:26 +00:00
Skip Montanaro ae5c37b7b3 delete unused local variable (pychecker caught) 2003-07-13 15:18:12 +00:00
Raymond Hettinger 61bfb736b4 SF bug #769142: CallTip trimming may loop forever.
Needs to be backported to both IDLE and IDLEFORK.
2003-07-13 10:25:14 +00:00
Raymond Hettinger d6f6e50c9b Reworked test_warnings.py:
* It ran fine under "python regrtest.py test_warnings" but failed under
  "python regrtest.py" presumably because other tests would add to
  filtered warnings and not reset them at the end of the test.

* Converted to a unittest format for better control.  Renamed
  monkey() and unmonkey() to setUp() and tearDown().

* Increased coverage by testing all warnings in __builtin__.

* Increased coverage by testing regex matching of specific messages.
2003-07-13 08:37:40 +00:00
Raymond Hettinger dc9dcf135e This test failed on WindowsME because the full file path did not get
reported consistently with the *nix world.  'Lib/test/test_warnings.py'
came out as 'lib\test\test_warnings.py'.  The basename is all we care
about so I used that.
2003-07-13 06:15:11 +00:00
Tim Peters 0320464583 Repaired typos in comments. 2003-07-13 02:37:05 +00:00
Tim Peters d7472ec13a Fixed critical shutdown race in _Database._commit.
Related to SF patch 723231 (which pointed out the problem, but didn't
fix it, just shut up the warning msg -- which was pointing out a dead-
serious bug!).

Bugfix candidate.
2003-07-13 02:22:03 +00:00
Tim Peters 1d8d729af8 More comments about why not closing a dumddbm properly can be a disaster. 2003-07-13 02:05:47 +00:00
Raymond Hettinger 4a6302b6fe SF 748201: time.strptime() should display format and date on error
Usability fix.  Makes the error message more helpful.
2003-07-13 01:31:38 +00:00
Tim Peters 3898a70bcf _commit(): Modernization. 2003-07-12 20:23:09 +00:00
Tim Peters 7dfd5701b2 There's a persistent rumor on the spambayes mailing list that dumbdbm
databases are associated with corruption problems, so I studied this code
carefully and ran some brutal stress tests.  I didn't find any bugs,
although it's unclear whether this code *intends* that __setitem__ can
leave the directory file out of synch with the data file (so
if a dumbdbm isn't properly closed, and the value of an existing key
was ever replaced, corruption is almost certain, where "corruption"
means the directory file is out of synch with the data file).

Added many comments and generally modernized the code.  Examples of the
latter:  we have better ways of reading a whole file line-by-line now;
eval() now tolerates a trailing newline; the %r format code can be used
to avoid explicit repr/backtick calls; and the code often broke tuples
into their components when it was clearer and faster to just leave them
as tuples.
2003-07-12 20:11:25 +00:00
Martin v. Löwis 541342f82c Patch #764470: Fix marshalling of faults. Will backport to 2.2. 2003-07-12 07:53:04 +00:00
Martin v. Löwis 162f081fb3 Patch 549151, rev4: redirect posts for 301 also. Will backport to 2.2. 2003-07-12 07:33:32 +00:00
Raymond Hettinger cc39a13d6d Expose the 'master' instance mentioned in the docs. 2003-07-11 22:36:52 +00:00
Jeremy Hylton b6d2f3e07d Don't include slash in search string; it's OS-specific. 2003-07-11 20:22:55 +00:00
Jeremy Hylton 8501466c7f Change warnings to avoid importing re module during startup.
Add API function simplefilter() that does not create or install
regular expressions to match message or module.  Extend the filters
data structure to store None as an alternative to re.compile("").

Move the _test() function to test_warnings and add some code to try
and avoid disturbing the global state of the warnings module.
2003-07-11 15:37:59 +00:00
Andrew MacIntyre a1e93e8dfc patch #766650 - whichdb not identifying dbm DBs when dbm linked with gdbm
At this point, the problem appears particular to the OS/2 EMX port of
gdbm (which is at v1.7.3) - this combination produces a .pag file but
no .dir file.

A more sophisticated patch which checks magic numbers when dbm.library
indicates that dbm is linked to gdbm, and there is no .dir file, is
still attached to the above patch entry for reconsideration after 2.3
is released.

This checkin applies a workaround specific to the known failure case.
2003-07-11 12:16:48 +00:00
Just van Rossum c4bf893952 [ 767645 ] correctly set the os.path.supports_unicode_filenames flag for OSX 2003-07-11 07:36:49 +00:00
Tim Peters ef6573e529 __setitem__: Use integer division for computing # of blocks. 2003-07-11 04:09:55 +00:00
Tim Peters 663d1b61cb Added a new randomized test. 2003-07-11 04:09:09 +00:00
Just van Rossum ed8bfce002 Fixed a bug that's been there from the beginning but wasn't noticed
until now: the inheritance of default values was the wrong way around.
This caused app bundles to get a type of "BNDL" instead of "APPL".
Apparently this is not a problem until you try to drag your app to
the dock.
----------------------------------------------------------------------
2003-07-10 14:53:27 +00:00
Just van Rossum 87316ec962 don't optimize empty strings 2003-07-10 14:26:06 +00:00
Jeremy Hylton aefae5570d Fix wrong header name. The framework looks for auth_header. 2003-07-10 13:30:12 +00:00
Andrew MacIntyre 71d74e87cb Extend the pwd & grp emulations to support accessing the pwd/grp
record tuple by name as well as index, to match the behaviour of
the pwd/grp extension modules for Unix.  These emulation modules
now pass test_pwd & test_grp.
2003-07-10 12:52:54 +00:00
Raymond Hettinger 931237e2e6 SF patch #768187: replace apply(f, args, kwds) with f(*args, **kwds) 2003-07-09 18:48:24 +00:00
Gregory P. Smith ad30fa03a4 fix to work on python <= 2.1 2003-07-09 05:33:14 +00:00
Gregory P. Smith df35beed40 bugfix: proper import bsddb exists below 2003-07-09 05:29:24 +00:00
Gregory P. Smith 455d46f0d9 bsddb 4.1.6:
* Extended DB & DBEnv set_get_returns_none functionality to take a
   "level" instead of a boolean flag.  The boolean 0 and 1 values still
   have the same effect.  A value of 2 extends the "return None instead
   of raising an exception" behaviour to the DBCursor set methods.
   This will become the default behaviour in pybsddb 4.2.
 * Fixed a typo in DBCursor.join_item method that made it crash instead
   of returning a value.  Obviously nobody uses it.  Wrote a test case
   for join and join_item.
2003-07-09 04:45:59 +00:00
Kurt B. Kaiser bea57c6c35 SF Bug 767794
"Break or continue outside loop causes crash"
2003-07-09 04:27:24 +00:00
Jeremy Hylton 121d34af19 Fix SF bug 764095: Don't use network in test_httplib. 2003-07-08 12:36:58 +00:00
Fred Drake b5aa407196 Use Boolean values for the capturestderr flag. 2003-07-07 21:36:19 +00:00
Jeremy Hylton d7ce86dcab Patch from Zooko to remove an experimental feature. 2003-07-07 16:08:47 +00:00
Tim Peters e5e065b669 New function sys.getcheckinterval(), to complement setcheckinterval(). 2003-07-06 18:36:54 +00:00
Just van Rossum be56aae36a #765903:
- added bundle_id/--bundle-id option, to specify the CFBundleIndentifier
#765615:
- in the appropriate situation, prepend $PATH with our path instead of
  setting it.
2003-07-04 14:20:03 +00:00
Jack Jansen bbaa083745 If a --python option is used to specify the Python to use in the #!
line also use this as the executable in the bundle.
2003-07-04 11:05:35 +00:00
Brett Cannon cde2200ff2 Fixes bug of timezone value being left as -1 when ``time.tzname[0] ==
time.tzname[1] and not time.daylight`` is true when it should only when
time.daylight is true.  Tests are also fixed.

Closes bug #763047 and its cohort #763052.
2003-07-03 19:59:57 +00:00
Just van Rossum 74902508dc Addendum to #764548: restore 2.1 compatibility. 2003-07-02 21:37:16 +00:00
Just van Rossum 12723bacea Fix and test for bug #764548:
Use isinstance() instead of comparing types directly, to enable
subclasses of str and unicode to be used as patterns.
Blessed by /F.
2003-07-02 20:03:04 +00:00
Just van Rossum 6802c6e764 fixed typo in comment 2003-07-02 14:36:59 +00:00
Andrew MacIntyre 348c261fe6 On those systems lacking the AFMT_S16_NE symbol, the test was failing
because it was still looking in the ossaudiodev module namespace for
this symbol.

As the symbol has already been rebound as a global, use that instead.
2003-07-02 14:05:08 +00:00
Neal Norwitz b7f6810a1f SF #764121, docstring for spawnlp incorrect 2003-07-02 02:49:33 +00:00
Neal Norwitz 3c0f2c91ad Fix SF bug #763637, 2.3b2 unpack tuple of wrong size in after_cancel
Tk 8.4 may return different values than 8.3.  This fix should handle
either version.
2003-07-01 21:12:47 +00:00
Just van Rossum bcc58e87e8 - added (c)StringIO tests; cStringIO usage failed in the previous
version of plistlib.py (r1.2)
2003-07-01 20:22:30 +00:00
Just van Rossum 94af32e244 - replaced a couple of asserts with proper exceptions
- use isinstance instead of flaky file-detection code
2003-07-01 20:15:38 +00:00
Tim Peters 59aba128a5 Make the classes exposed by threading.py new-style classes. This is
mostly for convenience and to aid debugging.
2003-07-01 20:01:55 +00:00
Tim Peters 0939fac795 Resolved minor XXX question in the obvious way. 2003-07-01 19:28:44 +00:00
Neal Norwitz e7dfe21bed Fix SF bug #763023, difflib.py: ratio() zero division not caught
Backport candidate
2003-07-01 14:59:46 +00:00
Tim Peters 37ca8c12dc connector(): You can't use an empty string as an argument to connect()
on Windows.
2003-07-01 14:49:32 +00:00
Neal Norwitz 1787a0b1cc Fix SF bug #763770, test_socket_ssl crash
Don't run any tests if there is no ssl support.
2003-07-01 13:44:28 +00:00
Raymond Hettinger cc0a664669 Test Brett's addition of __all__ to Queue. 2003-07-01 05:49:02 +00:00
Brett Cannon b42bb5a88a Add __all__ . 2003-07-01 05:34:27 +00:00
Neal Norwitz 168e73d25e Fix SF #763362, test_posixpath failed
Don't check expanduser('~') if the home directory == the root directory
(ie, we are running as root).
2003-07-01 03:33:31 +00:00
Neal Norwitz 3106817c68 Fix typo in error message 2003-06-30 19:22:12 +00:00
Walter Dörwald 8bcbe6aa7e Don't require that a RuntimeError is raised when playing a second
sound while the first one is still running, as the first one
one might already have finished.

Fixes part of SF bug #763052.
2003-06-30 11:57:52 +00:00
Raymond Hettinger d693a81595 Fix SF 762891: "del p[key]" on proxy object raises SystemError() 2003-06-30 04:18:48 +00:00
Neal Norwitz a9002f824b Fix SF #754870, SSL crash interpreter when remote side closes during connect
Also fix a memory leak.
2003-06-30 03:25:20 +00:00
Just van Rossum 79b0ae12fd restore 2.2 compatibility:
- don't use "abc" in aString
- don't reorganize extension modules when not using zipimport
2003-06-29 22:20:26 +00:00
Just van Rossum 762d2cce6f - added --semi-standalone option that builds apps that depend on an
installed Python, yet include any modules not in the std lib
- reworked extension module inclusion code: put all .so files in
  a subdirectory of Contents/Resources/, but more importantly,
  correctly support extensions that are submodules.
2003-06-29 21:54:12 +00:00
Raymond Hettinger 0242070d04 More tests
* Test with infinite inputs (using take() on the output)
* Test whether GC can find and eliminate cycles.
2003-06-29 20:36:23 +00:00
Jeremy Hylton b67695238d Fix sf bug 666219: assertion error in httplib.
The obvious way for this assertion to fail is if the LineAndFileWrapper constructor is called when an empty line.  Raise a BadStatusError before the call.
2003-06-29 17:55:05 +00:00
Tim Peters d1b108b953 Whitespace normalization. 2003-06-29 17:24:17 +00:00
Jeremy Hylton 89392c0005 Remove stub settrace() and setprofile() calls. 2003-06-29 17:07:46 +00:00
Jeremy Hylton e3a565eed0 Fix grammar in comment. 2003-06-29 16:59:59 +00:00
Jeremy Hylton 97b2e84d43 Whitespace normalization. 2003-06-29 16:59:43 +00:00
Jeremy Hylton bfccb35b58 Add settrace() and setprofile() functions to the threading library. 2003-06-29 16:58:41 +00:00
Tim Peters 685e69739e Provide dummy (do-nothing) settrace() and setprofile() functions until
Jeremy can check in the real things.
2003-06-29 16:50:06 +00:00
Raymond Hettinger b4e9986782 Removed invalid test.
Analysis by Bob Halley:

  The test seems to expect that if time.daylight is true, then the
  is_dst field of the tm structure will be 1 too.  But this isn't
  the case, since daylight is true if the timezone does DST, *not*
  if DST is in effect.
2003-06-29 15:57:50 +00:00
Raymond Hettinger 2b6220d88b SF bug #762455: Python segfaults when sys.stdout is changed in getattr
* Added unittest that fails before, but not after Neil's fix to ceval.c.
2003-06-29 15:44:07 +00:00
Tim Peters 478c10554b Whitespace normalization. 2003-06-29 05:46:54 +00:00
Tim Peters db3756dade Some nifty doctest extensions from Jim Fulton, currently used in Zope3.
I won't have time to write real docs, but spent a lot of time adding
comments to his code and fleshing out the exported functions' docstrings.
There's probably opportunity to consolidate how docstrings get extracted
too, and the new code for that is probably better than the old code for
that (which strained mightily to recover from 2.2's new class/type
gimmicks).
2003-06-29 05:30:48 +00:00
Raymond Hettinger e2f18377ff SF bug #430160: CGIHTTPServer.py POST bug using IE
Minor improvement to previous bugfix.
Eating the remaining characters would lead to an endless loop
without a termination test.
2003-06-29 05:06:56 +00:00
Neal Norwitz bc05fc5d2b Add missing self. before curNode. This may need to be committed
to PyXML, I'm not sure of the procedure.
2003-06-29 04:50:34 +00:00
Raymond Hettinger 11a35f545b SF patch #760257: add socket.timeout exception
(Contributed by Bob Halley)

Add unittests for the new socket.timeout exception.
2003-06-29 04:40:22 +00:00
Neal Norwitz 10f3018023 Fix arguments for instantiating InterpolationSyntaxError 2003-06-29 04:23:35 +00:00
Neal Norwitz b207170d39 Comment out cap, it was unused.
Should all the commented out code be removed?
2003-06-29 04:21:43 +00:00
Neal Norwitz 3f401f07e8 whitespace normalization 2003-06-29 04:19:37 +00:00
Neal Norwitz c556722f09 remove unused import math 2003-06-29 04:18:15 +00:00
Neal Norwitz 9b924c690e remove extra parameter from _java_getprop, remove duplicate imports 2003-06-29 04:17:45 +00:00
Neal Norwitz 77290f25f3 use == like all the other conditionals 2003-06-29 04:16:49 +00:00
Neal Norwitz 732911fd1e fix problems found by pychecker 2003-06-29 04:16:28 +00:00
Tim Peters 275abbd525 Missed a spot where the new optional optionflags argument needed to get
passed on.
2003-06-29 03:11:20 +00:00
Jack Jansen c5991b0c02 Use http://www.python.org/packman as the base URL. Also upped the version
number because of this.
2003-06-29 00:09:18 +00:00
Raymond Hettinger 2dd1ed69b4 SF 662923: iterator for dbm keys
When shelve and the bsdbm where expanded to a full mapping interface,
this module was missed.
2003-06-28 07:08:39 +00:00
Raymond Hettinger 3567a876c7 Add take() to examples. Tighten the islice() example 2003-06-28 05:44:36 +00:00
Raymond Hettinger c0fac96c29 SF patch #756996: Bare except in ZipFile.testzip()
(Contributed by Steven Taschuk)

Replaces a bare except that caused all errors to be mis-reported as
archive errors.

Added a related NEWS item.
2003-06-27 22:25:03 +00:00
Raymond Hettinger 6f3eaa67e5 SF patch #761519: Fixes for bugs 760703 and 757821
SF bug #760703: SocketHandler and LogRecord don't work well together
SF bug #757821: logging module docs

Applied Vinay Sajip's patch with a few minor fixups and a NEWS item.

Patched __init__.py - added new function
makeLogRecord (for bug report 760703).

Patched handlers.py - updated some docstrings and
deleted some old commented-out code.

Patched test_logging.py to make use of makeLogRecord.

Patched liblogging.tex to fill documentation gaps (both
760703 and bug 757821).
2003-06-27 21:43:39 +00:00
Tim Peters 6ebe61fa80 A hack to ease compatibility with pre-2.3 Pythons: by default, doctest
now accepts "True" when a test expects "1", and similarly for "False"
versus "0".  This is un-doctest-like, but on balance makes it much
more pleasant to write doctests that pass under 2.2 and 2.3.  I expect
it to go away again, when 2.2 is forgotten.  In the meantime, there's
a new doctest module constant that can be passed to a new optional
argument, if you want to turn this behavior off.

Note that this substitution is very simple-minded:  the expected and
actual outputs have to consist of single tokens.  No attempt is made,
e.g., to accept [True, False] when a test expects [1, 0].  This is a
simple hack for simple tests, and I intend to keep it that way.
2003-06-27 20:48:05 +00:00
Gustavo Niemeyer 6cf26195c6 Do not add extra "\n" after bang line. 2003-06-27 19:33:38 +00:00
Fred Drake 01c623b1a3 fix typo 2003-06-27 19:22:11 +00:00
Skip Montanaro a7b8ac6613 add mention of -l, --listfuncs to usage() small part of 542562 2003-06-27 19:09:33 +00:00
Jeremy Hylton c4bf5edc3a Add a trivial test of getargspec() with a method. 2003-06-27 18:43:12 +00:00
Jeremy Hylton ab91902f6f A bit o' reformatting and removal of non-_getframe currentframe(). 2003-06-27 18:41:20 +00:00
Jeremy Hylton 6496788e7a Fix for SF bug 620190: getargspec() doesn't work with methods. 2003-06-27 18:14:39 +00:00
Jeremy Hylton 7ff55e6bc5 Add tests for __nonzero__() problems. 2003-06-27 17:40:16 +00:00
Jeremy Hylton f8ecde5de0 Revert previous checkin and just add a comment about constructor_ob.
There's no point to passing it anymore, but there's a test that
expects the call to fail if you pass a non-callable object.
2003-06-27 16:58:43 +00:00
Skip Montanaro 0fe8fce7e3 (HTML|Text)Repr.repr1: Guard against objects whos types have no __name__
attribute. Patch and bug report from Geoff Talvola. Closes patch #672855.
2003-06-27 15:45:41 +00:00
Michael W. Hudson 896e5164bb Jacob Hallen cornered me here at EuroPython and got me to look at
patch:

[ 750008 ] 'compiler' module bug with 'import foo.bar as baz'

which I'm now checking in.

after import foo.bar as baz, baz would refer to foo.
2003-06-27 12:32:39 +00:00
Raymond Hettinger f69d9f6818 SF bug #761337: datetime.strftime fails on trivial format string
The interning of short strings violates the refcnt==1 assumption for
_PyString_Resize().

A simple fix is to boost the initial value of "totalnew" by 1.
Combined with an NULL argument to PyString_FromStringAndSize(),
this assures that resulting format string is not interned.
This will remain true even if the implementation of
PyString_FromStringAndSize() changes because only the uninitialized
strings that can be interned are those of zero length.

Added a test case.
2003-06-27 08:14:17 +00:00
Jeremy Hylton 7567822838 Don't call constructor() from pickle().
The constructor() call only made sense when it registered the
constructor as safe for unpickling.  We should probably remove the
module-global function, but need to worry about backwards
compatibility.
2003-06-26 23:20:20 +00:00
Raymond Hettinger f6fe4eda6e Portion of SF patch #761104. Fixes a minor docstring error.
_TemporarilyImmutableSet is in fact a subclass of BaseSet
2003-06-26 18:49:28 +00:00
Jeremy Hylton 546e34b654 Enable tracing of multi-threaded applications.
Fix bug in computation of coverage percentage: Only count a line if it
was executed or if we print the >>>>>> marker.
2003-06-26 14:56:17 +00:00
Raymond Hettinger 5f078ff7f0 SF bug #759889: Pickling of Random is broken
* Implement __reduce__() to support pickling.
* Add a test case to prove a successful roundtrip through pickle.
2003-06-24 20:29:04 +00:00
Barry Warsaw 663219a8cc _make_boundary(): A minor optimization suggested by the Timbot. 2003-06-24 20:19:34 +00:00
Greg Stein 616a58d79a Deal with a couple XXX comments which asked questions.
In response to "shouldn't the client close the file?", the answer is
"no". The original design behind HTTPConnection is that the client did
not have to worry about it. The response would close itself when you
read the last of the data from it. This closing also dealt with
allowing the connection to perform another request/response (if it was
a persistent connection).

However... the auto-close behavior broke compatibility with the
classic httplib.HTTP class' behavior when a zero-length response body
was present. In that situation, the HTTPResponse object was
auto-closing it since there was no data present, and for an HTTP/1.0
connection-close socket (or an HTTP/0.9 request) connection, that also
ended up closing the socket. When an httplib.HTTP user went to read
the socket... boom. A patch to correct the auto-close (for compat with
old httplib users) was added in rev 1.22.

But for non-zero-length *chunked* bodies, we should keep the
auto-close behavior. The library user is not reading the socket (they
can't cuz of the chunked response we just got done handling), so they
should be immune to the response closing the socket. In fact, I would
like to see (one day) the auto-close restored, and the HTTP subclass
would simply have a flag to disable that behavior (for back-compat
purposes).
2003-06-24 06:35:19 +00:00
Raymond Hettinger 8a99b50239 SF patch #736962. Converted test_compile to unittest format. 2003-06-23 13:36:57 +00:00
Martin v. Löwis bcc651a1f9 Idlefork patch #682347: convert Unicode strings from readline to
IOBinding.encoding. Also set sys.std{in,out,err}.encoding, for both
the local and the subprocess case.
2003-06-22 07:52:56 +00:00