Commit Graph

3569 Commits

Author SHA1 Message Date
Fredrik Lundh d11b5e54f0 Recompile pattern if (?x) flag was found inside the pattern during the
first scan.  Closes bug #115040.
2000-10-03 19:22:26 +00:00
Guido van Rossum f19a7ac220 Fix a few problems with the _Printer class and the license variable.
1. repr(license) will no longer print to stdout and read from stdin;
you have to use license().  `license` is a short message explaining
this.

2. Use lazy initialization so that startup isn't slowed down by the
search for the LICENSE file.

3. repr(license) actually returns the desired string, rather than
printing to stdout and returning ''.  (Why didn't we think of this
before?)

4. Use the pythonlabs license URL as the license fallback instead of
the CNRI license handle.
2000-10-03 17:11:37 +00:00
Thomas Wouters f2c1be22f2 On some systems (like Solaris), the master end of a tty/pty pair is
apparently not considered a terminal, and so isatty(3) returns false. So we
skip the test for ttyness of the master side and just check the slave side,
which should really be a terminal.
2000-10-03 16:51:08 +00:00
Fredrik Lundh 65d4bc616a Fixed negative lookahead/lookbehind. Closes bug #115618. 2000-10-03 16:29:23 +00:00
Guido van Rossum 5191463276 Undo Ping's change.
CGI scripts should *not* use /usr/bin/env, since on systems that don't
come standard with Python installed, Python isn't on the default $PATH.

Too bad that this breaks on Linux, where Python is in /usr/bin which
is on the default path -- the point is that you must manually edit
your CGI scripts when you install them.
2000-10-03 13:51:09 +00:00
Ka-Ping Yee 099e534fa4 Change first line to #!/usr/bin/env python (really just to test check-in). 2000-10-03 08:32:00 +00:00
Greg Ward da175f4bdd Bump version to 1.0. 2000-10-03 03:48:43 +00:00
Greg Ward 25a309c0a9 Remove some debugging prints. 2000-10-03 03:32:37 +00:00
Greg Ward a9d37835ad Fixed so --no-compile is a negative alias for --compile. 2000-10-03 03:31:52 +00:00
Greg Ward 9216cfe7ba Added a long-winded comment (and commented-out comment to go with out)
about how it would be nice to write absolute paths to the temporary
byte-compilation script, but this doesn't work because it screws up the
trailing-slash trickery done to 'prefix' in build_py's 'byte_compile()'
method.

Fixed to use 'execute()' instead of 'os.remove()' to remove the temporary
script: now it doesn't blow up in dry-run mode!
2000-10-03 03:31:05 +00:00
Jeremy Hylton d52755f41c Provide a clearer error message when urlopen fails because of an
invalid proxy setting.

Minor change to call of unknown_url; always pass data argument
explicitly since data defaults to None.

PEP 42: Add as a feature that urllib handle proxy setting that contain
only the host and port of the proxy.
2000-10-02 23:04:02 +00:00
Fred Drake d254c0095c Remove redundent information from a docstring. 2000-10-02 22:11:47 +00:00
Fred Drake 484d735f1e Delay import of py_compile until needed, since is is only used by the
PyZipFile class.

End sentences in docstrings with periods.

Reformat docstrings to be more similar to those of other modules.
2000-10-02 21:14:52 +00:00
Fred Drake 3944a01713 Do not set Konquerer to be the default browser if $KDEDIR is set -- some
Linux distributions which provide both KDE and Gnome set this environment
variable even if the user is not using KDE.  We do *not* want to start
Konquerer if KDE is not running unless the user actually tells us to!
2000-10-02 03:40:51 +00:00
Greg Ward 0295181fa6 Typo fix. 2000-10-02 02:25:51 +00:00
Greg Ward 73a6c942cd Added the ability to do byte-compilation at build time, currently off
by default (since compiling at install time works just fine).  Details:
  - added 'compile' and 'optimize' options
  - added 'byte_compile()' method
  - changed 'get_outputs()' so it includes bytecode files
