Commit Graph

6461 Commits

Author SHA1 Message Date
Jason Tishler 80c02af345 Patch #595014: Cygwin tempfile patch
Although Cygwin attempts to be as Posix compliant
as possible, it has difficulties unlinking open
files. This is not surprising given that Cygwin is
dependent on Win32 which in turn has this problem
itself.

The attached tempfile patch acknowledges this
Cygwin limitation. Without this patch, Cygwin
fails test_tempfile (i.e., test_has_no_name) as
follows:

$ ./python -E -tt ../Lib/test/regrtest.py -l test_tempfile
test_tempfile
test test_tempfile failed -- Traceback (most recent call last):
  File "/home/jt/src/PythonCvs/Lib/test/test_tempfile.py", line 689, in test_has_no_name
    self.failOnException("rmdir", ei)
  File "/home/jt/src/PythonCvs/Lib/test/test_tempfile.py", line 33, in failOnException
    self.fail("%s raised %s: %s" % (what, ei[0], ei[1]))
  File "/home/jt/src/PythonCvs/Lib/unittest.py", line 260, in fail
    raise self.failureException, msg
AssertionError: rmdir raised exceptions.OSError: [Errno 90] Directory not empty: '/mnt/c/DOCUME~1/jatis/LOCALS~1/Temp/tmpM_z8nj'
2002-08-14 15:10:09 +00:00
Barry Warsaw 09707e3637 Patch by Tim to shut up the compiler's DeprecationWarnings on the
high-bit-set hex constants.
2002-08-14 15:09:12 +00:00
Guido van Rossum 20f0b36a04 test_many(): open only 100 temp files, not 1000. Some systems don't
allow that many open files per process.  I don't see that 1000 makes
any difference for the test.
2002-08-14 14:52:02 +00:00
Martin v. Löwis eb3f00aeeb Check for trailing backslash. Fixes #593656. 2002-08-14 08:22:50 +00:00
Martin v. Löwis 8a8da798a5 Patch #505705: Remove eval in pickle and cPickle. 2002-08-14 07:46:28 +00:00
Skip Montanaro cffac66393 tightening up a few except: clauses
see bug 411881
2002-08-14 02:58:16 +00:00
Tim Peters 632a4fbd4d runtest(): I don't know why we don't just use TESTFN, but if we have to
do bizarre things to get a temp file, I changed it to use mkstemp instead
of NamedTemporaryFile.  This tried to leave the file open while passing
its name to execfile().  On Win2K (but not Win9X), though, a file created
with O_TEMPORARY cannot be opened again, so the test failed with a
permission error when execfile tried to open it.  Closer to the truth:
a file created with O_TEMPORARY can be opened again, but only if the
file is also created with SHARE_DELETE access via the Win32 CreateFile()
function.  There's no way to get at that from MS's version of libc, though
(we'd have to ditch the "std" C file functions in favor of Win32 API
calls).
2002-08-14 01:05:57 +00:00
Tim Peters d41bf34825 mkstemp(): Repaired error in docstring (the sense of the 'binary' flag
was reversed).
2002-08-14 00:49:50 +00:00
Tim Peters f69b3e9edc mkstemp(): The optional "binary" argument is clearly intended to be a
Boolean, so changed its default value from 1 to True.
2002-08-13 23:38:30 +00:00
Tim Peters c21ea74971 NamedTemporaryFile(), TemporaryFile(): removed needless local vrbl 'bin'. 2002-08-13 23:36:01 +00:00
Tim Peters bd7b4c7e46 template: removed special-casing for NT; there isn't an 8-character limit. 2002-08-13 23:33:56 +00:00
Tim Peters 1749b252c9 _once(): Removed obfuscating aliasing of _once_lock. 2002-08-13 23:31:02 +00:00
Tim Peters fd0f0c9f02 _once(): Simplified dict manipulation. 2002-08-13 23:29:21 +00:00
Tim Peters 7f270ba860 Added a test specifically to tickle Karatsuba; it costs no appreciable
runtime.
2002-08-13 21:06:55 +00:00
Jeremy Hylton 22dae28c1a Add a missing call to _strclass(). 2002-08-13 20:43:46 +00:00
Guido van Rossum 8b056da6c8 Add tests for including __dict__ and/or __weakref__ in __slots__.
Add some more rigor to slotmultipleinheritance().
2002-08-13 18:26:26 +00:00
Neal Norwitz b0df6a1afa SF bug #574235, convert_path fails with empty pathname 2002-08-13 17:42:57 +00:00
Neal Norwitz f9dd0f1924 Add test for SF bug # 575229, multiple inheritance w/ slots dumps core
Fix already checked in by Guido
2002-08-13 17:16:49 +00:00
Fred Drake a87a521b83 Remove ugly irregular spaces from in front of some comments. 2002-08-13 13:59:55 +00:00
Jason Tishler 83499db4f0 Bug #556025: list(xrange(1e9)) --> seg fault
Close the bug report again -- this time for Cygwin due to a newlib bug.
See the following for the details:

	http://sources.redhat.com/ml/newlib/2002/msg00369.html

