Commit Graph

10628 Commits

Author SHA1 Message Date
Martin v. Löwis 4196296605 Update test data to 4.1; disable PRI #29 for now. 2006-03-10 11:59:47 +00:00
Martin v. Löwis 5bd7c02298 Avoid forward-declaring the methods array.
Rename unicodedata.db* to unicodedata.ucd*
2006-03-10 11:20:04 +00:00
Guido van Rossum f669436189 Um, I thought I'd already checked this in.
Anyway, this is the changes to the with-statement
so that __exit__ must return a true value in order
for a pending exception to be ignored.
The PEP (343) is already updated.
2006-03-10 02:28:35 +00:00
Martin v. Löwis 480f1bb67b Update Unicode database to Unicode 4.1. 2006-03-09 23:38:20 +00:00
Georg Brandl 24cb053b15 Patch #1446372: quit and exit can now be called from the interactive
interpreter to exit.
2006-03-09 23:22:06 +00:00
Thomas Heller 51f77b5152 Remove the magic to run an uninstalled ctypes version from a CVS sandbox. 2006-03-09 19:40:00 +00:00
Georg Brandl d09def36d5 Bug #1442874: handle "<!>", the empty SGML comment 2006-03-09 13:27:14 +00:00
Thomas Heller 57e881eb22 Disable the testcase that crashes solaris. 2006-03-09 09:43:53 +00:00
Thomas Heller e317d0e307 Replace the trivial ctypes test (did only an import) with the real test suite. 2006-03-09 07:21:33 +00:00
Neal Norwitz 72c2c062d7 Try to be a bit more consistent on all platforms:
python .
  python < .

both print a message, return non-zero and do not core dump.
2006-03-09 05:58:11 +00:00
Tim Peters e8d09e5818 Whitespace normalization. 2006-03-09 01:15:05 +00:00
Hye-Shik Chang d758d3d747 Remove .cvsignore and set svn:ignore for *.pyc *.pyo. 2006-03-08 23:31:17 +00:00
Thomas Heller 200af39722 Trivial test for ctypes, more to come 2006-03-08 20:38:11 +00:00
Thomas Heller babddfca75 Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00
Georg Brandl 533ff6fc06 Patch #1434038: property() now uses the getter's docstring if there is
no "doc" argument given. This makes it possible to legitimately use
property() as a decorator to produce a read-only property.
2006-03-08 18:09:27 +00:00
Georg Brandl 26fd2e1dcc Fix pydoc.synopsis() so that it doesn't error out with an unreadable
module.
2006-03-08 09:34:53 +00:00
Tim Peters df44ab7b1c _hotshot hotshot_profiler(): If write_header() returned
an error code, this let `self` leak.  This is a disaster
on Windows, since `self` already points to a newly-opened
file object, and it was impossible for Python code to
close the thing since the only reference to it was in a
blob of leaked C memory.

test_hotshot test_bad_sys_path():  This new test provoked
the C bug above.  This test passed, but left an open
"@test" file behind, which caused a massive cascade of
bogus test failures in later, unrelated tests on Windows.
Changed the test code to remove the @test file it leaves
behind, which relies on the change above to close that
file first.
2006-03-07 23:53:32 +00:00
Guido van Rossum 38fff8c4e4 Checking in the code for PEP 357.
This was mostly written by Travis Oliphant.
I've inspected it all; Neal Norwitz and MvL have also looked at it
(in an earlier incarnation).
2006-03-07 18:50:55 +00:00
Andrew M. Kuchling ec73cd4b1a Typo fix 2006-03-07 16:16:07 +00:00
Barry Warsaw d3c38ff7f8 SF patch #1443865; gc.get_count() added and optional argument 'generation'
added to gc.collect().  Updated docs, unit test, and NEWS entry.