A lot of the code added is very similar to code in install_lib.py;
would be nice to factor it out further.
2000-10-02 02:19:04 +00:00
Greg Ward 8161022d4d Added --compile, --optimize options so users have an easy way to
instruct the "install_lib" command from the command-line.
2000-10-02 02:16:04 +00:00
Greg Ward cb9c9aed01 Finished the overhaul of byte-compilation options: there's now a 6-way
choice between (compile, no-compile) * (optimize=0, optimize=1,
optimize=2).  Details:
  - added --no-compile option to complement --compile, which has
    been there for ages
  - changed --optimize (which never worked) to a value option, which
    expects 0, 1, or 2
  - renamed 'bytecompile()' method to 'byte_compile()', and beefed
    it up to handle both 'compile' and 'optimize' options
  - fix '_bytecode_filenames()' to respect the new options
2000-10-02 02:15:08 +00:00
Greg Ward 04cc88df05 Remove the temporary byte-compilation script when we're done with it. 2000-10-02 02:09:55 +00:00
Greg Ward c1acc69018 From 'run()', only call 'bytecompile()' if we actually have
pure Python modules to compile.
2000-10-01 23:50:13 +00:00
Greg Ward f217e2124a Tweaked 'byte_compile()' so it silently skips non-Python files, rather than
blowing up.
2000-10-01 23:49:30 +00:00
Martin v. Löwis 4b6ea798cb Don't rename Tkinter to Tk; closes bug 115714
Subclass Error from Exception.
2000-10-01 17:52:01 +00:00
Barry Warsaw 370a29fe42 Added a zip() test where one of the arguments is an instance whose
class has no __getitem__().  This raises an AttributeError.
2000-10-01 04:28:43 +00:00
Fred Drake cc4adf27f4 Add missing "s" from format string.
This closes SourceForge patch #101714.
2000-09-30 23:59:04 +00:00
Greg Ward 1df6e7b1fc Reduced the 'bytecompile()' method to a one-line wrapper around
'util.byte_compile()'.  Currently just reproduces the existing functionality
-- doesn't use any of the fancy features in the new 'byte_compile()'.
2000-09-30 20:39:09 +00:00
Greg Ward 1297b5ce67 Added 'byte_compile(): an all-singing, all-dancing wrapper around the
standard 'py_compile.compile()' function.  Laundry list of features:
  - handles standard Distutils 'force', 'verbose', 'dry_run' flags
  - handles various levels of optimization: can compile directly in
    this interpreter process, or write a temporary script that is
    then executed by a new interpreter with the appropriate flags
  - can rewrite the source filename by stripping an optional prefix
    and preprending an optional base dir.
