summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* After much thrashing, I believe this is a truly minimal patch to teachTim Peters2001-09-202-4/+27
| | | | | pydoc how to do something sensible with 2.2 descriptors. To see the difference, browse __builtin__ via pydoc before and after the patch.
* Patch #461321: Support None as a timeout in poll2 and poll3.Martin v. Löwis2001-09-191-4/+6
|
* Keep tabnanny happy.Guido van Rossum2001-09-191-1/+1
|
* Fixed search function error reporting in the encodings packageMarc-André Lemburg2001-09-191-7/+11
| | | | | | | | __init__.py module to raise errors which can be catched as LookupErrors as well as SystemErrors. Modified the error messages to include more information about the failing module.
* Added new helpers for easy access to codecs. Docs will follow.Marc-André Lemburg2001-09-191-0/+42
|
* Patch to bug #461754: CDATA should not undergo entity subst.Martin v. Löwis2001-09-191-1/+1
|
* Add additional coercion support for "self subtypes" to int, long,Guido van Rossum2001-09-191-0/+28
| | | | float (compare the recent checkin to complex). Added tests for these.
* Enable two checks for comparing a complex to a complex subtypeGuido van Rossum2001-09-191-3/+4
| | | | | | | | | instance. Split a string comparison test in two halves, replacing "a==b==a" with separate tests for a==b and b==a. (Reason: while experimenting, this test failed, and I wanted to know if it was the first or the second == operator that failed.)
* Enable some comparison tests that failed before. Still having problemsTim Peters2001-09-181-3/+3
| | | | with subsclasses of complex and string.
* Add a similar test for rich comparisons.Guido van Rossum2001-09-181-1/+67
|
* fixed #449964: sre.sub raises an exception if the template contains aFredrik Lundh2001-09-183-9/+14
| | | | | | \g<x> group reference followed by a character escape (also restructured a few things on the way to fixing #449000)
* Hopefully fix 3-way comparisons. This unfortunately adds yet anotherGuido van Rossum2001-09-181-0/+28
| | | | | | | | hack, and it's even more disgusting than a PyInstance_Check() call. If the tp_compare slot is the slot used for overrides in Python, it's always called. Add some tests that show what should work too.
* Get rid of a superfluous space after "--" in the message printed for aGuido van Rossum2001-09-181-2/+1
| | | | skipped test -- the print command already supplies a space.
* Fix typo in commentAndrew M. Kuchling2001-09-181-1/+1
|
* Test for the safety check in wrap_cmpfunc().Guido van Rossum2001-09-181-0/+15
|
* an SRE bugfix a day keeps Guido away...Fredrik Lundh2001-09-182-4/+11
| | | | | | | #462270: sub-tle difference between pre.sub and sre.sub. PRE ignored an empty match at the previous location, SRE didn't. also synced with Secret Labs "sreopen" codebase.
* SF bug #417176 (Martijn Pieters): MultiFile.read() includes CRLFGuido van Rossum2001-09-181-1/+13
| | | | | | | | | boundary. Fixed by keeping a readahead buffer containing the next line. XXX We have no test suite for this. Maybe the new email package will help?
* softspace(): be prepared to catch AttributeError as well as TypeErrorGuido van Rossum2001-09-181-1/+2
| | | | upon attempted attribute assignment. Caught by MWH, SF bug #462522.
* This module didn't work at all anymore -- blew up with AttributeErrorTim Peters2001-09-181-2/+6
| | | | | | | on file.__methods__. Since the docs say "This module will become obsolete in a future release", this is just a quick hack to stop it from blowing up. If you care about this module, test it! It doesn't make much sense on Windows.
* Undo some (but not all) of the more lenient acceptance ofGuido van Rossum2001-09-181-9/+9
| | | | (AttributeError, TypeError) -- the leniency wasn't needed everywhere.
* - Some tests that check that assignments are not allowed expect thisGuido van Rossum2001-09-181-85/+95
| | | | | | | | | | | | | | | | to raise TypeError. In practice, a disallowed attribute assignment can raise either TypeError or AttributeError (and it's unclear which is better). So allow either. (Yes, this is in anticipation of a code change that switches the exception raised. :-) - Add a utility function, cantset(), which verifies that setting a particular attribute to a given value is disallowed, and also that deleting that same attribute is disallowed. Use this in the test_func_*() tests. - Add a new set of tests that test conformance of various instance method attributes. (Also in anticipation of code that changes their implementation.)
* Whitespace normalization.Tim Peters2001-09-188-21/+18
|
* Make test_socketserver require the network resource.Tim Peters2001-09-182-0/+3
| | | | Add it back to the list of tests we expect to skip on Windows.
* I don't expect test_socketserver to get skipped on Windows anymore.Tim Peters2001-09-181-1/+0
|
* Rework akin to test_threaded_import, so that this can run under regrtest.Tim Peters2001-09-171-7/+8
| | | | | Also raise TestSkipped (intead of appearing to fail) if the import lock is held.
* Rewrite function attributes to use the generic routines properly.Guido van Rossum2001-09-171-1/+158
| | | | | This uses the new "restricted" feature of structmember, and getset descriptors for some of the type checks.
* API change:Jeremy Hylton2001-09-173-10/+109
| | | | | | | | | | | | | | | | | | compile() becomes replacement for builtin compile() compileFile() generates a .pyc from a .py both are exported in __init__ compiler.parse() gets optional second argument to specify compilation mode, e.g. single, eval, exec Add AbstractCompileMode as parent class and Module, Expression, and Interactive as concrete subclasses. Each corresponds to a compilation mode. THe AbstractCompileMode instances in turn delegate to CodeGeneration subclasses specialized for their particular functions -- ModuleCodeGenerator, ExpressionCodeGeneration, InteractiveCodeGenerator.
* Re-created after change to astgen to calculate hardest_arg correctlyJeremy Hylton2001-09-171-577/+603
|
* Last set of change to get regression tests to passJeremy Hylton2001-09-173-5/+10
| | | | | | | | | | | Remove the only test in the syntax module. It ends up that the transformer must handle this error case. In the transformer, check for a list compression in com_assign_list() by looking for a list_for node where a comma is expected. In pycodegen.compile() re-raise the SyntaxError rather than catching it and exiting
* Handle more syntax errors.Jeremy Hylton2001-09-172-29/+77
| | | | | | | | Invoke compiler.syntax.check() after building AST. If a SyntaxError occurs, print the error and exit without generating a .pyc file. Refactor code to use compiler.misc.set_filename() rather than passing filename argument around to each CodeGenerator instance.
* Add utility to set filename attribute on all nodesJeremy Hylton2001-09-171-0/+9
|
* Brian Quinlan's XML-RPC server framework.Fredrik Lundh2001-09-171-0/+254
|
* support true divisionJeremy Hylton2001-09-171-1/+3
|
* SF patch #461781 by Chris Lawrence: os.path.realpath - Resolve symlinks:Guido van Rossum2001-09-175-0/+34
| | | | | | | | | | | | | | Once upon a time, I put together a little function that tries to find the canonical filename for a given pathname on POSIX. I've finally gotten around to turning it into a proper patch with documentation. On non-POSIX, I made it an alias for 'abspath', as that's the behavior on POSIX when no symlinks are encountered in the path. Example: >>> os.path.realpath('/usr/bin/X11/X') '/usr/X11R6/bin/X'
* PyObject_Dir(): Merge in __members__ and __methods__ too (if they exist,Tim Peters2001-09-171-0/+8
| | | | | | | | | | | | | | | and are lists, and then just the string elements (if any)). There are good and bad reasons for this. The good reason is to support dir() "like before" on objects of extension types that haven't migrated to the class introspection API yet. The bad reason is that Python's own method objects are such a type, and this is the quickest way to get their im_self etc attrs to "show up" via dir(). It looks much messier to move them to the new scheme, as their current getattr implementation presents a view of their attrs that's a untion of their own attrs plus their im_func's attrs. In particular, methodobject.__dict__ actually returns methodobject.im_func.__dict__, and if that's important to preserve it doesn't seem to fit the class introspection model at all.
* In a world with a growing number of subclassable types, replaceTim Peters2001-09-161-10/+8
| | | | | | | | type(x) is T tests with isinstance(x, T) Also got rid of a future-generators import, left over from code that wasn't intended to get checked in.
* Since we had a bug with multiplication of dynamic long subclasses, add aTim Peters2001-09-151-1/+6
| | | | little test to make sure it doesn't come back.
* A fix for SF bug #461546 (bug in long_mul).Guido van Rossum2001-09-151-0/+13
| | | | | | | | | Both int and long multiplication are changed to be more careful in their assumptions about when one of the arguments is a sequence: the assumption that at least one of the arguments must be an int (or long, respectively) is still held, but the assumption that these don't smell like sequences is no longer true: a subtype of int or long may well have a sequence-repeat thingie!
* The 'p' (Pascal string) pack code acts unreasonably when the string sizeTim Peters2001-09-151-0/+25
| | | | | and count exceed 255. Changed to preserve as much of the string as possible (instead of count%256 characters).
* Add code generator for yield stmtJeremy Hylton2001-09-141-0/+5
|
* limit prefix test for lambdaJeremy Hylton2001-09-141-1/+1
| | | | | the compiler package generates a module-unique trailing suffix for each lambda
* del no longer necessary now that new module is goneJeremy Hylton2001-09-141-2/+0
|
* Various sundry changes for 2.2 compatibilityJeremy Hylton2001-09-142-137/+94
| | | | | | | | | | | | | | | Remove the option to have nested scopes or old LGB scopes. This has a large impact on the code base, by removing the need for two variants of each CodeGenerator. Add a get_module() method to CodeGenerator objects, used to get the future features for the current module. Set CO_GENERATOR, CO_GENERATOR_ALLOWED, and CO_FUTURE_DIVISION flags as appropriate. Attempt to fix the value of nlocals in newCodeObject(), assuming that nlocals is 0 if CO_NEWLOCALS is not defined.
* The object-being sliced in an assignment to a slice is referenced, notJeremy Hylton2001-09-141-2/+2
| | | | | | | bound. When a Yield() node is visited, assign to the generator attribute of the scope, not the visitor.
* the new new doesn't define CO_xxx as the old new didJeremy Hylton2001-09-141-1/+9
|
* the names attribute of Global is not a nodeJeremy Hylton2001-09-141-1/+1
|
* SF patch #461413 (Gerhard Häring): Add STARTTLS feature to smtplibGuido van Rossum2001-09-141-2/+54
| | | | | | | | | | | This patch adds the features from RFC 2487 (Secure SMTP over TLS) to the smtplib module: - A starttls() function - Wrapper classes that simulate enough of sockets and files for smtplib, but really wrap a SSLObject - reset the list of known SMTP extensions at each call of ehlo(). This should have been the case anyway.
* Changed the dict implementation to take "string shortcuts" only whenTim Peters2001-09-141-2/+36
| | | | | | | | | | | | | | | | keys are true strings -- no subclasses need apply. This may be debatable. The problem is that a str subclass may very well want to override __eq__ and/or __hash__ (see the new example of case-insensitive strings in test_descr), but go-fast shortcuts for strings are ubiquitous in our dicts (and subclass overrides aren't even looked for then). Another go-fast reason for the change is that PyCheck_StringExact() is a quicker test than PyCheck_String(), and we make such a test on virtually every access to every dict. OTOH, a str subclass may also be perfectly happy using the base str eq and hash, and this change slows them a lot. But those cases are still hypothetical, while Python's own reliance on true-string dicts is not.
* Now that file objects are subclassable, you can get at the file constructorTim Peters2001-09-132-2/+44
| | | | | | just by doing type(f) where f is any file object. This left a hole in restricted execution mode that rexec.py can't plug by itself (although it can plug part of it; the rest is plugged in fileobject.c now).
* Use the keyword form of file() instead of open() to create TESTFN.Tim Peters2001-09-131-2/+2
|