Note that this commit is only a documentation (i.e., comment) change.
2002-08-13 11:42:41 +00:00
Tim Peters d0876b859d test_division(): Added one larger digits value, to ensure that the
"lopsided Karatsuba" driver also gets some exercise.
2002-08-13 02:24:25 +00:00
Tim Peters 28b0e2a7f8 Machines-- and Python --are a lot faster in relevant ways since this
test was written.  So boosted the number of "digits" this generates, and
also beefed up the "* / divmod" test to tickle numbers big enough to
trigger the Karatsuba algorithm.  It takes about 2 seconds now on my box.
2002-08-13 02:17:11 +00:00
Guido van Rossum 820819c7ca Fix wanrings about unsigned hex constants. 2002-08-12 22:11:28 +00:00
Guido van Rossum 558fc977c5 Don't use hex constants representing negative numbers. 2002-08-12 22:01:24 +00:00
Guido van Rossum dc15c27f50 Suppress warnings about test_grammar.py that can't be suppressed inside
that file itself (because it's the parser that reports them).
2002-08-12 21:55:51 +00:00
Guido van Rossum 611546005b Make sure that *any* object whose id() is used as a memo key is kept
alive in the memo.  This fixes SF bug 592567.
2002-08-12 20:20:08 +00:00
Guido van Rossum a6fa0e6f2e Portable way of producing unsigned 32-bit hex output to print the
CRCs.
2002-08-12 15:26:05 +00:00
Guido van Rossum baf29638da Shut up warnings about hex()/oct() that can't be avoided. 2002-08-12 15:16:20 +00:00
Guido van Rossum 1ae4c3d0d8 Avoid warnings about <<. external_attr is now an unsigned long. 2002-08-12 15:15:51 +00:00
Tim Peters 5f7617b5f6 Fixed misspelling in comment. 2002-08-11 18:28:09 +00:00
Ka-Ping Yee 45daeb093f Extend stripid() to handle strings ending in more than one '>'.
Add resolve() to handle looking up objects and names (fix SF bug 586931).
Add a nicer error message when given a filename that doesn't exist.
2002-08-11 15:11:33 +00:00
Marc-André Lemburg cc8764ca9d Add C API PyUnicode_FromOrdinal() which exposes unichr() at C level.
u'%c' will now raise a ValueError in case the argument is an
integer outside the valid range of Unicode code point ordinals.

Closes SF bug #593581.
2002-08-11 12:23:04 +00:00
Tim Peters d92ae840e9 test_saveall(): Another small simplification; plus s/l/L/g.
test_del(), test_del_newclass():  No need to use apply() in these.
2002-08-11 04:15:09 +00:00
Tim Peters a1ad3f08ad And one more simplification to test_saveall(). 2002-08-10 21:32:16 +00:00
Tim Peters 4803c126a6 test_saveall(): Simplified a little, given that we only expect one item
in gc.garbage (so no need to loop looking for it -- it's there or it's
not).
2002-08-10 21:29:56 +00:00
Tim Peters c708c0a8c4 If any trash happened to be sitting around waiting to get collected at
the time it's called, test_saveall() made it look a leak, triggering
bogus warnings from regrtest's -l (findleaks) mode.
2002-08-10 21:20:54 +00:00
Guido van Rossum 40af889081 Disallow class assignment completely unless both old and new are heap
types.  This prevents nonsense like 2.__class__ = bool or
True.__class__ = int.
2002-08-10 05:42:07 +00:00
Guido van Rossum dd8ddacd94 Fix a typo in the mktemp -> mkstemp patch. 2002-08-10 00:17:59 +00:00
Fred Drake 56d1266193 Add tests for weakref support for generator-iterators.
Part of fixing SF bug #591704.
2002-08-09 18:37:10 +00:00
Tim Peters ca3ac7f639 There's no distinction among 'user', 'group' and 'world' permissions
on Win32, so tests that assume there are such distinctions can't
pass.  Fiddled them to work.
2002-08-09 18:13:51 +00:00
Tim Peters a0d55de877 Whitespace normalization. 2002-08-09 18:01:01 +00:00
Guido van Rossum 4aa21aa5b3 Test finalizers and GC from inside __del__ for new classes. 2002-08-09 17:38:16 +00:00
Guido van Rossum 3b0a3293c3 Massive changes from SF 589982 (tempfile.py rewrite, by Zack
Weinberg).  This changes all uses of deprecated tempfile functions to
the recommended ones.
2002-08-09 16:38:32 +00:00
Guido van Rossum 0e54871f82 Check-in of the most essential parts of SF 589982 (tempfile.py
rewrite, by Zack Weinberg).  This replaces most code in tempfile.py
(please review!!!) and adds extensive unit tests for it.

This will cause some warnings in the test suite; I'll check those in
soon, and also the docs.
2002-08-09 16:14:33 +00:00
Guido van Rossum 0f5f0b8057 Test for Neil's fix to correctly invoke __rmul__. 2002-08-09 16:11:37 +00:00
Guido van Rossum f36921c4b0 Unicode replace() method with empty pattern argument should fail, like
it does for 8-bit strings.
2002-08-09 15:36:48 +00:00
Fred Drake a350270302 New entries to track the DOM API growth. These match names exposed in
PyXML 0.8.
2002-08-09 14:57:55 +00:00
Steve Purcell dc391a67e3 Fix to ensure consistent 'repr' and 'str' results between Python
versions, since 'repr(new_style_class) != repr(classic_class)'.
Suggested by Jeremy Hylton.
2002-08-09 09:46:23 +00:00
Raymond Hettinger c35491ee3a Moved inplace add and multiply methods from UserString to MutableString.
Closes SF Bug #592573 where inplace add mutated a UserString.
Added unittests to verify the bug is cleared.
2002-08-09 01:37:06 +00:00
Raymond Hettinger 8da9da0ccc Revised the test suite for 'contains' to use the test() function argument
rather than vereq().  While it was effectively testing regular strings, it
ignored the test() function argument when called by test_userstring.py.
2002-08-09 00:43:38 +00:00