(Also, fixed a typo in NEWS.)
2006-03-07 09:46:03 +00:00
Neal Norwitz 60da31660c Thanks to Coverity, these were all reported by their Prevent tool.
All of these (except _lsprof.c) should be backported.  Particularly
the hotshot change which validates sys.path.  Can someone backport?
2006-03-07 04:48:24 +00:00
Walter Dörwald ca199432c2 If size is specified, try to read at least size characters.
This is a alternative version of patch #1379332.
2006-03-06 22:39:12 +00:00
Martin v. Löwis fbab90e95b Import bdist_msi 2006-03-05 13:36:04 +00:00
Neal Norwitz 5bab0f8872 Backout the last hack and add in this new one.
The failure definitely seems timing related.  This change *seems* to work.
Since the failure isn't doesn't occur consistently, it's hard to tell.

Running these tests on Solaris in this order:
	test_urllibnet test_operator test_cgi \
	test_isinstance test_future test_ast test_logging

generally caused a failure (about 50% of the time) before the sleep.
I couldn't provoke the failure with the sleep.

This should really be cleaned up by using threading.Events or something
so it is not timing dependent and doesn't hang forever on failure.
2006-03-05 02:16:12 +00:00
Neal Norwitz 83cbb24cd4 Oops, urllib may or may not already be loaded. 2006-03-04 23:56:53 +00:00
Neal Norwitz d8cea79bb4 Fix spurious test failure of test_socket_ssl when run in this order:
test_codecmaps_tw test_importhooks test_socket_ssl

I don't completely understand the cause, but there's a lot of import magic
going on and this is the smallest change which fixes the problem.
2006-03-04 23:13:41 +00:00
Neal Norwitz b62c433d71 Remove test for timing (already not built since commented out in setup.py).
Add note to NEWS.
2006-03-04 18:35:47 +00:00
Barry Warsaw ad9afcf213 Actually this file should have svn:eol-style CRLF since it's specifically
testing line ending compatibility.
2006-03-04 04:55:02 +00:00
Tim Peters c32886dad8 Set eol-style to native -- doesn't appear to be any reason
for it to claim it has mime-type application/octet-stream.
2006-03-04 02:57:23 +00:00
Tim Peters 39e11fb104 Whitespace normalization. 2006-03-04 02:43:44 +00:00
Neal Norwitz 67dfb6f086 I think the test_logging failure on Solaris is timing related. We don't
want to wait forever if we don't receive the last message.  But we also
don't want the test to fail if we shutdown too quickly.  I can't reliably
reproduce this failure, so I'm kinda guessing this is the problem.
We'll see if this band-aid helps.
2006-03-03 21:53:14 +00:00
Neal Norwitz 10be2ea85d SF bug 1442442: LIST_APPEND optimization got lost in the AST merge.
Add it back.
2006-03-03 20:29:11 +00:00
Neal Norwitz d4e3035701 Fix compiler breakage related to absolute imports 2006-03-03 20:21:48 +00:00
Neal Norwitz eaed39f303 Hopefully this removes all vestiges of CO_GENERATOR_ALLOWED that can
be removed in 2.x.
2006-03-03 19:12:58 +00:00
Thomas Wouters fa0cf4f3ae Add support for absolute/relative imports and if/else expressions:
- regenerate ast.py
 - add future flags for absolute-import and with-statement so they
   (hopefully) properly get set in code-object flags
 - try out if/else expressions in actual code for the hell of it.

