Commit Graph

4150 Commits

Author SHA1 Message Date
Guido van Rossum 261d91a3f9 Make doctest's self-test succeed after the previous change. 2001-03-18 17:05:58 +00:00
Guido van Rossum af00a46599 Print a bunch of asterisks before the failure summary, to separate it
from the last failure report.
2001-03-18 16:58:44 +00:00
Tim Peters 0f33604e17 SF bug [ #409448 ] Complex division is braindead
http://sourceforge.net/tracker/?func=detail&aid=409448&group_id=5470&atid=105470
Now less braindead.  Also added test_complex.py, which doesn't test much, but
fails without this patch.
2001-03-18 08:21:57 +00:00
Andrew M. Kuchling 7620bbdcbf Fix bug #233253: the --define and --undef options didn't work, whether
specified on the command-line or in setup.cfg.  The option processing
   leaves them as strings, but they're supposed to be lists.
2001-03-17 20:15:41 +00:00
Andrew M. Kuchling 898f099dc6 Bug #409403: Signal an error if the distribution's metadata has no version 2001-03-17 19:59:26 +00:00
Thomas Heller d179be8b8b Distutils version number has been changed from 1.0.1 to 1.0.2pre
before this get forgotten again.
Should probably be set to 1.0.2 before final release of python 2.1

Does someone still release distutils separate from python?
2001-03-16 21:00:18 +00:00
Thomas Heller 5c5ea1a461 The bdist_wininst.py command has been recreated after wininst.exe
has been changed to include an uninstaller.
I forgot to mention in the uninstaller checkin that the logfile
name (used for uninstalling) has been changed from
<module>.log to <module>-wininst.log. This should prevent
conflicts with a distutils logfile serving the same purpose.

The short form of the --bdist-dir (-d) option has been removed
because it caused conflicts with the short form of the --dist-dir
option.
2001-03-16 20:57:37 +00:00
Fred Drake 669573726b Change RuntimeError to SGMLParseError, which subclasses RuntimeError
for backward compatibility.

Add support for SGML declaration syntax (<!....>) to some reasonable
degree.  This does not support everything allowed in SGML, but should
work with "real" HTML (internal subset in a DOCTYPE is not handled).
The content of the declaration is passed to the .handle_decl() method,
which can be overridden by subclasses.
2001-03-16 20:04:57 +00:00
Tim Peters 30edd2387d Whitespace normalization. 2001-03-16 08:29:48 +00:00
Ka-Ping Yee 3bda4f0878 Remove redundant "__future__:" from module docstring. 2001-03-15 10:45:44 +00:00
Fred Drake 904f2fcbd7 Import the exceptions that this module can raise. 2001-03-14 22:43:47 +00:00
Jeremy Hylton adcf8a05a4 Add doc string for run from profile.doc. (pydoc motivates me to write
good doc strings.)

Fix silly argument handling; was using *args but really wanted 1
optional arg.

XXX Should profile.doc be merged into the documentation and removed
from the Lib directory?
2001-03-14 20:01:19 +00:00
Sjoerd Mullender 538453e155 Moved clearing of "literal" flag. The flag is set in setliteral which
can be called from a start tag handler.  When the corresponding end
tag is read the flag is cleared.  However, it didn't get cleared when
the start tag was for an empty element of the type <tag .../>.  This
modification fixes the problem.
2001-03-14 17:03:30 +00:00
Fred Drake 62dfed96be Change "[%s]" % string.whitespace to r"\s" in regular expressions. 2001-03-14 16:18:56 +00:00
Skip Montanaro 44d5e0c418 updated __all__ to include several other names 2001-03-13 19:47:16 +00:00
Martin v. Löwis 126f2f62db Patch #407965: Improve Level 2 conformance of minidom
- addition of a DocumentFragment implementation and createDocumentFragment method
- proper setting of ownerDocument for all nodes
- setting of namespaceURI to None in Element as a class attribute
- addition of setAttributeNodeNS and removeAttributeNodeNS as aliases
  for setAttributeNode and removeAttributeNode
- support for inheriting from DOMImplementation to extend it with
  additional features (to override the Document class)
in pulldom:
- support for nodes (comment and PI) that occur before he document element;
  that became necessary as pulldom now delays creation of the document
  until it has the document element.
2001-03-13 10:50:13 +00:00
Guido van Rossum a8f7e59761 Oops. A RISCOS patch I forgot to check in. 2001-03-13 09:31:07 +00:00
Jeremy Hylton 5b44a67bdb Add test to verify that nested functions with free variables don't
cause the free variables to leak.
2001-03-13 02:01:12 +00:00
Fred Drake 521c83dd80 Multifile.read(): Fix a broken conversion to string methods.
This closes SF bug #407777.
2001-03-12 02:56:15 +00:00
Ka-Ping Yee 22fcae976a Make docstrings raw, since they contain literal backslashes. 2001-03-10 09:33:14 +00:00
Ka-Ping Yee a6e59719ec Fix findsource() to work for derived classes. 2001-03-10 09:31:55 +00:00
Fred Drake 63085d4d1e Import the nested_scopes feature twice, to exercise the patch introduced
to avoid segfaults when more than one feature is named in the future
statement.

This tests for regression of SF bug #407394.
2001-03-10 02:18:47 +00:00
Martin v. Löwis f115a0826d Replace setenv with putenv. Reported by Dietmar Schwertberger. 2001-03-07 09:08:11 +00:00
Martin v. Löwis a90f438d4a Unify _Environ processing on riscos with other platforms. 2001-03-07 09:05:45 +00:00
Skip Montanaro 81e4b1c5c8 fix typo in extending __all__ for riscos platform - closes bug 406296 2001-03-06 15:26:07 +00:00
Fred Drake ec6ec90dd2 Define & use NetrcParseError instead of improperly overloading SyntaxError.
Always has the lineno and filename of the source text.
2001-03-06 06:33:08 +00:00
Jack Jansen 282fed1363 Grr, splittag was also missing from __all__. 2001-03-05 13:45:38 +00:00
Jack Jansen 49985638fa Added url2pathname and pathname2url to __all__. 2001-03-05 13:41:14 +00:00
Tim Peters 243bff4708 Clean up junk files left behind by imp.load_source(). 2001-03-04 00:30:25 +00:00
Ka-Ping Yee feb6719851 Use r""" instead of """ for the docstring so that backslashes are preserved. 2001-03-02 23:31:43 +00:00
Guido van Rossum d1d053cc3f Patch by Itamar S.T. (SF#305470): add reset() method. 2001-03-02 13:35:37 +00:00
Fred Drake 53a79060bb When not copying a file because the output is up to date, make the message
slightly more brief, and more like the message that an extension will not
be built because the built copy is up to date.
2001-03-02 07:28:03 +00:00
Guido van Rossum b7fe432a88 Fix by Donn Cave for BeOS (SF #403642):
UNIX style fork/execve/wait are not fully compatible with thread
  support on BeOS.  For Python, that means neither fork() from import
  nor import from a fork work reliably. os._execvpe() does the latter,
  importing tempfile to set up a tantalizing target for hackers. This
  patch replaces both the tempfile name generation and the exec that
  uses it, in case we're on BeOS. Need this for
  setup:distutils:execvp(); symptoms are random crashes and internal
  BeOS error messages about th name, in case we're on BeOS. It's an
  issue because setup.py + distutils calls os.execvp(); symptoms are
  random crashes during setup.py, and internal BeOS error messages
  about thread IDs.
2001-03-02 07:04:51 +00:00
Guido van Rossum d74fb6b12a RISCOS changes by dschwertberger. 2001-03-02 06:43:49 +00:00
Guido van Rossum 4ba3d657ef Use != instead of <>. Sorry, Barry. 2001-03-02 06:42:34 +00:00
Ka-Ping Yee db8ed1517f Use '127.0.0.1' only on Mac; for other, sane platforms, use 'localhost'. 2001-03-02 05:58:17 +00:00
Guido van Rossum 228d80736c RISCOS files by dschwertberger 2001-03-02 05:58:11 +00:00
Ka-Ping Yee c92cdf7aa7 The sys.platform identifier for Windows is just 'win32' (for all varieties). 2001-03-02 05:54:35 +00:00
Guido van Rossum 7dcf84f2f8 Search /tmp before /var/tmp and /usr/tmp -- this seems preferred.
SF patch #404564, Gregor Hoffleit.
2001-03-02 05:51:16 +00:00
Ka-Ping Yee 4eb0c003f8 Make getsourcefile() succeed even if the filename doesn't end in '.py' --
as long as the filename also doesn't end in a suffix that indicates
    a binary file (according to the flags in imp.get_suffixes()).

Shrink try...except clauses and replace some of them with explicit checks.
2001-03-02 05:50:34 +00:00
Ka-Ping Yee 9054344d14 Replace literal '@test' with TESTFN. 2001-03-02 05:48:10 +00:00
Guido van Rossum ca956e2e47 When catching errors from os.rmdir(), test for os.error, not IOError! 2001-03-02 05:46:17 +00:00
Guido van Rossum b616e114f7 Believe it or not, but "more" on Windows requires "more <file" rather
than "more file".  Since tempfilepager() is only used on Windows, it
seems, do this unconditionally -- on Unix, it always invokes something
else.
2001-03-02 04:27:08 +00:00
Tim Peters fd85a4e600 Typo repair. 2001-03-02 03:11:53 +00:00
Tim Peters d74bc432b2 Make names in __future__.py bind to class instances instead of 2-tuples.
Suggested on c.l.py by William Tanksley, and I like it.
2001-03-02 02:53:08 +00:00
Ka-Ping Yee 239432a545 Clean up the handling of getsourcefile/getabsfile.
Remove __main__ from the index of built-in modules.
Miscellaneous compatibility fixes.
2001-03-02 02:45:08 +00:00
Ka-Ping Yee c113c24e19 Clarify the purpose of getsourcefile().
Add getabsfile() for getting a most-normalized path.
2001-03-02 02:08:53 +00:00
Ka-Ping Yee 0a8c29be4b Clarify synopsis line a bit.
Remove -no-about-splash option (not understood by all Netscapes).
2001-03-02 02:01:40 +00:00
Tim Peters fc35de409b test_global was broken by some recent checkin. Repairing. 2001-03-02 01:48:16 +00:00
Ka-Ping Yee 7a25765f48 When seeking the module for an object, compare absolute (not relative) paths. 2001-03-02 01:19:39 +00:00
Ka-Ping Yee a2fe103c9b Use imp.get_suffixes to determine a module name in modulename(file).
When possible, display strings containing backslashes using r'' notation.
2001-03-02 01:19:14 +00:00
Guido van Rossum 9aa643cf69 Test interaction of global and nested scopes -- thanks to Samuele Pedroni. 2001-03-01 20:35:45 +00:00
Ka-Ping Yee d977e35dd0 Also accept .so as an extension for module files. 2001-03-01 19:31:25 +00:00
Ka-Ping Yee 4f64c13582 Better __credits__. 2001-03-01 17:11:17 +00:00
Ka-Ping Yee 244c593598 Add __author__ and __credits__ variables. 2001-03-01 13:56:40 +00:00
Ka-Ping Yee 8b58b84d72 Add __author__ variable.
Robustify: don't rely on modules being present in sys.modules.
2001-03-01 13:56:16 +00:00
Ka-Ping Yee 66efbc7481 Docstring improvements.
Add checks for .pyo and .pyd.
Collapse docfunction, docmethod, docbuiltin into the one method docroutine.
Small formatting fixes.
Link the segments of a package path in the title.
Link to the source file only if it exists.
Allow modules (e.g. repr.py) to take precedence over built-ins (e.g. repr()).
Add interruptible synopsis scanner (so we can do searches in the background).
Make HTTP server quit.
Add small GUI for controlling the server and launching searches (like -k).
    (Tested on Win2k, Win98, and Linux.)
2001-03-01 13:55:20 +00:00
Moshe Zadka 8a18e99008 Checking in patch 404826 -- urllib2 enhancements and documentations.
(please not that the library reference does *not* include the
urllib2 documnetation -- that will wiat for Fred)
2001-03-01 08:40:42 +00:00
Tim Peters 251083142f Whitespace normalization. 2001-03-01 08:31:39 +00:00
Skip Montanaro 40fc16059f final round of __all__ lists (I hope) - skipped urllib2 because Moshe may be
giving it a slight facelift
2001-03-01 04:27:19 +00:00
Skip Montanaro 58eadbaf12 move import into function to avoid having to add an __all__ list... 2001-03-01 04:13:51 +00:00
Ka-Ping Yee 59ade08079 Add getlineno() routine to account for LINENO optimization. 2001-03-01 03:55:35 +00:00
Fred Drake 5c015344a6 Add tests for the .copy() methods of both weak dictionary classes. 2001-03-01 03:06:53 +00:00
Fred Drake 9d2c85dec7 Change WeakDictionary to WeakValueDictionary in a couple more places.
WeakValueDictionary.copy(),
WeakKeyDictionary.copy():  Actually return the copy!
2001-03-01 03:06:03 +00:00
Ka-Ping Yee 1d384634bf Normalize case of paths in sys.path to avoid duplicates on Windows.
Handle <... at 001B6378> like <... at 0x120f80> (%p is platform-dependent).
Fix RCS version tag handling.
Move __main__ behaviour into a function, pydoc.cli().
2001-03-01 00:24:32 +00:00
Jeremy Hylton 2922ea8235 Add test case for global stmt at module level.
Fix test_grammar so that it ignores warning about global stmt at
module level in exec.
2001-02-28 23:49:19 +00:00
Jeremy Hylton 42efed0fc3 update output to reflect exception that is now raised 2001-02-28 23:24:22 +00:00
Jeremy Hylton 150a6640f5 Fix filter for SyntaxErrors 2001-02-28 22:50:15 +00:00
Guido van Rossum 3756fa3e11 Move a comment around to where it belongs (the code had alrady been
moved).
2001-02-28 22:26:36 +00:00
Fred Drake 9c98a428ef Move some constant initialization from FTP.__init__() and FTP.connect()
to the class namespace.

Allow FTP.close() to be called more than once without tossing cookies.
(This seems to be a fairly common idiom for .close() methods, so let's
try to be consistent.)
2001-02-28 21:46:37 +00:00
Guido van Rossum 9e26318975 Add a new API:
warn_explicit(message, category, filename, lineno, module, registry)

The regular warn() call calculates a bunch of values and calls
warn_explicit() with these.

This will be used to issue better syntax warnings.
2001-02-28 21:43:40 +00:00
Andrew M. Kuchling 3a95850323 Leave #! lines featuring /usr/bin/env alone 2001-02-28 20:59:33 +00:00
Andrew M. Kuchling 6335773434 Placate tabnanny 2001-02-28 19:40:27 +00:00
Fred Drake 3e038e5e25 Define lots of constants for indexes into the structures for the file
header and central directory structures, and use them as appropriate.
The point being to make it easier to tell what is getting pulled out
where; magic numbers are evil!

Change the computation of the ZipInfo.file_offset field to use the
length of the relevant "extra" field -- there are two different ones,
and the wrong one had been used.  ;-(

This closes SF tracker patch #403276, but more verbosely than the
proposed patch.
2001-02-28 17:56:26 +00:00
Jeremy Hylton 62e2c7e3df Add regression test for future statements. This adds eight files, but
seven are not tests in their own right; these files are mentioned in
regrtest.
2001-02-28 17:48:06 +00:00
Tim Peters 85ba673b0a Whitespace normalization. 2001-02-28 08:26:44 +00:00
Fred Drake 6e7e485d5d Added regression test for SF tracker bug #403871: AttributeError in
ZipFile.__del__() when there was an IOError opening the underlying
    file in ZipFile.__init__().

    This is an odd test: since the exception is in the __del__() method,
    it is not propogated.  This test will trigger it but regrtest.py
    does not detect the failure (not sure why); we are dependent on it
    actually being noticed by a user to get a new bug report if it ever
    fails.  ;-(

    On the other hand, this makes sure that code gets exercised, so
    a failure could be noticed!
2001-02-28 05:34:16 +00:00
Fred Drake 90eac285c8 Fix SF tracker bug #403871: AttributeError in ZipFile.__del__() when
there was an IOError opening the underlying file in ZipFile.__init__().
2001-02-28 05:29:34 +00:00
Jeremy Hylton 8e43cd7929 verify that warnings are issued for bogus uses of global 2001-02-28 01:51:01 +00:00
Skip Montanaro ff443a51eb added missing element to __all__ 2001-02-28 01:03:48 +00:00
Skip Montanaro 6c0a0e1538 added some elements missing from __all__ 2001-02-28 01:00:58 +00:00
Ka-Ping Yee 457aab237f Macintosh compatibility. 2001-02-27 23:36:29 +00:00
Ka-Ping Yee 5e2b173333 Acknowledgements. 2001-02-27 23:35:09 +00:00
Ka-Ping Yee 40c49919fb Fix $Revision$ processing so it doesn't get eaten by CVS! 2001-02-27 22:46:01 +00:00
Ka-Ping Yee 09d7d9a552 Add $Revision: $ tag. 2001-02-27 22:43:48 +00:00
Ka-Ping Yee 6f3f9a4c64 Add display of $Revision $ and credits. 2001-02-27 22:42:36 +00:00
Fred Drake 5dd09bb5df No need to call filterwarnings() to suppress further warnings from this
module; that won't happen.
2001-02-27 21:51:47 +00:00
Fred Drake ddd802cbd7 Replace all the platform-specific TERMIOS modules with a portable version
based on the termios module.  The only added "feature" is the deprecation
warning it spits out.
2001-02-27 21:35:40 +00:00
Fred Drake 1191d0148f Get the needed constants from termios, not TERMIOS. 2001-02-27 21:23:31 +00:00
Andrew M. Kuchling 6efc6e7832 Patch #404680: disables the nis module and enables the dl module when
building under Cygwin.  Makes some fixes to the dlmodule in order to
    compile with Cygwin.
2001-02-27 20:54:23 +00:00
Jeremy Hylton 5941d191de add from __future__ import nested_scopes to strings passed to compile 2001-02-27 20:23:58 +00:00
Andrew M. Kuchling 83c158fdc9 Bug #229280: remove '/' characters from the OS name (for BSD/OS :) ) 2001-02-27 19:25:42 +00:00
Andrew M. Kuchling a34dbe0fdc Patch #403947: On Cygwin, use the Unix compiler class, and not
the Cygwin-specific compiler class.

 (According to Jason Tishler, cygwinccompiler needs some work to
  handle the differences in Cygwin- and MSVC-Python. Makefile and
  config files are currently ignored by cygwinccompiler, as it was
  written to support cygwin for extensions which are intended to be
  used with the standard MSVC built Python.)
2001-02-27 19:13:15 +00:00
Andrew M. Kuchling 9767e76808 Patch #404275: generate a reasonable platform string for AIX 2001-02-27 18:48:00 +00:00
Jeremy Hylton 8016a4b0af Remove two meaningless, module-level global statements (one of a
non-existent variable :-).

Reflow long lines.
2001-02-27 18:44:14 +00:00
Martin v. Löwis 5e1633365d Patch #403985: Add support for weak-keyed dictionaries 2001-02-27 18:36:56 +00:00
Ka-Ping Yee dd1753434a pydoc: text and HTML documentation generator for interactive use 2001-02-27 14:43:46 +00:00
Ka-Ping Yee 6397c7c9a9 inspect: a module for getting information out of live Python objects 2001-02-27 14:43:21 +00:00
Moshe Zadka e99bd17ed6 Fixing bug #227562 by calling URLopener.http_error_default when
an invalid 401 request is being handled.
2001-02-27 06:27:04 +00:00
Jeremy Hylton 29906eef3a Preliminary support for future nested scopes
compile.h: #define NESTED_SCOPES_DEFAULT 0 for Python 2.1
           __future__ feature name: "nested_scopes"

symtable.h: Add st_nested_scopes slot.  Define flags to track exec and
    import star.

Lib/test/test_scope.py: requires nested scopes

compile.c: Fiddle with error messages.

    Reverse the sense of ste_optimized flag on
    PySymtableEntryObjects.  If it is true, there is an optimization
    conflict.

    Modify get_ref_type to respect st_nested_scopes flags.

    Refactor symtable_load_symbols() into several smaller functions,
    which use struct symbol_info to share variables.  In new function
    symtable_update_flags(), raise an error or warning for import * or
    bare exec that conflicts with nested scopes.  Also, modify handle
    for free variables to respect st_nested_scopes flag.

    In symtable_init() assign st_nested_scopes flag to
    NESTED_SCOPES_DEFAULT (defined in compile.h).

    Add preliminary and often incorrect implementation of
    symtable_check_future().

    Add symtable_lookup() helper for future use.
2001-02-27 04:23:34 +00:00