2000-09-30 20:37:56 +00:00
Greg Ward 4752769d08 Various docstring tweaks.
Fixed 'subst_vars()' so it actually blows up like the docstring claims
  (and fixed the docstring not to claim it handles ${var}, which it
  doesn't).
2000-09-30 18:49:14 +00:00
Greg Ward b8b263b92f Reformat docstrings. 2000-09-30 18:40:42 +00:00
Greg Ward cb1f4c4d33 Standardized whitespace around function calls. 2000-09-30 18:27:54 +00:00
Greg Ward 963cd2d85d Andrew Kuchling: changed so the '_path_created' dictionary is keyed on
absolute pathnames; this lets it keep working in the face of chdir'ing
around.
2000-09-30 17:47:17 +00:00
Greg Ward 3e6d43801b Fixed 'run()' so it doesn't call 'bytecompile()' if 'install()' returned None. 2000-09-30 17:35:26 +00:00
Greg Ward e564278bfd Expect a tuple (dest_name, copied) from 'copy_file()'. 2000-09-30 17:34:50 +00:00
Greg Ward 3a5a2bd486 Changed 'build_module()' so it returns the result of 'copy_file()'
on the module file -- could be useful for subclasses overriding it.
2000-09-30 17:33:05 +00:00
Greg Ward 0d4a853109 Changed 'copy_file()' so it returns a tuple (dest_name, copied) -- hopefully,
this will please everyone (as if that's possible).
2000-09-30 17:29:35 +00:00
Greg Ward ec84c21ce2 In 'get_platform()', handle so-called POSIX systems that don't have
'uname()' -- specifically NeXTSTEP.
2000-09-30 17:09:39 +00:00
Greg Ward 64d855adca Changed to use the 'sub-commands' machinery:
- added 'sub_commands' class attr
  - added 'has_*()' predicates referenced by the sub-command list
  - rewrote 'run()' so it's a trivial loop over relevant sub-commands
2000-09-30 17:08:12 +00:00
Greg Ward 70b1fd1a99 Moved some things around for better organization. 2000-09-30 17:05:37 +00:00
Martin v. Löwis efffd28c2c Add mimetools testcase. 2000-09-30 17:03:19 +00:00
Martin v. Löwis 25d1692434 Return after writing 7bit or 8bit encodings. Closes bug 115712 2000-09-30 16:52:45 +00:00
Martin v. Löwis af484d5a0c Mention in the module's doc string that other functions of the socket API
appear as methods on socket objects.
2000-09-30 11:34:30 +00:00
Fred Drake 5db246d1fa Always use the same name for the exception defined in this module!
Error reported via email by Pete Shinners <pete@visionart.com>.

Fixed some indentation inconsistencies.
2000-09-29 20:44:48 +00:00
Martin v. Löwis 3f0969f100 Use string functions instead of methods to allow sharing this module with PyXML 2000-09-29 19:00:40 +00:00
Martin v. Löwis 491ded78cc Remove dependency from saxutils when loading xmlreader 2000-09-29 18:59:50 +00:00
Thomas Heller 1dbe9d5247 Removed the extra_dirs and path_file metadata options.
They are unneeded: All this stuff is already done by the
install command which is run by bdist_wininst.

One bug has been fixed:
The root of the fake install tree is install.install_purelib,
not install.install_lib!
They are different if the extra_path option is used in
the setup function.

Rebuild after the changes to wininst.exe.
2000-09-29 11:36:55 +00:00
Thomas Heller 18b9b93df3 Removed the implib_dir instance variable because it is unused.
Removed get_ext_libname() because it is unused.

Fixed get_libraries() to append an '_d' to the python debug
import library. If MSVC is used, do not add 'pythonxx.lib' to
the list of libraries, because this is handled better
by a pragma in config.h.

This should fix bug #115595, but it needs some more testing.
2000-09-28 19:28:35 +00:00
Fred Drake 20af3172ce popen4(): Added for Unix.
Fixed a typo in a docstring.
2000-09-28 19:10:56 +00:00
Fred Drake d75e63a865 popen4(), class Popen4: popen4() support for Unix.
popen2(), popen3():  Reversed order of bufsize and mode parameters to
                     comply with what was here before (Python 1.5.2).

class Popen3:  Factored the __init__() into a more basic initializer and
               a helper method, to allow some re-use by the Popen4 class.
               Use os.dup2() instead of os.dup() to create the proper
               file descriptors in the child process.

This closes SourceForge bug #115330 and partially closes #115353.
2000-09-28 19:07:53 +00:00
Fred Drake 38cb9f1f17 Convert all entries on sys.path to absolute paths, and also update the
__file__ attributes of already-imported modules to be absolute.  This helps
robustify the interpreter against os.chdir() calls from the application.

Only remove setdefaultencoding() from sys if it exists; if this module is
run as a script (since there is a _test() function that gets run), it broke
because the script attempts to remove it again after the import of site
has already done so.  This allows the module to be run as a script again.

makepath():  New function, standardizes all pathname normalization in one
             place.
2000-09-28 16:52:36 +00:00
Fred Drake b4e460ac4b Avoid import of string module; it is only needed for expandvars().
Never assume that os.sep is for the module-specific platform; use the
right separator character directly.
Fix some minor style consistency nits.
2000-09-28 16:25:20 +00:00
Fred Drake c0ab93ef6f Minor style nits. 2000-09-28 16:22:52 +00:00
Fred Drake 22fb839f0c Remove imports of string when string methods will do. 2000-09-28 15:04:39 +00:00
Fred Drake 954383356f Added some tests for the truncate() method; one is commented out because
cStringIO does not get it right (reported as SF bug #115531).

Added test for ValueError when write() is called on a closed StringIO
object.  Commented out because cStringIO does not get it right
(reported as SF bug #115530).
2000-09-28 04:25:33 +00:00
Fred Drake e0a7f4f9d5 Add truncate() method to StringIO objects.
This closes SourceForge bug #115527.
2000-09-28 04:21:06 +00:00
Fred Drake d391a34926 Remove change that had not been saved when the output was generated;
not terribly useful.
Reported by Mark Favas <Mark.Favas@per.dem.csiro.au>.
2000-09-28 04:13:15 +00:00
Fred Drake 8ef6767e00 Regression test for ConfigParser module. 2000-09-27 22:45:25 +00:00
Fred Drake 2a37f9f862 Allow spaces in section names.
Do not expose the __name__ when reporting the list of options available
for a section since that is for internal use.

This closes SourceForge bug #115357.

Additionally, define InterpolationDepthError and MAX_INTERPOLATION_DEPTH.
The exception is raised by get*() when value interpolation cannot be
completed within the defined recursion limit.  The constant is only
informative; changing it will not affect the allowed depth.

Fix the exit from get() so that None is not returned if the depth is met
or exceeded; either return the value of raise InterpolationDepthError.
2000-09-27 22:43:54 +00:00
Marc-André Lemburg 23542dc6eb Updated hash values to match the new encoding (UTF-8) used in the test. 2000-09-27 12:25:14 +00:00
Marc-André Lemburg 67ceca7add Fixed encoding to use an endianness independent format. 2000-09-27 12:24:34 +00:00
Lars Gustäbel 6a7768ae4f Fixed misleading qname in test_xmlgen_ns (reported by loewis). 2000-09-27 08:12:17 +00:00
Greg Ward ef850def44 Bump version to 1.0pre. 2000-09-27 02:26:57 +00:00
Greg Ward 264cf74e1a Remove deprecation warnings on old 'link_*()' methods, ie. they're not
deprecated after all.  But now they're only implemented once, instead
of N times.
2000-09-27 02:24:21 +00:00
Greg Ward 4240648a9d Big patch from Rene Liebscher to simplify the CCompiler API and
implementations.  Details:
  * replace 'link_shared_object()', 'link_shared_lib()', and
    'link_executable()' with 'link()', which is (roughly)
    the union of the three methods it replaces
  * in all implementation classes (UnixCCompiler, MSVCCompiler, etc.),
    ditch the old 'link_*()' methods and replace them with 'link()'
  * in the abstract base class (CCompiler), add the old 'link_*()'
    methods as wrappers around the new 'link()' (they also print
    a warning of the deprecated interface)

Also increases consistency between MSVCCompiler and BCPPCompiler,
hopefully to make it easier to factor out the mythical WindowsCCompiler
class.  Details:
  * use 'self.linker' instead of 'self.link'
  * add ability to compile resource files to BCPPCompiler
  * added (redundant?) 'object_filename()' method to BCPPCompiler
  * only generate a .def file if 'export_symbols' defined
2000-09-27 02:08:14 +00:00
Greg Ward 8b2e4e89bd Bump version to 0.9.4. 2000-09-27 00:17:08 +00:00
Greg Ward 2c08cf0ffa Fix '_set_command_options()' so it only calls 'strtobool()' on strings
(was crashing on any boolean command-line option!).
2000-09-27 00:15:37 +00:00
Barry Warsaw c79dff679f Added an "import xml.parsers.expat" to turn errors due to not having
the parser built into ImportErrors.
2000-09-26 18:00:20 +00:00
Jeremy Hylton d635b1d724 The Usual 2000-09-26 17:32:27 +00:00
Fred Drake 0872e05851 Fix handling of file inputs on Windows; passing them to urllib.urlopen()
caused the drive letter to cause urlopen() to think it was an unrecognized
URL scheme.  This only passes system ids to urlopen() if the file does not
exist.  It works on Windows & Unix.

It should work everywhere else as well.
2000-09-26 17:23:09 +00:00
Marc-André Lemburg 6c8e4c3ee8 Test output data for the Unicode database test suite. 2000-09-26 16:19:27 +00:00
Marc-André Lemburg 6a20ee7dec Added test suite for the complete Unicode database. The test previously
only tested a few cases.
2000-09-26 16:18:58 +00:00
Greg Ward d8f7f81254 Bump version to 0.9.3. 2000-09-26 02:51:09 +00:00
Greg Ward ca4289f7b2 Reformat docstrings.
Standardize whitespace in function calls.
2000-09-26 02:13:49 +00:00
Greg Ward 071ed76732 Standardize whitespace in function calls. 2000-09-26 02:12:31 +00:00
Greg Ward 449f5568b7 Whitespace fix. 2000-09-26 02:03:34 +00:00
Greg Ward a30f7aca08 Reformat docstrings.
Standardize whitespace in function calls.
2000-09-26 02:00:51 +00:00
Greg Ward be86bdea73 Standardize whitespace in function calls. 2000-09-26 01:56:15 +00:00
Greg Ward fd7b91eff9 Standardize whitespace in function calls and docstrings. 2000-09-26 01:52:25 +00:00
Guido van Rossum de33c79fdb HP-UX is another one of those platforms using an alternative lock
structure (same as AIX).
2000-09-26 00:31:18 +00:00
Fred Drake af57431701 Include the version-detecting code to allow PyXML to override the "standard"
xml package.  Require at least PyXML 0.6.1.
2000-09-25 17:30:17 +00:00
Barry Warsaw 38bfc4d0d5 Add a test for SF bug #110621; stripping square brackets off of
addresses with domain literals.
2000-09-25 15:09:28 +00:00
Barry Warsaw 2ea2b1133e AddrlistClass.getdomainliteral(): rfc822 requires that the domain
literal be wrapped in square brackets.  This fix replaces the square
brackets that were previously being stripped off.  Closes SF bug
#110621.
2000-09-25 15:08:27 +00:00
Guido van Rossum 4126736791 When reading the file, option names were not passed through
self.optionxform(), which (in the default case) caused options spelled
with opper case letters in their name to be inaccessible.  Reported by
"Todd R. Palmer" <t2palmer@bellsouth.net> on
activepython@listserv1.ActiveState.com.
2000-09-25 14:42:33 +00:00
Greg Ward 68ded6e6f1 Added 'translate_longopt()' function. 2000-09-25 01:58:31 +00:00
Greg Ward 2f2b6c62ba Change to use the new 'translate_longopt()' function from fancy_getopt, rather
than rolling our own with fancy_getopt's 'longopt_xlate' global.
2000-09-25 01:58:07 +00:00
Greg Ward d644ca2120 Added a bunch of missing "=" signs in the option table.
Removed script options -- don't think they ever worked, weren't
  very well thought through, etc.
2000-09-25 01:53:01 +00:00
Greg Ward af64aed5cf Renamed '--keep-tree' option to '--keep-temp', for consistency
with the bdist_* commands.
2000-09-25 01:51:01 +00:00
Greg Ward 99b032eaf2 Added 'boolean_options' list to support config file parsing. 2000-09-25 01:41:15 +00:00
Greg Ward 817dc098ef Added 'strtobool()' function: convert strings like "yes", "1",
"no", "0", etc. to true/false.
2000-09-25 01:25:06 +00:00
Greg Ward ceb9e226a6 Fixed some bugs and mis-features in handling config files:
* options can now be spelled "foo-bar" or "foo_bar" (handled in
    'parse_config_files()', just after we parse a file)
  * added a "[global]" section so there's a place to set global
    options like verbose/quiet and dry-run
  * respect the "negative alias" dictionary so (eg.) "quiet=1" is
    the same as "verbose=0" (this had to be done twice: once in
    'parse_config_file()' for global options, and once in
    '_set_command_options()' for per-command options)
  * the other half of handling boolean options correctly: allow
    commands to list their boolean options in a 'boolean_options'
    class attribute, and use it to translate strings (like "yes", "1",
    "no", "0", etc) to true or false
2000-09-25 01:23:52 +00:00
Thomas Wouters 84da8aa7e2 Fix inconsistent use of space/tabs. 2000-09-25 00:11:37 +00:00
Martin v. Löwis a13a9dcb9c Use SAX2 namespace support. 2000-09-24 21:54:14 +00:00
Martin v. Löwis 58af43fd76 [Patch 101634]
xml.sax: Fix parse and parseString not to rely on ExpatParser
         Greatly simplify import logic by using __import__
saxutils: Support Unicode strings and files as parameters to
          prepare_input_source
2000-09-24 21:31:06 +00:00
Martin v. Löwis 2066fa023c Find feature names in handler. 2000-09-24 21:17:39 +00:00
Lars Gustäbel 424980fd4d Enabled EntityResolver test again now that pyexpat.c has been fixed. 2000-09-24 20:57:04 +00:00
Lars Gustäbel 3a361f4f8b Fixed another bug. 2000-09-24 20:55:01 +00:00
Lars Gustäbel bb757136b2 Improvements to doco strings.
Tiny bug fix to expatreader.py (endDocument was only called after errors).
2000-09-24 20:38:18 +00:00
Martin v. Löwis 33315b180b Use findfile to locate input and output files. 2000-09-24 20:30:24 +00:00
Lars Gustäbel e292a24589 Added EntityResolver and DTDHandler (patch 101631) with test cases. 2000-09-24 20:19:45 +00:00
Lars Gustäbel 716efea181 Added necessary test input file for test_sax.py 2000-09-24 18:57:26 +00:00
Lars Gustäbel 523b0a6ec8 Added back the InputSource class (patch 101630). 2000-09-24 18:54:49 +00:00
Lars Gustäbel b7536d5860 Added test cases for the InputSource class. 2000-09-24 18:53:56 +00:00
Fredrik Lundh b49f88bfc1 - Improved handling of win32 proxy settings (addresses bug #114256).
The earlier code assumed "protocol=host;protocol=host;..." or "host",
but Windows may also use "protocol=host" (just one entry), as well as
"protocol://host".  This code needs some more work, so I'll leave the
bug open for now.
2000-09-24 18:51:25 +00:00
Lars Gustäbel ab64787dca Added test cases for the Attributes interface. 2000-09-24 18:40:52 +00:00
Lars Gustäbel 32bf12eb8a Updated to final Attributes interface (patch 101632). 2000-09-24 18:39:23 +00:00
Lars Gustäbel e84bf751bb Updated to new SAX method signatures (*NS, patch 101573). 2000-09-24 18:31:37 +00:00
Lars Gustäbel f43cf31f4a Updated to new *NS signatures (patch 101573). 2000-09-24 18:29:24 +00:00
Fredrik Lundh 19f977ba40 - don't hang if group id is followed by whitespace (closes bug #114660) 2000-09-24 14:46:23 +00:00
Lars Gustäbel 96753b3482 Added first start on SAX 2.0 tests. 2000-09-24 12:24:24 +00:00
Lars Gustäbel 358f4da29c Added back missing argument to ignorableWhitespace signature. 2000-09-24 11:06:27 +00:00
Lars Gustäbel fc643c339d Bug fix to namespace handling in XMLGenerator (now adds declarations).
Bug fixes to XMLFilterBase (wrong ignorableWhitespace signature and
did not inherit set*Handler methods from XMLReader.)
2000-09-24 10:53:31 +00:00
Nicholas Riley 9a580c440c Fixes for Python 1.6 compatibility - socket bind and connect get a
tuple instead two arguments.
2000-09-24 06:29:50 +00:00
Nicholas Riley 21afd01ce2 Change for Python 1.6 compatibility - UNIX's 'os' module defines
'spawnv' now, so we check for 'fork' first.
2000-09-24 06:28:47 +00:00
Fred Drake 1f54902e05 Conform to the Python style guide. 2000-09-24 05:21:58 +00:00
Fred Drake ddb486745b Conform more closely with the Python style guide. 2000-09-23 05:32:26 +00:00
Fred Drake 96ea196ea8 Use the public name for the Expat parser; "pyexpat" is deprecated. 2000-09-23 04:49:30 +00:00
Fred Drake 7fbc85c5c5 Rename the public interface from "pyexpat" to "xml.parsers.expat". 2000-09-23 04:47:56 +00:00
Fred Drake 003b9250e3 Add a wrapper around the pyexpat module, making the "public" name of
the module "xml.parsers.expat".
2000-09-23 04:44:43 +00:00
Greg Ward f84fb660cb Split 'run()' up into 'build()', 'install()', and 'bytecompile()' (for
easier extensibility).
2000-09-23 01:20:19 +00:00
Greg Ward 7b87c0e1bb Whitespace tweaks. 2000-09-23 01:10:10 +00:00
Greg Ward 9e3dc4e928 Reformat docstrings.
Standardize use of whitespace on function calls.
2000-09-23 00:59:34 +00:00
Fred Drake d9a8dec135 Maildir.__init__(): Use the correct filter for filenames, so that this
class conforms to the maildir specification.
2000-09-22 18:41:50 +00:00
Neil Schemenauer ef5f2b9dbb - plug a memory leak due to circular lists 2000-09-22 15:30:16 +00:00
Neil Schemenauer d569f23da9 - Replace debugleak flag with findleaks flag. The new SAVEALL GC option is
used to find cyclic garbage produced by tests.
2000-09-22 15:29:28 +00:00
Neil Schemenauer faae266e89 - Add test for new SAVEALL debugging flag
- Use exceptions rather than asserts for failing tests.
- Reorganize tests and produce some output if verbose option is set.
2000-09-22 15:26:20 +00:00
Tim Peters f58a7aafea Implemented new os.startfile function, unique to Windows, exposing a
subset of Win32 ShellExecute's functionality.  Guido wants this because
IDLE's Help -> Docs function currently crashes his machine because of a
conflict between his version of Norton AntiVirus (6.10.20) and MS's
_popen.  Docs for startfile are being mailed to Fred (or just read the
docstring -- it tells the whole story).
Changed webbrowser.py to use os.startfile instead of os.popen on Windows.
Changed IDLE's EditorWindow.py to pass an absolute path for the docs
(hardcoding ShellExecute's "directory" arg to "." as used to be done let
IDLE work, but made the startfile command exceedingly obscure for other
uses -- the MS docs are terrible, of course, & still not sure I
understand it).
Note that Windows Python must link with shell32.lib now!  That's where
ShellExecute lives.
2000-09-22 10:05:54 +00:00
Guido van Rossum 7fa7da861a More whitespace cleanup, to satisfy tabnanny.py. Don't trust -tt! 2000-09-22 09:30:29 +00:00
Guido van Rossum c77593d31a Get rid of the one tab in the file.
Closes Bug #115054.
2000-09-22 09:23:08 +00:00
Fred Drake 7422b6b6a2 White space cleanup, including one item that was an error under -tt. 2000-09-22 05:07:56 +00:00
Greg Ward ab7983939b Tweak what happens when run on non-Windows platforms: set install prefix
as well as scheme, and don't convert all installation paths (that's now
done by the "install" command for us).
2000-09-22 01:32:34 +00:00
Greg Ward 379a02ffa9 Changed all paths in the INSTALL_SCHEMES dict to Unix syntax, and added
'convert_paths()' method to convert them all to the local syntax (backslash
or colon or whatever) at the appropriate time.

Added SCHEME_KEYS to get rid of one hard-coded list of attributes (in
'select_scheme()').

Default 'install_path_file' to true, and never set it false (it's just
there in case some outsider somewhere wants to disable installation of the
.pth file for whatever reason).

Toned down the warning emitted when 'install_path_file' is false, since we
no longer know why it might be false.

Added 'warn_dir' flag to suppress warning when installing to a directory
not in sys.path (again, we never set this false -- it's there for outsiders
to use, specifically the "bdist_*" commands).

Pulled the loop of 'change_root()' calls out to new method 'change_roots()'.

Comment updates/deletions/additions.
2000-09-22 01:31:08 +00:00
Greg Ward 7ec053544c Fix 'convert_path()' so it returns immediately under Unix -- prevents blowing
up when the pathname starts with '/', which is needed when converting
installation directories in the "install" command.
2000-09-22 01:05:43 +00:00
Martin v. Löwis d7bf974af4 Indent _connection_class so that it becomes HTTPS._connection_class. 2000-09-21 22:09:47 +00:00
Fred Drake 265a804af2 Revise the test case for pyexpat to avoid using asserts. Conform better
to the Python style guide, and remove unneeded imports.
2000-09-21 20:32:13 +00:00
Guido van Rossum 9e79a25b8a The minidom.Node class has a debug attribute which, when its _debug
flag is true, is set to a StringIO object that silently collects all
debug messages.  This is triggered by the Node._debug=1 statement at
the top of test_minidom.py.  After the tests, we better delete that
StringIO object to avoid wasting memory.  We also reset the _debug
flag.  (Note that this is an undetectable memory leak, and the memory
doesn't get collected by the cycle-gc either, because it's all
reachable -- it's just useless.)
2000-09-21 20:10:39 +00:00
Fred Drake 07cbc4e5bd Paul Prescod <paul@prescod.net>:
Add support for parsing already-opened files.  Make sure the parse()
method closes exactly those files that it opens.

Modified by FLD for better conformance to the Python style guide.

This closes SourceForge patch #101512.
2000-09-21 17:43:48 +00:00
Fredrik Lundh 5644b7fad1 - fixed yet another gcc -pedantic warning
- added experimental "expand" method to match objects
- don't use the buffer interface on unicode strings
2000-09-21 17:03:25 +00:00
Fred Drake 44627016da SAXException.__getitem__(): Raise AttributeError instead of NameError. 2000-09-21 16:32:28 +00:00
Jeremy Hylton d34580cb87 fix bogus references to imp; makes test_minidom succeed 2000-09-21 14:46:56 +00:00
Lars Gustäbel b798c0109f Now uses make_parser to create its parser (patch 101573). 2000-09-21 08:38:46 +00:00
Lars Gustäbel ae43e5205d Added the make_parser function (patch 101571). 2000-09-21 08:34:04 +00:00
Lars Gustäbel c5cec51b95 Updated XMLGenerator to new DocumentHandler interface (patch 101572). 2000-09-21 08:25:28 +00:00
Lars Gustäbel b4d6bb0987 Updated to correct DocumentHandler signatures. (patch 101570) 2000-09-21 08:18:55 +00:00
Tim Peters 38fd5b6413 Derived from Martin's SF patch 110609: support unbounded ints in %d,i,u,x,X,o formats.
Note a curious extension to the std C rules:  x, X and o formatting can never produce
a sign character in C, so the '+' and ' ' flags are meaningless for them.  But
unbounded ints *can* produce a sign character under these conversions (no fixed-
width bitstring is wide enough to hold all negative values in 2's-comp form).  So
these flags become meaningful in Python when formatting a Python long which is too
big to fit in a C long.  This required shuffling around existing code, which hacked
x and X conversions to death when both the '#' and '0' flags were specified:  the
hacks weren't strong enough to deal with the simultaneous possibility of the ' ' or
'+' flags too, since signs were always meaningless before for x and X conversions.
Isomorphic shuffling was required in unicodeobject.c.
Also added dozens of non-trivial new unbounded-int test cases to test_format.py.
2000-09-21 05:43:11 +00:00
Greg Ward f5855746fe Corran Webster: fix 'change_root()' to handle Mac OS paths. 2000-09-21 01:23:35 +00:00
Jeremy Hylton 572bdce4b3 change 2-space indent to 4-space indent 2000-09-20 02:47:28 +00:00
Greg Ward 9c0ea13ece *Very* belated application of Thomas Heller's patch to handle
resource files.  The gist of the patch is to treat ".rc" and ".mc"
files as source files; ".mc" files are compiled to ".rc" and then
".res", and ".rc" files are compiled to ".res".  Wish I knew what
all these things stood for...
2000-09-19 23:56:43 +00:00
Tim Peters ceeda0e9ba Treat trailing colon in os.path.join("a:", "b") same way for DOS as in
recent changes to ntpath.py and posixmodule.c.  Thanks to Guido for
pointing out the inconsistency!
2000-09-19 23:46:56 +00:00
Marc-André Lemburg d1ba443206 This patch adds a new Python C API called PyString_AsStringAndSize()
which implements the automatic conversion from Unicode to a string
object using the default encoding.

The new API is then put to use to have eval() and exec accept
Unicode objects as code parameter. This closes bugs #110924
and #113890.

As side-effect, the traditional C APIs PyString_Size() and
PyString_AsString() will also accept Unicode objects as
parameters.
2000-09-19 21:04:18 +00:00
Tim Peters 0eeba5b24b Part of SF patch 101481: on Windows, os.path.join("a:", "b") should yield
"a:b", not "a:/b".  Similar change was made to posixmodule.c earlier.
2000-09-19 20:39:32 +00:00
Tim Peters f5fa0fc640 test_userlist.py:
Added new test for new __contains__ method.
    Extensive editing to get rid of asserts.
2000-09-19 20:31:24 +00:00
Tim Peters 7b393fc037 SF patch 101391: implemented UserList.__contains__. 2000-09-19 20:29:03 +00:00