Seems to generate the same kind of bytecode as the normal compiler.
2006-03-03 18:16:20 +00:00
Brett Cannon 4954b384e4 Fix mismatch opening and closing quotes on a string. 2006-03-02 17:47:01 +00:00
Guido van Rossum 5bde08dba3 Fix failure of test_compiler.py when compiling test_contextlib.py.
The culprit was an expression-less yield -- the first apparently in
the standard library.  I added a unit test for this.
Also removed the hack to force compilation of test_with.py.
2006-03-02 04:24:01 +00:00
Martin v. Löwis d9bfeac330 Reformat the exception message by going through a list. 2006-03-01 23:24:34 +00:00
Tim Peters 5ddfe41e84 Whitespace normalization. 2006-03-01 23:02:57 +00:00
Martin v. Löwis 49c5da1d88 Patch #1440601: Add col_offset attribute to AST nodes. 2006-03-01 22:49:05 +00:00
Martin v. Löwis 15bfc3b082 Make failures in test cases print failing source file. 2006-03-01 21:11:49 +00:00
Guido van Rossum a9f068726f Fix a bug in nested() - if one of the sub-context-managers swallows the
exception, it should not be propagated up.  With unit tests.
2006-03-01 17:10:01 +00:00
Tim Peters 1a57296450 Set svn:eol-style to native. 2006-03-01 06:19:04 +00:00
Brett Cannon 6b4ed74791 Fix parsing of exception_hierarchy.txt when a platform-specific exception is
specified.  Hopefully this wll bring warming to Tim's Windows-loving heart.
2006-03-01 06:10:48 +00:00
Thomas Wouters 7c187bcc82 Remove redundant isinstance() check. 2006-03-01 05:34:22 +00:00
Brett Cannon bf36409e2a PEP 352 implementation. Creates a new base class, BaseException, which has an
added message attribute compared to the previous version of Exception.  It is
also a new-style class, making all exceptions now new-style.  KeyboardInterrupt
and SystemExit inherit from BaseException directly.  String exceptions now
raise DeprecationWarning.

Applies patch 1104669, and closes bugs 1012952 and 518846.
2006-03-01 04:25:17 +00:00
Thomas Wouters 1f1c16a812 Regenerate. 2006-02-28 22:50:17 +00:00
Guido van Rossum 1a5e21e033 Updates to the with-statement:
- New semantics for __exit__() -- it must re-raise the exception
  if type is not None; the with-statement itself doesn't do this.
  (See the updated PEP for motivation.)

- Added context managers to:
  - file
  - thread.LockType
  - threading.{Lock,RLock,Condition,Semaphore,BoundedSemaphore}
  - decimal.Context

- Added contextlib.py, which defines @contextmanager, nested(), closing().

- Unit tests all around; bot no docs yet.
2006-02-28 21:57:43 +00:00
Neal Norwitz cd8ca8092f Add a note about removing the file once the bug is fixed 2006-02-28 20:40:50 +00:00
Neal Norwitz 9193491eb3 Make __future__ features similar for with and absolute import since they were both added before a1 2006-02-28 20:02:42 +00:00
Tim Peters dfc240450c Gave README a .txt extension. 2006-02-28 19:05:29 +00:00
Thomas Wouters 34aa7ba114 from __future__ import with_statement addon for 'with', mostly written by
Neal.
2006-02-28 19:02:24 +00:00
Neal Norwitz edc8f1366a Add directory which contains known ref leaks. Some of these are likely to be system dependent (like test_gestalt). 2006-02-28 19:02:05 +00:00
Tim Peters 400cbc3a44 Set EOL style to native. 2006-02-28 18:44:41 +00:00
Tim Peters 710ab3b5f8 Whitespace normalization. 2006-02-28 18:30:36 +00:00
Neal Norwitz 14ca327f99 Instead of printing the exception when you interrupt a test (Ctrl-C),
print the status so far and suppress printing the exception (but still exit).
2006-02-28 18:05:43 +00:00
Neal Norwitz 03bdedd574 Update comments 2006-02-28 17:53:58 +00:00
Jeremy Hylton 7b03bade2b Test case to cover subscription bug from SF 1333982 2006-02-28 17:46:23 +00:00
Thomas Wouters f7f438ba3b SF patch #1438387, PEP 328: relative and absolute imports.
- IMPORT_NAME takes an extra argument from the stack: the relativeness of
   the import. Only passed to __import__ when it's not -1.

 - __import__() takes an optional 5th argument for the same thing; it
   __defaults to -1 (old semantics: try relative, then absolute)

 - 'from . import name' imports name (be it module or regular attribute)
   from the current module's *package*. Likewise, 'from .module import name'
   will import name from a sibling to the current module.

 - Importing from outside a package is not allowed; 'from . import sys' in a
   toplevel module will not work, nor will 'from .. import sys' in a
   (single-level) package.

 - 'from __future__ import absolute_import' will turn on the new semantics
   for import and from-import: imports will be absolute, except for
   from-import with dots.

Includes tests for regular imports and importhooks, parser changes and a
NEWS item, but no compiler-package changes or documentation changes.
2006-02-28 16:09:29 +00:00
Guido van Rossum baf3eb2410 Forgot to explain the effect of the new opcode.
Sigh -- we really should have one place for all opcode metadata.
2006-02-28 00:40:16 +00:00
Guido van Rossum 7ad94f011e Update the compiler package to compile the with-statement.
Jeremy, please review!
2006-02-28 00:32:16 +00:00
Neal Norwitz 0023a2f858 Finish removal of CO_GENERATOR_ALLOWED. 2006-02-27 23:24:48 +00:00
Guido van Rossum c2e20744b2 PEP 343 -- the with-statement.
This was started by Mike Bland and completed by Guido
(with help from Neal).

This still needs a __future__ statement added;
Thomas is working on Michael's patch for that aspect.

There's a small amount of code cleanup and refactoring
in ast.c, compile.c and ceval.c (I fixed the lltrace
behavior when EXT_POP is used -- however I had to make
lltrace a static global).
2006-02-27 22:32:47 +00:00
Neal Norwitz 9aaad88393 Even though we don't currently use unicode or complex numbers in the test,
be complete when when checking types.

Yield cannot be tested outside a function, so add a comment to that effect.
2006-02-27 21:08:23 +00:00
Brett Cannon be66e943c2 Don't filter out OverflowWarning; should be a test failure if it is raised by
the interpreter in 2.5 .
2006-02-27 20:03:56 +00:00
Martin v. Löwis 59977a677c Make or_test similar to test, not testlist. 2006-02-27 19:57:01 +00:00
Martin v. Löwis 415ed937c2 Skip over doc strings. 2006-02-27 19:56:30 +00:00
Martin v. Löwis 16c7f71380 Handle testlist_safe and or_test like testlist. 2006-02-27 16:11:03 +00:00
Martin v. Löwis 49a1302952 Alias non-terminals introduced for backwards compatibility. 2006-02-27 16:03:39 +00:00
Anthony Baxter 322a23f21b regenerated. please read PEP 306 when changing Python's grammar! 2006-02-27 06:49:54 +00:00
Thomas Wouters dca3b9c797 PEP 308 implementation, including minor refdocs and some testcases. It
breaks the parser module, because it adds the if/else construct as well as
two new grammar rules for backward compatibility. If no one else fixes
parsermodule, I guess I'll go ahead and fix it later this week.

The TeX code was checked with texcheck.py, but not rendered. There is
actually a slight incompatibility:

>>> (x for x in lambda:0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: iteration over non-sequence

changes into

>>> (x for x in lambda: 0)
  File "<stdin>", line 1
    (x for x in lambda: 0)
                     ^
SyntaxError: invalid syntax

Since there's no way the former version can be useful, it's probably a
bugfix ;)
2006-02-27 00:24:13 +00:00
Martin v. Löwis bd260da900 Generate code to recursively copy an AST into
a tree of Python objects. Expose this through compile().
2006-02-26 19:42:26 +00:00
Tim Peters d6e7e73ff8 Whitespace normalization. 2006-02-26 04:21:50 +00:00
Guido van Rossum 1968ad32cd - Patch 1433928:
- The copy module now "copies" function objects (as atomic objects).
  - dict.__getitem__ now looks for a __missing__ hook before raising
    KeyError.
  - Added a new type, defaultdict, to the collections module.
    This uses the new __missing__ hook behavior added to dict (see above).
2006-02-25 22:38:04 +00:00
Jack Jansen de540e2288 Got rid of byte-order dependencies. 2006-02-23 14:54:30 +00:00
Georg Brandl 418a1ef089 RFE #1436243: make integers in [0..256] preallocated. 2006-02-22 11:30:06 +00:00
Georg Brandl 6a29c323ba Add test for classmethod ./. keyword args. 2006-02-21 22:17:46 +00:00
Tim Peters 42a3deb7b5 Suppress another deprecation warning in the tests. 2006-02-21 03:28:49 +00:00
Tim Peters 32cbc96150 Whitespace normalization. 2006-02-20 21:42:18 +00:00
Georg Brandl a223d2cb29 Bug #1210377: close bsddb cursor correctly after NotFoundError. 2006-02-20 20:29:52 +00:00
Martin v. Löwis de2cde614c Detect Win64 builds. 2006-02-20 12:26:58 +00:00
Martin v. Löwis e46af8c367 Let the SDK setup override distutils logic. 2006-02-20 12:15:15 +00:00
Georg Brandl 5771310a09 Bug #1101233: fix test_fcntl on netbsd2 platform. 2006-02-20 10:32:02 +00:00
Georg Brandl 8f7c54eaa5 Bug #1413790: zipfile now sanitizes absolute archive names that are
not allowed by the specs.
2006-02-20 08:40:38 +00:00
Tim Peters 200a58058a Whitespace normalization. 2006-02-19 21:26:07 +00:00
Tim Peters 4d7cad115d Repair new test failures on Windows due to
implicit assumptions that there's no difference
between text and binary modes.
2006-02-19 21:22:10 +00:00
Marc-André Lemburg fe4b34cc4b Fix the encodings package codec search function to only search
inside its own package. Fixes problem reported in patch #1433198.

Add codec search function for codec test codec.
2006-02-19 15:22:22 +00:00
Georg Brandl c98eeede17 Patch #1215184: FileInput now can be given an opening hook which can
be used to control how files are opened.
2006-02-19 14:57:47 +00:00
Georg Brandl c029f873cb Patch #1212287: fileinput.input() now has a mode parameter for
specifying the file mode input files should be opened with.
2006-02-19 14:12:34 +00:00
Georg Brandl 67e9fb9d7a Patch #1215184: fileinput now has a fileno() function for getting the
current file number.
2006-02-19 13:56:17 +00:00
Georg Brandl 602b9ba6b3 Patch #1349274: gettext.install() now optionally installs additional
translation functions other than _() in the builtin namespace.
2006-02-19 13:26:36 +00:00
Georg Brandl e466217ab9 Patch #1337756: fileinput now accepts Unicode filenames. 2006-02-19 09:51:27 +00:00
Tim Peters 2a8ec996ce test_gopher(): Squash another deprecation
warning about gopherlib.
2006-02-19 05:09:00 +00:00
Georg Brandl 19e2203fff Add a unit test for bug fix #1396678. 2006-02-19 01:21:11 +00:00
Georg Brandl 26caeba35a Bug #1396678: a closed bsddb.DB raises AttributeError on repr().
It now returns "{}". Is that the correct solution?
2006-02-19 00:53:54 +00:00
Neal Norwitz bb45973455 This fixes test _locale failing on macteagle (Mac OS 10.4 AFAIK).
Google for:  eu_ES decimal point
shows that BSD locales had the eu_ES decimal point as
a single quote (') instead of a comma (,).

This was seems to have been fixed 15 months ago, but it's not on our
Mac and presumably others.  So skip this broken locale.
2006-02-19 00:13:15 +00:00
Georg Brandl 1f63670a2a Patch #1426648: urllib proxy_bypass broken 2006-02-18 23:10:23 +00:00
Neal Norwitz d5b6715083 This should get test_timeout to pass when running on any python.org host. Will backport 2006-02-18 21:20:31 +00:00
Georg Brandl 7b4e7c24df Patch #1373643: The chunk module can now read chunks larger than
two gigabytes.
2006-02-18 21:10:56 +00:00
Tim Peters e2c9a6cea7 Suppress new deprecation warnings when running the
test suite.

For urllib2, move the import of gopherlib into the
only function that uses it:  users (including the
test suite) certainly shouldn't see a deprecation
warning just because they import urllib2!  If they
actually use gopher_open(), fine, _then_ they should
see a deprecation warning.
2006-02-18 04:14:16 +00:00