Commit Graph

3338 Commits

Author SHA1 Message Date
Greg Ward cd1486fff1 More tweaks to 'mkpath()':
- deal with empty tail from os.path.split() (eg. from trailing slash,
    or backslash, or whatever)
  - check PATH_CREATED hash inside loop as well
1999-09-29 12:14:16 +00:00
Greg Ward 3868eb97c8 Added 'ready' flag and 'ensure_ready()' method to Command: together
they make sure that 'set_final_options()' has been called, but isn't
  called redundantly.
Changed Distribution to call 'ensure_ready()' where it used to call
  'set_final_options()', and in a few extra places as well.
Lots of comment/docstring revisions and additions in both classes.
New one-liner utility methods in Command: 'find_peer()', 'spawn()'.
1999-09-29 12:12:19 +00:00
Greg Ward da2d352bdb Added docstring and RCS id (apparently some Windows tar extractors
ignore zero-byte files: grr...).
1999-09-22 15:24:04 +00:00
Greg Ward df0d33586d Ditched the whole notion of "alias options": this meant dropping the
'alias_options' table and getting rid of some hairy code in the
  Distribution constructor.
Resurrected the distribution options that describe the modules present
  in the module distribution ('py_modules', 'ext_modules'), and added
  a bunch more: 'packages', 'package_dir', 'ext_package', 'include_dirs',
  'install_path'.
Updated some comments.
Added 'warn()' method to Command.
'Command.get_command_name()' now stores generated command name in
  self.command_name.
1999-09-21 18:41:36 +00:00
Greg Ward ac1424a9ce Added 'write_file()' function.
Added global cache PATH_CREATED used by 'mkpath()' to ensure it doesn't
  try to create the same path more than once in a session (and, more
  importantly, to ensure that it doesn't print "creating X" more than
  once for each X per session!).
1999-09-21 18:37:51 +00:00
Greg Ward b116e45a29 In 'link_shared_object()', try to be less sensitive to missing input files
in dry-run mode.
1999-09-21 18:36:15 +00:00
Greg Ward fbf8affca1 Typecheck elements of 'macros' parameter in 'gen_preprocess_options(). 1999-09-21 18:35:09 +00:00
Greg Ward d4b8429fc5 Added docstring, brought __all__ up-to-date. 1999-09-21 18:33:09 +00:00
Greg Ward 865de83668 Added 'install_path' option for giving non-packagized module
distributions their own directory (and .pth file).
Overhauled how we determine installation directories in
  'set_final_options()' to separate platform-dependence and take
  'install_path' option into account.
Added 'create_path_file()' to create path config file when 'install_path'
  given.
Only run 'install_py' and 'install_ext' when, respectively, there are
  some pure Python modules and some extension modules in the distribution.
1999-09-21 18:31:14 +00:00
Greg Ward 02e1c56212 Only run build_py if we have pure Python modules, and build_ext if we
have extension modules.
1999-09-21 18:27:55 +00:00
Greg Ward dbb96253ea Some option changes:
- rename 'dir' to 'build_dir'
  - take 'package' from distribution option 'ext_package'
  - take 'extensions' from distribution option 'ext_modules'
  - take 'include_dirs' from distribution
Name keyword args explictly when calling CCompiler methods.
Overhauled how we generate extension filenames (in 'extension_filename()
  and 'build_extension()') to take 'package' option into account.
1999-09-21 18:27:12 +00:00
Greg Ward 17dc6e7ed8 Basically a complete rewrite to support dealing with modules in whole
packages and searching for source files by 'package_dir'.
1999-09-21 18:22:34 +00:00
Guido van Rossum ea7364c7cd Peter Haight discovered that this code uses a mutable default for cnf
and then (under certain circumstances) can clobber the default!
He also submitted this patch as PR#82.
1999-09-20 00:39:47 +00:00
Guido van Rossum f3c5f5c044 After much hemming and hawing, we decided to roll back Fred's change.
It breaks Mailman, it was actually documented in the docstring, so it
was an intentional deviation from the usual del semantics.  Let's
document the original behavior in Doc/lib/librfc822.tex.
1999-09-15 22:15:23 +00:00
Guido van Rossum ba895d892d Typo: the method called is do_SPAM, not handle_SPAM. 1999-09-15 15:28:25 +00:00
Guido van Rossum 0079b288f5 Put Sam Rushing's original RCS ID string back, without dollars around it. 1999-09-14 20:17:50 +00:00
Guido van Rossum c2b6de5b91 Put Sam Rushing's original RCS ID string back, without dollars around it. 1999-09-14 20:16:00 +00:00
Greg Ward fa4eb188f4 Changed selection of installation directories (in 'set_final_options()')
so that pure Python modules are installed to the platform-specific
directory if there are any extension modules in this distribution.
1999-09-13 13:58:34 +00:00
Greg Ward c9c011cd96 Straightened up the selection of installation directories for platform-
specific files; it was somewhat broken, and the comments were dead
  wrong.
Now runs 'install_ext' command after 'install_py'.
1999-09-13 13:57:26 +00:00
Greg Ward 609a5c818d Added support for 'package' option, including where to link the
actual extension module to.
1999-09-13 13:55:34 +00:00
Greg Ward 68bdf3eeb7 Comment addition. 1999-09-13 13:54:06 +00:00
Greg Ward 36e68e21b4 Now run 'build_ext'.
Default platform-specific build directory changed to 'build/platlib'.
1999-09-13 13:52:12 +00:00
Greg Ward 8037cb11f5 Added 'output_dir' parameter to 'compile()' and 'link_shared_object().
Changed those two methods to only compile/link if necessary (according
  to simplistic timestamp checks).
Added 'output_dir' to 'object_filenames()' and 'shared_object_filename()'.
1999-09-13 03:12:53 +00:00
Greg Ward 3b120ab374 New command -- install_ext to install extension modules. 1999-09-13 03:10:25 +00:00
Greg Ward 138ce653cc Added 'newer_pairwise()' and 'newer_group()'.
Terminology change in 'newer()'.
Made 'copy_tree' respect dry_run flag a little better.
Added 'move_file()'.
1999-09-13 03:09:38 +00:00
Greg Ward 9b17cb5819 Added 'output_dir' attribute, and 'output_dir' parameter to several method
signatures, and updated some docstrings to reflect it.
Some comments added.
Added 'announce()' and 'move_file()' methods.
1999-09-13 03:07:24 +00:00
Greg Ward 1ae3246679 Fixed some goofs in 'alias_options'.
Error message tweak in Command.set_option().
Added Command.get_peer_option().
Added Command.move_file() wrapper.
1999-09-13 03:03:01 +00:00
Fred Drake 81ffe75d1c Message.__delitem__(): If the key doesn't exist in the dictionary,
raise KeyError instead of failing silently!
1999-09-10 20:54:53 +00:00
Guido van Rossum 75ae7e7dfa Fix for PR#74 -- use int() instead of eval() to extract the exponent. 1999-09-10 14:34:48 +00:00
Barry Warsaw 148ffbc886 canonic(): This used to be equivalent to str() but that caused too
much breakage (esp. in JPython which holds absolute path names in
co_filename already).  This implementation uses os.path.abspath() as a
slightly better way to canonicalize path names.  It implements a
cache.
1999-09-09 23:24:33 +00:00
Barry Warsaw 2bee8feac6 Pdb.lineinfo(): Don't use os.popen('egrep ...') to find the line in
the file that a function is defined on.  Non-portable to Windows and
JPython.  Instead, new find_function() uses re module on a similar
(simple-minded) pattern.
1999-09-09 16:32:41 +00:00
Guido van Rossum a41c691371 Make the maxsize constructor argument default to 0 (an unlimited queue size). 1999-09-09 14:54:28 +00:00
Greg Ward 71eb8644d7 Changed to reflect the new "command options" regime -- in particular,
we no longer explicitly pull distribution options out of our Distribution
object, but rather let the Distribution put them into the command object.
1999-09-08 02:42:30 +00:00
Greg Ward 42926ddc7e Careful rethink of command options, distribution options, distribution
attributes, etc.  Biggest change was to the Distribution constructor
  -- it now looks for an 'options' attribute, which contains values
  (options) that are explicitly farmed out to the commands.  Also,
  certain options supplied to Distribution (ie. in the 'setup()' call in
  setup.py) are now "command option aliases", meaning they are dropped
  right into a certain command rather than being distribution options.
  This is handled by a new Distribution class attribute,
  'alias_options'.
Various comment changes to reflect the new way-of-thinking.
Added 'get_command_name()' method to Command -- was assuming its
  existence all along as 'command_name()', so changed the code that
  needs it to call 'get_command_name()'.
1999-09-08 02:41:09 +00:00
Greg Ward 3d50b908ba Ditched redundant docstrings and comments (overlap with ccompiler.py).
Ditched redundant '_gen_preprocess_options()' and '_gen_lib_options()'
  -- now provided by ccompiler.py.
Fixed some filename extension variables -- added missing period.
Cosmetic tweaks.
1999-09-08 02:36:01 +00:00
Greg Ward c294113f18 Ditched '_gen_preprocess_options()' and '_gen_lib_options()' -- they're
now provided (minus the leading underscore) by the ccompiler module.
Fix 'compile()' to return the list of object files generated.
Cosmetic tweaks/delete cruft.
1999-09-08 02:32:19 +00:00
Greg Ward f7a39ecac1 os.name is "posix" or "nt" or we don't care.
Added big comment about the kludginess of passing 'build_options'
  to the link methods and how to fix it.
Added 'gen_preprocess_options()' and 'gen_lib_options()' convenience
  functions -- the two cases are very similar for Unix C Compilers and
  VC++, so I figured I might as well unify the implementations.
1999-09-08 02:29:08 +00:00
Greg Ward a4d132a868 [from 1999/08/28]
Apparently os.name is "nt" or "posix" or we don't care.
Cosmetic tweaks.
1999-09-08 02:23:28 +00:00
Andrew M. Kuchling 2d813e5140 Fixed 'return EOFError' that should be 'raise EOFError', caught by
Skip Montanaro's return-value patches.
1999-09-06 16:34:51 +00:00
Guido van Rossum a07934e53f Correct typo in AddressList.__getitem__. By Moshe Zadka. 1999-09-03 13:23:49 +00:00
Guido van Rossum 183fd40987 Fix indent error in __format(): del context[objid] at the end should
be executed in all cases, not just when it's not a list, tuple or
dict.  Discovered by Christian Tismer.
1999-09-02 15:09:44 +00:00
Greg Ward 65f4a3b173 Patch from Perry Stoll: caught up with changes in CCompiler necessary (?)
for MSVCCompiler.
1999-08-29 18:23:32 +00:00
Greg Ward 32162e832e Patch from Perry Stoll: tweaks to Windows support. 1999-08-29 18:22:13 +00:00
Greg Ward 69628b0ad1 Patch from Perry Stoll: support for Windows. 1999-08-29 18:20:56 +00:00
Greg Ward 1ea8af2fe0 Patch from Perry Stoll: import types module. 1999-08-29 18:20:32 +00:00
Greg Ward 440e2f51ea Patch from Perry Stoll: typo fix, make sure we only compile .py files. 1999-08-29 18:19:37 +00:00
Greg Ward 5d60fcf02a Patch from Perry Stoll: OK for list of modules to be empty. 1999-08-29 18:19:01 +00:00
Greg Ward 2f1b5bb905 Patch from Perry Stoll: pass 'build_info' to link method. 1999-08-29 18:18:26 +00:00
Greg Ward 26e48ea7df Patch from Perry Stoll:
- fix some broken abstract methods
  - kludge: add 'build_info' parameter to link methods
  - add 'object_name()' and 'shared_library_name()'
  - support for MSVCCompiler class on NT/Win95
1999-08-29 18:17:36 +00:00
Greg Ward dbd1276dcb Added msvccompiler module exactly as supplied by Perry Stoll. 1999-08-29 18:15:07 +00:00
Guido van Rossum b35d6846d9 Sjoerd Mullender writes:
"""
Added some optional arguments to the XMLParser __init__ method to
specify that selected non-standard constructs are to be accepted.
Also removed the documentation for handle_entityrefs since it isn't
used.
"""

The version is incremented to 0.3.
1999-08-26 15:52:33 +00:00
Guido van Rossum 3601e88cb3 Sjoerd Mullender writes:
"""
Extended chunk so that it can also handle formats that are almost
according to EA IFF 85.  In particular, added options to handle
little-endian and to handle formats that include the header size in
the chunk size value.

Fixed a bug where the header size was included in the chunk size, which
it isn't according to EA IFF 85.

Added a new method getsize() to get the size of the chunk (excluding
header).

Fixed chunk documentation (TIFF doesn't look like it uses chunks).
Converted wave to use chunk.  Wave uses EA IFF 85 chunks except that
it uses little-endian encoding of integer data.

Removed __del__ methods from aifc and wave since I got an
AttributeError there upon exit.
"""
1999-08-26 15:50:43 +00:00
Guido van Rossum e61e98d2ae Add calls to self.protocol("WM_DELETE_WINDOW", self.destroy) to the Tk
and Toplevel class constructors.  This means that if the window
manager closes the window, the Python-side Tkinter data structures
will be destroyed correctly.  (Most apps do this anyway, and it's
recommended practice; I see no reason why making it the default
behavior could be bad.)
1999-08-20 18:26:06 +00:00
Barry Warsaw 008edbf973 A nit to make Fred proud. 1999-08-19 21:17:08 +00:00
Greg Ward 1016af9fa6 Oops, call 'os.path.join()'! 1999-08-19 20:02:10 +00:00
Guido van Rossum f8e390b1b5 New version by Mark-Andre Lemburg (generated by a script, parseentities.py). 1999-08-19 15:59:35 +00:00
Guido van Rossum 1ebcf6aabb Patches by Michael Reilly to correctly deal with ftp URLs of the form
ftp://user@host//root/path: the double slash in the pathname means to
go to the root directory even if the initial directory isn't the root.
1999-08-18 21:51:10 +00:00
Guido van Rossum 959fa01dc3 Typo in comment (on Mac, it's the *resource* fork that's not copied,
the data fork *is* copied).
1999-08-18 20:03:17 +00:00
Guido van Rossum 5e006a3cc3 Patches by Michael Reilly to correctly deal with ftp URLs of the form
ftp://user@host//root/path: the double slash in the pathname means to
go to the root directory even if the initial directory isn't the root.
1999-08-18 17:40:33 +00:00
Guido van Rossum 6c395ba316 Add Tim Peters' shuffle() algorithm. 1999-08-18 13:53:28 +00:00
Greg Ward e393ddb2e0 Implements the 'build_ext' command for building C/C++ extension modules. 1999-08-14 23:57:49 +00:00
Greg Ward b4dbfb318c Module to spawn sub-commands in a platform-independent way.
Initial revision only includes support for POSIX-style fork-and-exec.
1999-08-14 23:57:17 +00:00
Greg Ward 5e71744000 Changed to use 'spawn()', now that it exists.
Added 'verbose' and 'dry_run' parameters to constructor.
Changed 'compile()', 'link_*()' to default lists arguments to None
  rather than empty list.
Added implementations of the filename-mangling methods mandated by
  the CCompiler interface.
1999-08-14 23:53:53 +00:00
Greg Ward e1aaaa653c Added 'verbose' and 'dry_run' flags to CCompiler constructor and
'new_compiler()' factory function.
Added 'runtime_library_dirs' list (for -R linker option) and methods
  to manipulate it.
Deleted some obsolete comments.
Added all the filename manglign methods: 'object_filenames()',
  'shared_object_filename()', 'library_filename()',
  'shared_library_filename()'.
Added 'spawn()' method (front end to the "real" spawn).
1999-08-14 23:50:50 +00:00
Greg Ward 7f65c65208 Comment tweak. 1999-08-14 23:47:21 +00:00
Greg Ward 0081cc529c Better detection of bad entries in option table.
Better error messages for bad entries in option table.
1999-08-14 23:44:37 +00:00
Greg Ward 8c66b697c1 Added DistutilsExecError, DistutilsValueError. 1999-08-14 23:43:45 +00:00
Guido van Rossum 2f7df12f33 Patch by Paul Sokolovsky to support the get() method. 1999-08-11 01:54:05 +00:00
Greg Ward abc2f960d4 Allow comment characters (#) to be escaped:
- did away with 'comment_re' option -- it's just not that simple anymore
  - heavily revised the main logic in 'readline()' to accomodate this
Beefed up 'warn()': 'line' can be list or tuple, and 'msg' is
  automatically converted to a string.
1999-08-10 20:09:38 +00:00
Andrew M. Kuchling 916fcc3b18 Added __del__ method to GzipFile class that will flush and close the
object, if required.
1999-08-10 13:19:30 +00:00
Guido van Rossum a74c55662f Mark Hammond writes:
"""
If the filename being complained about contains a space, enclose the
file-name in quotes.

The reason is simply that when I try and parse tabnanny's output, filenames
with spaces make it very difficult to determine where the filename stops
and the linenumber begins!
"""

Tim approves.

I slightly changed the patch (use 'in' instead of string.find()) and
arbitrarily bumped the __version__ variable up to 6.
1999-07-30 17:48:20 +00:00
Guido van Rossum 42b334d93d Remove some redundant code from Canvas.tag_bind(), which added all
bindings to a dictionary _tagcommands which was otherwise unused.
(This was checked in accidentally with rev. 1.125 and not deleted with
rev. 1.127 when the other half of this code was removed -- although
even as originally checked in the _tagcommands variable was never
used.)

(PR#40, reported by Peter Stoehr)
1999-07-30 12:22:12 +00:00
Guido van Rossum 2ab455a8fa Another patch from Andy Dustman:
"""
Here's a patch for the ForkingMixIn which will prevent the server from
forking itself into the ground. Note: I've tested a very similar patch
(subclassed ForkingMixIn) but not actually tested this one. As you might
surmise, this was done out of necessity...

If the maximum number of children are already running, block while waiting
for a child to exit.
"""

(I added that last sentence as a comment to the code --GvR.)
1999-07-28 21:39:28 +00:00
Fred Drake 69f87c580d getsize(), getatime(), getmtime():
Constants from stat module were imported using "import *";
	don't access them via stat.ST_*!

	Reported by that other vR.  ;-)
1999-07-23 15:04:05 +00:00
Guido van Rossum ba508a21e0 Add test case for bug just fixed by Stephen Turner. 1999-07-13 15:23:42 +00:00
Barry Warsaw 7c5b9d1fa9 added a test for "To: :" patch 1999-07-12 18:47:00 +00:00
Barry Warsaw 96e9bf45e8 AddrlistClass.getaddress(): when parsing `:'s, in the loop, watch out
for gotonext() pushing self.pos past the end of the string.  This can
happen if the message has a To field like "To: :" and you call
msg.getaddrlist('to').
1999-07-12 18:37:02 +00:00
Greg Ward 170bdc08e1 The first concrete subclass of CCompiler: defines a barebones Unix C compiler. 1999-07-10 02:04:22 +00:00
Greg Ward 3f81cf7936 The abstract base class that defines the C/C++ compiler abstraction model. 1999-07-10 02:03:53 +00:00
Greg Ward ba3f108ec0 Added a self-berating command relating to installation directories for
module distributions that contain platform-specific files.
1999-07-10 02:02:31 +00:00
Greg Ward ccbb3f0ed4 Don't pollute importer's namespace with type objects from types modules.
Added DistutilsPlatformError.
1999-07-10 02:01:44 +00:00
Guido van Rossum 6ebb387a08 Patch by Jeffrey Chang to add docstrings everywhere.
The text is condensed from the library manual.
1999-07-09 21:15:32 +00:00
Fred Drake d5f173bf1f FTP.dir(): Fix typo in docstring. 1999-07-07 13:36:59 +00:00
Guido van Rossum 3427c1f71b Sjoerd Mullender:
In splithost, accept empty host part in URLs.  This is required for
file URLs that can have an empty host part.  For such URLs, we should
not return the initial 2 slashes as part of the file name.
1999-07-01 23:20:56 +00:00
Fred Drake b5879ca2e9 Relocating file to Lib/lib-old. 1999-07-01 16:59:29 +00:00
Fred Drake b8690fbc95 Define NotANumber as a subclass of ValueError when using class-based
exceptions.

When raising NotANumber, pass the string that failed as the exception
value.
1999-06-29 15:49:35 +00:00
Fred Drake 5c4012adc0 While we're at it, convert to docstrings and set the indentation level
to 4.
1999-06-25 18:53:23 +00:00
Guido van Rossum 7ea8f8404c Break some cycles when the widget is destroyed. 1999-06-25 15:53:54 +00:00
Fred Drake 624a191512 Patch from Sjoerd Mullender:
Make argument names equal to what is used in the documentation of the
file object, since chunks are supposedly file-like.
1999-06-25 14:58:44 +00:00
Guido van Rossum 59834f11e3 Mikael Lyngvig writes:
I just noticed that the changes below also apply to cmpcache.py, which
is virtually identical to cmp.py.
1999-06-25 14:21:44 +00:00
Guido van Rossum 3aa9ca147b Patch by Mikael Lyngvig:
1. Fix incorrect file open mode on Win32 platforms (use "rb" instead
of "r").

2. Add shallow parameter to cmp.cmp().  If false, deep file
comparisons are made.

The module should be 100 percent backwards compatible.
1999-06-25 14:12:50 +00:00
Guido van Rossum 336a201d4f Sjoerd Mullender writes:
Urllib makes the URL of the opened file available through the geturl
method of the returned object.  For local files, this consists of
file: plus the name of the file.  This results in an invalid URL if
the file name was relative.  This patch fixes this so that the
returned URL is just a relative URL in that case.  When the file name
is absolute, the URL returned is of the form file:///absolute/path.

[I guess that a URL of the form "file:foo.html" is illegal...  GvR]
1999-06-24 15:27:36 +00:00
Guido van Rossum ff3a278d3b Small patch by Tim Peters - it was using self.maxlist when it should
be using self.maxdict.
1999-06-23 23:27:05 +00:00
Fred Drake 4316135a44 Make the mode parameter to open() default in the same way as for wave.open(). 1999-06-22 21:23:23 +00:00
Guido van Rossum 8746082175 Patch by Tim Peters:
Introduce a new builtin exception, UnboundLocalError, raised when ceval.c
tries to retrieve or delete a local name that isn't bound to a value.
Currently raises NameError, which makes this behavior a FAQ since the same
error is raised for "missing" global names too:  when the user has a global
of the same name as the unbound local, NameError makes no sense to them.
Even in the absence of shadowing, knowing whether a bogus name is local or
global is a real aid to quick understanding.

Example:

D:\src\PCbuild>type local.py
x = 42

def f():
    print x
    x = 13
    return x

f()

D:\src\PCbuild>python local.py
Traceback (innermost last):
  File "local.py", line 8, in ?
    f()
  File "local.py", line 4, in f
    print x
UnboundLocalError: x

D:\src\PCbuild>

Note that UnboundLocalError is a subclass of NameError, for compatibility
with existing class-exception code that may be trying to catch this as a
NameError.  Unfortunately, I see no way to make this wholly compatible
with -X (see comments in bltinmodule.c):  under -X, [UnboundLocalError
is an alias for NameError --GvR].

[The ceval.c patch differs slightly from the second version that Tim
submitted; I decided not to raise UnboundLocalError for DELETE_NAME,
only for DELETE_LOCAL.  DELETE_NAME is only generated at the module
level, and since at that level a NameError is raised for referencing
an undefined name, it should also be raised for deleting one.]
1999-06-22 14:47:32 +00:00
Guido van Rossum 1a03cf56e0 Greg McFarlane submitted two missing Text methods: mark_next() and
mark_previous().
1999-06-21 14:13:30 +00:00
Fred Drake 4f298695be Relocating file to Lib/lib-old. 1999-06-18 17:12:36 +00:00
Guido van Rossum 9e480adf9b Patch suggested (and partially provided) by Lars Damerow: instead of
always lowercasing the option name, call a method optionxform() which
can be overridden.  Also make the regexps SECTRE and OPTRE non-private
variables so they can also be overridden.
1999-06-17 18:41:42 +00:00
Guido van Rossum bfadac00ef In collect_children(), put a try-except around os.waitpid() because it
may raise an exception (when there are no children).  Reported by
Andy Dustman.
1999-06-17 15:41:33 +00:00
Fred Drake f9607821ad open(): Make the mode parameter optional; if omitted or None, use the
mode attribute of the file object (if it has one), otherwise
	 use 'rb'.

	 The documentation should still show this as required until
	 there's a new release.
1999-06-17 15:18:47 +00:00
Guido van Rossum 9f612f9c5a Suppress warning print statements about modules not found, they are
confusing to end users of IDEs.
1999-06-16 12:28:12 +00:00
Guido van Rossum 7bb11d68bf Sjoerd Mullender:
Added support for unseekable files.

(I use unqualified excepts since we don't know why the seek/tell might
fail.  In my case it was because of an AttributeError.)
1999-06-16 12:25:34 +00:00
Guido van Rossum f2f0594587 Laurence Tratt notes that the accept() call in get_request() can fail,
and suggests putting a try/except around the get_request() call in
handle_request().  (All in class TCPServer.)
1999-06-15 22:25:32 +00:00
Guido van Rossum 47ac4e6b41 Add the test case provided by Barry Scott for his patch. 1999-06-15 18:56:46 +00:00
Guido van Rossum b184487055 Barry Scott writes:
Problem: rfc822.py in 1.5.2 final loses the quotes around
quoted local-part names.

The fix is to preserve the quotes around a local-part
name in an address.

Test:

	import rfc822
	a = rfc822.AddrlistClass('(Comment stuff) "Quoted
name"@somewhere.com')
	a.getaddrlist()

The correct result is:

	[('Comment stuff', '"Quoted name"@somewhere.com')]
1999-06-15 18:06:20 +00:00
Barry Warsaw 6e1d78a181 Added a couple of endswith test cases for bugs reported by Timbot.
Also added a short circuit for the regression test suite since CVS
insisted on putting this file in the main branch. :(
1999-06-15 16:49:11 +00:00
Barry Warsaw d5258681e7 Added more tests of join 1999-06-14 18:38:42 +00:00
Fred Drake cbfa5cbcc8 Message.getheaders(): If there are no matching headers, return an
empty list instead of None.  (Guido's request.)
1999-06-14 15:40:23 +00:00
Guido van Rossum 60a3bd8130 After more discussion with Jim, change the behavior so that only a
*missing* content-type at the outer level of a POST defaults to
urlencoded.  In all other circumstances, the default is read_singe().
1999-06-11 18:26:09 +00:00
Barry Warsaw 122473fc70 Two extra startswith tests 1999-06-11 17:51:13 +00:00
Barry Warsaw 8a9514a660 Harness can now test object methods directly, if they aren't available
in the string module.

Add a bunch of new tests for extended startswith/endswith arguments.
1999-06-11 17:48:07 +00:00
Guido van Rossum 18df5d479c Mark Hammond: patch for Windows/CE. 1999-06-11 01:37:27 +00:00
Barry Warsaw 4afdb0a89a Output for the regression test of the new string methods. 1999-06-10 22:53:23 +00:00
Barry Warsaw 50f0e16d1b Regression test for the new string methods. 1999-06-10 22:53:10 +00:00
Fred Drake 2b755b88c0 Relocating file to Lib/lib-old. 1999-06-10 21:18:02 +00:00
Guido van Rossum b269302695 Added a few more bugs to the doc string; reformatted existing bugs. 1999-06-10 19:05:54 +00:00
Guido van Rossum a3b4a33f3b Co-production with Tim Peters, implementing a suggestion by Mark
Hammond: record top-level functions (as Function instances, a simple
subclass of Class).  You must use the new interface readmodule_ex() to
get these, though.
1999-06-10 14:39:39 +00:00
Guido van Rossum 3d548717f5 Fix by Sjoerd for a package related bug: If you have a non-empy
__init__.py it isn't read.  (Sjoerd just came up with this, so it's
not heavily tested.)

Other (yet unsolved) package problems noted by Sjoerd:

- If you have a package and a module inside that or another package
  with the same name, module caching doesn't work properly since the
  key is the base name of the module/package.
- The only entry that is returned when you readmodule a package is a
  __path__ whose value is a list which confuses certain class browsers
  that I wrote.  (Hm, this could be construed as a feature.)
1999-06-09 15:49:09 +00:00
Guido van Rossum 0dee4ee0f8 Updated lagging version#. Also added some comments about how quote()
and quote_plus() can be optimized tenfold.
1999-06-09 15:14:50 +00:00
Guido van Rossum db23d3dbf7 Patch by Per Cederqvist:
I've found two places where smtplib.py sends an extra trailing space
on command lines to the SMTP server.  I don't know if this ever causes
any problems, but I'd prefer to be on the safe side.  The enclosed
patch removes the extra space.
1999-06-09 15:13:10 +00:00
Guido van Rossum b39aff87f7 Add unrelated but handy function: timegm(), to calculate Unix
timestamp from GMT tuple.
1999-06-09 15:07:38 +00:00
Guido van Rossum 145a5f73f0 Don't just die if gethostbyaddr() fails -- as it can when DNS is
unreachable -- but fall back to using whatever hostname we have.
1999-06-09 15:05:47 +00:00
Guido van Rossum 56b20595e6 Oops, Sjoerd was in a hurry. This patch from him fixes some length
math in the Chunk class.
1999-06-09 13:41:18 +00:00
Guido van Rossum 8ea7bb8e78 Patch/new code by Sjoerd Mullender:
Separate the Chunk class out of the aifc module into a new "chunk" module.
1999-06-09 13:32:28 +00:00
Guido van Rossum 1f2e09bc45 Fix (sanctioned by Sjoerd) for a problem reported by Andreas Faerber:
all processing instruction target names containing 'xml' were
rejected, instead (as the standard rejects) only the name 'xml' itself
(or case variants thereof).
1999-06-08 21:23:26 +00:00
Greg Ward 5116f90ece On David Ascher's recommendation: reversed order of 'utime()' and
'chmod()' in 'copy_file()'.
1999-06-08 17:05:21 +00:00
Guido van Rossum a8d0f4fd2d Sam's latest versions 1999-06-08 13:20:05 +00:00
Guido van Rossum cf09a3924f Skip Montanaro:
I guess in 1.5.2 a new module, whichdb, was added that attempts to
divine the nature of a database file.  This module doesn't know anything
about Berkeley DB v2 files.  In v2, Sleepycat added a 12-byte null pad
in front of the old magic numbers (at least for hash and btree files).
I've been using v2 for awhile and upgrading to 1.5.2 broke all my
anydbm.open calls. I believe the following patch corrects the problem.
1999-06-08 13:13:16 +00:00
Guido van Rossum df9f7a3e52 Tim Peters: Taught it more "real Python" rules without slowing it
appreciably.  Triple-quoted strings no longer confuse it, nor nested
classes or defs, nor comments starting in column 1.  Chews thru
Tkinter.py in < 3 seconds for me; doctest.py no longer confuses it; no
longer missing methods in PyShell.py; etc.  Also captures defs
starting in column 1 now, but ignores them; an interface should be
added so that IDLE's class browser can show the top-level functions
too.
1999-06-08 12:53:21 +00:00
Greg Ward 9a33707be7 Hacked 'set_final_options()' to set (hopefully) appropriate values for
'install_site_lib' and install_site_platlib' on non-POSIX platforms.
Should at least work for NT, as this is adopted from Amos Latteier's NT
patches.  Also added extensive comments bitching about the inadequacy of
the current model, both under POSIX and NT (and probably other) systems.
1999-06-08 02:04:36 +00:00
Greg Ward c997334977 Added the 'have_run' dictionary to Distribution, and changed
'run_command()' to refer to it before attempting to run a command --
  that way, command classes can freely invoke other commands without fear
  of duplicate execution.
Beefed up some comments and docstrings.
1999-06-08 02:02:00 +00:00
Greg Ward 4d74d73b07 Now handles NT, through '_init_nt()' function (courtesy of
Amos Latteier <amos@aracnet.com>).
1999-06-08 01:58:36 +00:00
Guido van Rossum ad380551f6 Experimental speedup patch by Tim Peters (please test!):
It wasn't hard to speed pyclbr by a factor of 3, and I'll attach an
experimental patch for that (experimental because barely tested).  Uncomment
the new "String" stuff and it will deal with strings correctly (pyclbr
currently ignores the possibility), but that slows it down a lot.  Still
faster in the end than current pyclbr, but-- frankly --I'd rather have the
dramatic speedup!
1999-06-07 15:25:18 +00:00
Guido van Rossum 1946f0d6f2 Patch by Jim Fulton: new function parse_qsl(), which is like
parse_qs() but returns a list of (name, value) pairs -- which is
actually more correct.  Use this where it makes sense.
1999-06-04 17:54:39 +00:00
Guido van Rossum ce900defc5 At Jim Fulton's request (actually, as a compromise :-), default the
content-type to application/x-www-form-urlencoded only when the method
is POST.  Ditto for when the content-type is unrecognized -- only
fall back to urlencoded with POST.
1999-06-02 18:44:22 +00:00
Guido van Rossum 198e7cac5a Andy Dustman notes that I patched the close() call in the wrong place.
Here's the correct patch!
1999-06-01 18:58:34 +00:00
Guido van Rossum 6b708d569c In class TemporaryFileWrapper, don't cache attributes of tpye int --
these happen to be 'closed' and 'softspace', which may change!

Noted by Dave Ascher (with slightly different solution).
1999-06-01 18:55:36 +00:00
Guido van Rossum 116b31bed7 Jack Jansen's patch to support file:///path/file/name URL syntax. 1999-06-01 14:36:56 +00:00
Guido van Rossum fa8c3eab79 Greg McFarlane writes: Tkinter.Text.tag_add should take multiple
arguments.  [Slightly changed from submitted patch.]
1999-06-01 13:57:15 +00:00
Guido van Rossum 18659608dc Andy Dustman writes:
I noticed while watching (with lsof) my forking SocketServer app running
that I would get multiple processes listening to the socket. For the most
part, this doesn't hurt things, but if you terminate the server, this can
prevent it from restarting because it cannot bind to the port due to any
running children which also have the socket open. The following one-liner
fixes this.
1999-05-21 16:12:30 +00:00
Fred Drake c40c54782c Map .js to application/x-javascript. 1999-05-20 12:52:04 +00:00
Fred Drake 361c048b8f POP3.uidl(): Update docstring based on comments from Piers Lauder
<piers@cs.su.oz.au>.
1999-05-13 18:47:25 +00:00
Guido van Rossum 8e40759d5a Nathan Paul Simons noticed that the grid_remove() method was missing.
(The difference between grid_remove() and grid_forget() is that the
former remembers the options for the slave.)
1999-05-05 23:03:48 +00:00
Guido van Rossum 3ed1be9fbd Regression test for date format code, by Mike Meyer.
(I tweaked it slightly so examples are allowed to have no date too.)
1999-05-03 19:57:01 +00:00
Guido van Rossum 4f13669cf0 No need to import find(). (Andrew Dalke & kjpylint) 1999-05-03 18:16:23 +00:00
Guido van Rossum 73898c7b15 No need to import os or string. (Andrew Dalke & kjpylint) 1999-05-03 18:14:16 +00:00
Guido van Rossum 96d80f984a No need to import sys. (Andrew Dalke & kjpylint) 1999-05-03 18:13:51 +00:00
Guido van Rossum 138bdafa8d Typo. (Andrew Dalke, without kjpylint) 1999-05-03 18:13:29 +00:00
Guido van Rossum 6952f17f31 No need to import string. (Andrew Dalke & kjpylint) 1999-05-03 18:13:00 +00:00
Guido van Rossum ff3932abcd No need to import os in test(). (Andrew Dalke & kjpylint) 1999-05-03 18:12:36 +00:00
Guido van Rossum 699f3bbba3 Get rid of confusing 'global' statement in global code.
(Andrew Dalke & kjpylint)
1999-05-03 18:12:08 +00:00
Guido van Rossum 1e1cfa3a1c No need to import sys or string. (Andrew Dalke & kjpylint) 1999-05-03 18:10:37 +00:00
Guido van Rossum 1cc2b9de35 Clarify why we define disco. Suggested by Andrew Dalke. 1999-05-03 18:09:53 +00:00
Guido van Rossum 287b3996d5 Clarify why we define error. Suggested by Andrew Dalke. 1999-05-03 18:09:26 +00:00
Guido van Rossum db6d12c498 No need to import sys or linecache. (Andrew Dalke & kjpylint) 1999-05-03 18:08:16 +00:00
Guido van Rossum 00245cfbaa No need to import gmtime, ctime, asctime.
Make error an alias for ValueError.
(Andrew Dalke & kjpylint)
1999-05-03 18:07:40 +00:00
Guido van Rossum 92b44517cb Clarify why there are dynamic imports in AudioDev().
This will enlighten Andrew Dalke; I don't know about kjpylint. :-)
1999-05-03 18:04:07 +00:00
Guido van Rossum 5c071fab8f The _comp_data() function never worked, it contained a reference to
undefined 'nframes'.  Should be self._nframes.  (Andrew Dalke & kjpylint)
1999-05-03 18:02:44 +00:00
Guido van Rossum f8fd11d039 No need to import sys, time, socket or SocketServer. (Andrew Dalke & kjpylint) 1999-05-03 18:01:31 +00:00
Guido van Rossum 3a64e058eb No need to import sys, time, or socket. (Andrew Dalke & kjpylint) 1999-05-03 18:00:48 +00:00
Guido van Rossum e6e8818c03 No need to import rfc822. (Andrew Dalke & kjpylint) 1999-05-03 18:00:20 +00:00
Guido van Rossum b46413f274 The case-insensitive _Environ class was lacking a case-insensitive has_key(). 1999-05-03 15:23:24 +00:00
Greg Ward 884df454b2 The 'copy_file()' and 'copy_tree()' functions in util.py now have
meaningful return values: respectively, whether the copy was done, and
the list of files that were copied.  This meant some trivial changes in
core.py as well: the Command methods that mirror 'copy_file()' and
'copy_tree()' have to pass on their return values.
1999-05-02 21:42:05 +00:00
Greg Ward 0f72695da3 Rearranged things so that compilation of .py files is the responsibility
of the 'install_py' command rather than 'build_py'.  Obviously, this
meant that the 'build_py' and 'install_py' modules had to change; less
obviously, so did 'install' and 'build', since these higher-level
commands must make options available to control the lower-level
commands, and some compilation-related options had to migrate with the
code.
1999-05-02 21:39:13 +00:00
Guido van Rossum b08f51b93a Mike Meyer reports a bug in his patch (several months ago) that
accepts long month names.  One essential line was missing.  Fixed now.
1999-04-29 12:50:36 +00:00
Fred Drake ddf22c4243 Message.getheader(): Fixed grammatical error in docstring.
Message.getheaders():  Method to get list of all values for each
		       instance of a named header.  See docstring for more.
1999-04-28 21:17:38 +00:00
Fred Drake 5712fa9250 Added test case that includes a comma in the full name. This tests
for an old bug that's been gone a while, but was still documented
until a few minutes from now.
1999-04-28 17:38:31 +00:00
Guido van Rossum 630b811676 Two changes suggested by Jan Pieter Riegel:
(1) Fix reference to pwd.error to be KeyError -- there is no pwd.error
and pwd.getpwnam() raises KeyError on failure.

(2) Add cookie support, by placing the 'Cookie:' header, if present,
in the HTTP_COOKIE environment variable.
1999-04-28 12:21:47 +00:00
Guido van Rossum 3f36a085fe Cast f.tell() result to int() in _addval(), so it works even on
platforms where tell() returns a long.  (Perhaps tell() should be
fixed too?)  Reported by Greg Humphreys.
1999-04-27 12:21:17 +00:00
Guido van Rossum 20c92283ab Patch by Per Cederqvist, seemingly approved by The Dragon:
Two problems: The SMTPRecipientsRefused class should not inherit
SMTPResponseException, since it doesn't provide the smtp_code and
smtp_error attributes.  My patch for not adding an extra CRLF was
apparently forgotten.  The enclosed patch fixes these two problems.
1999-04-21 16:52:20 +00:00
Guido van Rossum 068d5724d8 Calling _cleanup() does not guarantee that all processes have
terminated; this makes the final assert in the self-test code fail if
the parent runs faster than the children.  Fix this by calling wait()
on the remaining children instead.
1999-04-20 12:27:31 +00:00
Guido van Rossum 247a78a10d Utility function that yields a properly formatted time string.
(Idea by Jeff Bauer, code by Jeremy, renamed and "Date:" constant
stripped from return value by GvR.)
1999-04-19 18:04:38 +00:00
Fred Drake f340114d72 Relocating file to Lib/lib-tk. 1999-04-19 18:03:57 +00:00
Guido van Rossum 0cf46bc0f4 Daniel Neri: OpenBSD is just as BSD'ish as the other BSD's ;-) 1999-04-19 17:22:12 +00:00
Greg Ward 4e5a7c7056 'warn()' method now takes an optional line number. 1999-04-15 17:50:19 +00:00
Guido van Rossum dabcd0040c Fix mysterious references to jprofile that were in the source since
its creation.  I'm assuming these were once valid references to "Jim
Roskind's profile"...
1999-04-13 04:24:22 +00:00
Guido van Rossum ba3ed56a22 Removed; since long subsumed in Doc/lib/libthreading.tex 1999-04-13 04:20:48 +00:00
Guido van Rossum 0fe110548d Forgot to add this file. CDROM device parameters. 1999-04-12 14:35:08 +00:00
Guido van Rossum 95bdd0b604 Two different changes.
1. Jack Jansen reports that on the Mac, the time may be negative, and
solves this by adding a write32u() function that writes an unsigned
long.

2. On 64-bit platforms the CRC comparison fails; I've fixed this by
casting both values to be compared to "unsigned long" i.e. modulo
0x100000000L.
1999-04-12 14:34:16 +00:00
Guido van Rossum 6a86f66ad7 Get rid of #! line 1999-04-09 14:49:04 +00:00
Guido van Rossum 9a744a9dd7 The usual 1999-04-08 20:27:54 +00:00
Guido van Rossum 0b7dd08d50 # Bah. The same problem occurred a second time. 1999-04-08 20:22:46 +00:00
Guido van Rossum 9b112799bc On Windows, we suddenly find, strftime() may return "" for an
unsupported format string.  (I guess this is because the logic for
deciding whether to reallocate the buffer or not has been improved.)
This caused the test code to crash on result[0].  Fix this by assuming
an empty result also means the format is not supported.
1999-04-08 17:23:11 +00:00
Guido van Rossum 6e9dadc1da Delete an accidentally checked-in feature that actually broke more
than was worth it: when deleting a canvas item, it would try to
automatically delete the bindings for that item.  Since there's
nothing that says you can't reuse the tag and still have the bindings,
this is not correct.  Also, it broke at least one demo
(Demo/tkinter/matt/rubber-band-box-demo-1.py).
1999-04-08 14:46:06 +00:00
Guido van Rossum 052364b20b Use binary mode for all gzip files we open. 1999-04-07 19:00:58 +00:00
Guido van Rossum 0d8d3dd5b0 lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
so the preferred name for them is tag_lower, tag_raise
(similar to tag_bind, and similar to the Text widget);
unfortunately can't delete the old ones yet (maybe in 1.6)
1999-04-07 16:25:54 +00:00
Guido van Rossum 296e14301a Changes by Per Cederquist and The Dragon.
Per writes:

"""
The application where Signum Support uses smtplib needs to be able to
report good error messages to the user when sending email fails.  To
help in diagnosing problems it is useful to be able to report the
entire message sent by the server, not only the SMTP error code of the
offending command.

A lot of the functions in sendmail.py unfortunately discards the
message, leaving only the code.  The enclosed patch fixes that
problem.

The enclosed patch also introduces a base class for exceptions that
include an SMTP error code and error message, and make the code and
message available on separate attributes, so that surrounding code can
deal with them in whatever way it sees fit.  I've also added some
documentation to the exception classes.

The constructor will now raise an exception if it cannot connect to
the SMTP server.

The data() method will raise an SMTPDataError if it doesn't receive
the expected 354 code in the middle of the exchange.

According to section 5.2.10 of RFC 1123 a smtp client must accept "any
text, including no text at all" after the error code.  If the response
of a HELO command contains no text self.helo_resp will be set to the
empty string ("").  The patch fixes the test in the sendmail() method
so that helo_resp is tested against None; if it has the empty string
as value the sendmail() method would invoke the helo() method again.

The code no longer accepts a -1 reply from the ehlo() method in
sendmail().

[Text about removing SMTPRecipientsRefused deleted --GvR]
"""

and also:

"""
smtplib.py appends an extra blank line to the outgoing mail if the
`msg' argument to the sendmail method already contains a trailing
newline.  This patch should fix the problem.
"""

The Dragon writes:

"""
	Mostly I just re-added the SMTPRecipientsRefused exception
(the exeption object now has the appropriate info in it ) [Per had
removed this in his patch --GvR] and tweaked the behavior of the
sendmail method whence it throws the newly added SMTPHeloException (it
was closing the connection, which it shouldn't.  whatever catches the
exception should do that. )

	I pondered the change of the return values to tuples all around,
and after some thinking I decided that regularizing the return values was
too much of the Right Thing (tm) to not do.

	My one concern is that code expecting an integer & getting a tuple
may fail silently.

(i.e. if it's doing :

      x.somemethod() >= 400:
expecting an integer, the expression will always be true if it gets a
tuple instead. )

	However, most smtplib code I've seen only really uses the
sendmail() method, so this wouldn't bother it.  Usually code I've seen
that calls the other methods usually only calls helo() and ehlo() for
doing ESMTP, a feature which was not in the smtplib included with 1.5.1,
and thus I would think not much code uses it yet.
"""
1999-04-07 15:03:39 +00:00
Guido van Rossum 630a9a6894 Fix the tests now that splitdrive() no longer treats UNC paths special.
(Some tests converted to splitunc() tests.)
1999-04-06 19:38:18 +00:00
Guido van Rossum f3c695c467 Withdraw the UNC support from splitdrive(). Instead, a new function
splitunc() parses UNC paths.  The contributor of the UNC parsing in
splitdrive() doesn't like it, but I haven't heard a good reason to
keep it, and it causes some problems.  (I think there's a
philosophical problem -- to me, the split*() functions are purely
syntactical, and the fact that \\foo is not a valid path doesn't mean
that it shouldn't be considered an absolute path.)

Also (quite separately, but strangely related to the philosophical
issue above) fix abspath() so that if win32api exists, it doesn't fail
when the path doesn't actually exist -- if GetFullPathName() fails,
fall back on the old strategy (join with getcwd() if neccessary, and
then use normpath()).
1999-04-06 19:32:19 +00:00
Fred Drake fa1591c129 Oops, missed mode parameter to open(). 1999-04-05 18:37:59 +00:00
Fred Drake 9bb76d1b73 Made the default mode 'rb' instead of 'r', for better cross-platform
support.  (Based on comment on the documentation by Bernhard Reiter
<bernhard@csd.uwm.edu>).
1999-04-05 18:33:40 +00:00
Greg Ward 06ca948029 Added all the "external action" methods (to make handling the verbose
and dry-run flags consistently painless): 'execute()', 'mkpath()',
'copy_file()', 'copy_tree()', 'make_file()', and stub for 'make_files()'
(not sure yet if it's useful).
1999-04-04 02:58:07 +00:00
Greg Ward e765a3bb61 Added 'dry_run' flag to most functions (to support the "shadow methods"
that wrap them in the Command class).
Fixed 'copy_file()' to use '_copy_file_contents()', not 'copyfile()'
  from shutil module -- no reference to shutil anymore.
Added "not copying" announcement in 'copy_file()'.
Wee comment fix.
1999-04-04 02:54:20 +00:00
Greg Ward 4070f50537 Changed to use the method versions of 'copy_file()', 'copy_tree()',
and 'make_file()'-- that way, the verbose and dry-run flags are
handled for free.
1999-04-04 02:46:29 +00:00
Guido van Rossum 8ff764f113 Jonathan Giddy write:
In test_cpickle.py, the module os got imported, but the line to remove
the temp file has gone missing.
1999-04-01 15:32:30 +00:00
Guido van Rossum 60e7330fee Per Cederqvist writes:
If you send something like "PUT / HTTP/1.0" to something derived from
BaseHTTPServer that doesn't define do_PUT, you will get a response
that begins like this:

	HTTP/1.0 501 Unsupported method ('do_PUT')
	Server: SimpleHTTP/0.3 Python/1.5
	Date: Tue, 30 Mar 1999 18:53:53 GMT

The server should complain about 'PUT' instead of 'do_PUT'.  This
patch should fix the problem.
1999-03-30 20:17:31 +00:00
Guido van Rossum f123f84f66 Patch by Per Cederqvist, who writes:
"""
 - It needlessly used the makefile() method for each response that is
   read from the SMTP server.

 - If the remote SMTP server closes the connection unexpectedly the
   code raised an IndexError.  It now raises an SMTPServerDisconnected
   exception instead.

 - The code now checks that all lines in a multiline response actually
   contains an error code.
"""

The Dragon approves.
1999-03-29 20:33:21 +00:00
Fred Drake 9065ea36de When run as a script, report failures in the exit code as well.
Patch largely based on changes by Andrew Dalke, as discussed in the
distutils-sig.
1999-03-29 20:25:40 +00:00
Guido van Rossum 3527f59457 Hack so that if a 302 or 301 redirect contains a relative URL, the
right thing "just happens" (basejoin() with old URL).
1999-03-29 20:23:41 +00:00
Guido van Rossum 89ae2b9f07 Test protection against picling to/from closed (real) file. 1999-03-29 19:59:32 +00:00
Greg Ward 91c488c1fc Replaced the last attempt at an "unreadline" with one that actually
works on non-seekable file-like objects, such as URLs.  (Oops.)
1999-03-29 18:01:49 +00:00
Guido van Rossum 8e702d4e8e Jonathan Giddy discovered this file was missing. 1999-03-29 15:28:54 +00:00
Greg Ward 787451b65f Added 'linestart' array and 'unreadline()' method (makes parsing a lot easier). 1999-03-26 21:48:59 +00:00
Guido van Rossum 447b4a0652 Test suite for UserList. 1999-03-26 16:20:45 +00:00
Guido van Rossum 2a340b3889 Use isinstance() where appropriate.
Reformatted with 4-space indent.
1999-03-26 16:20:18 +00:00
Guido van Rossum 3eccc48b5b Test suite for UserDict 1999-03-26 15:32:05 +00:00
Guido van Rossum 1697b9cdf6 Improved a bunch of things.
The constructor now takes an optional dictionary.
Use isinstance() where appropriate.
1999-03-26 15:31:12 +00:00
Guido van Rossum aa3828aa35 Basic regr tests for pickle/cPickle 1999-03-25 22:38:49 +00:00
Guido van Rossum 397032aa46 Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK
points out) it doesn't work in JPython Applets.
1999-03-25 21:58:59 +00:00
Andrew M. Kuchling 605ebddbea Added a simple test suite for gzip. It simply opens a temp file,
writes a chunk of compressed data, closes it, writes another chunk, and
reads the contents back to verify that they are the same.
1999-03-25 21:50:27 +00:00
Andrew M. Kuchling f4f119c055 Based on a suggestion from bruce@hams.com, make a trivial change to
allow using the 'a' flag as a mode for opening a GzipFile.  gzip
files, surprisingly enough, can be concatenated and then decompressed;
the effect is to concatenate the two chunks of data.

If we support it on writing, it should also be supported on reading.
This *wasn't* trivial, and required rearranging the code in the
reading path, particularly the _read() method.

Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
and 'Unknown compression method'
1999-03-25 21:49:14 +00:00
Guido van Rossum 52a0d7d802 Add tests for float() and complex() with string args (Nick/Stephanie
Lockwood).
1999-03-25 21:25:01 +00:00
Guido van Rossum a6386ce1eb Added Jeremy's test code for the sha module. 1999-03-24 19:04:32 +00:00
Guido van Rossum 4ec2698725 Remove the temp file when we're done. 1999-03-24 19:03:01 +00:00
Guido van Rossum e256a0feed Add readlines() to _Subfile class. Not clear who would need it, but
Chris Lawrence sent me a broken version; this one is a tad simpler and
more conforming to the standard.
1999-03-24 16:20:45 +00:00
Jeremy Hylton c19f9972a1 use struct instead of bit-manipulate in Python 1999-03-23 23:05:34 +00:00
Greg Ward 782cdfe9f3 Changes to allow passing an open file to the constructor (to support
ProcessHierarchy's changes to support reading from a remote URL in
ProcessDatabase).
1999-03-23 14:00:06 +00:00
Andrew M. Kuchling dca7e00fd5 Added simple test for the flush() method of compression objects, trying the
different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
1999-03-22 19:23:17 +00:00
Guido van Rossum f247d75507 Bug reported by Tobias Thelen: missing "self." in assignment target. 1999-03-22 15:28:08 +00:00
Greg Ward 13ae1c8ff8 First checkin of real Distutils command modules. 1999-03-22 14:55:25 +00:00
Greg Ward 03f8c3cdd0 Obsolete source file -- command options are actually implemented in
a much less formalistic way.  Just keeping this around for possible
future reference.
1999-03-22 14:54:09 +00:00
Greg Ward 2689e3ddce First checkin of real Distutils code. 1999-03-22 14:52:19 +00:00
Guido van Rossum 8f0fa9e47f New code for split() by Tim Peters, behaves more like posixpath.split(). 1999-03-19 21:05:12 +00:00
Guido van Rossum 36561c5de4 Added BufferType, the type returned by the new builtin buffer(). Greg Stein. 1999-03-19 19:08:03 +00:00
Guido van Rossum f3963b1269 Sjoerd Mullender writes:
If a filename on Windows starts with \\, it is converted to a URL
which starts with ////.  If this URL is passed to urlparse.urlparse
you get a path that starts with // (and an empty netloc).  If you pass
the result back to urlparse.urlunparse, you get a URL that starts with
//, which is parsed differently by urlparse.urlparse.  The fix is to
add the (empty) netloc with accompanying slashes if the path in
urlunparse starts with //.  Do this for all schemes that use a netloc.
1999-03-18 15:10:44 +00:00
Guido van Rossum a0fec1637b Sjoerd Mullender writes:
Pathnames of files on other hosts in the same domain
(\\host\path\to\file) are not translated correctly to URLs and back.
The URL should be something like file:////host/path/to/file.
Note that a combination of drive letter and remote host is not
possible.
1999-03-18 14:21:41 +00:00
Guido van Rossum a2e18051b7 Delete non-standard-conforming code in urljoin() that would use the
netloc from the base url as the default netloc for the resulting url
even if the schemes differ.

Once upon a time, when the web was wild, this was a valuable hack
because some people had a URL referencing an ftp server colocated with
an http server without having the host in the ftp URL (so they could
replicate it or change the hostname easily).

More recently, after the file: scheme got added back to the list of
schemes that accept a netloc, it turns out that this caused weirdness
when joining an http: URL with a file: URL -- the resulting file: URL
would always inherit the host from the http: URL because the file:
scheme supports a netloc but in practice never has one.

There are two reasons to get rid of the old, once-valuable hack,
instead of removing the file: scheme from the uses_netloc list.  One,
the RFC says that file: uses the netloc syntax, and does not endorse
the old hack.  Two, neither netscape 4.5 nor IE 4.0 support the old
hack.
1999-03-17 22:30:10 +00:00
Guido van Rossum eb354b31e5 Bug reported by Jim Robinson:
An attempt to execute grid_slaves with arguments (0,0) results in
*all* of the slaves being returned, not just the slave associated with
row 0, column 0.  This is because the test for arguments in the method
does not test to see if row (and column) does not equal None, but
rather just whether is evaluates to non-false.  A value of 0 fails
this test.
1999-03-16 21:54:50 +00:00
Guido van Rossum 3764595c98 Yet another patch by Sjoerd Mullender:
Don't convert URLs to URLs using pathname2url.
1999-03-15 16:16:29 +00:00
Guido van Rossum d5138caba5 Patch by Michael Scharf. He writes:
The module cmd requires for each do_xxx command a help_xxx
    function. I think this is a little old fashioned.

    Here is a patch: use the docstring as help if no help_xxx
    function can be found.

[I'm tempted to rip out all the help_* functions from pdb, but I'll
resist it.  Any takers?  --Guido]
1999-03-12 22:15:43 +00:00
Guido van Rossum 4edf656402 Remove stuff with unsure copyright status 1999-03-12 19:31:51 +00:00
Guido van Rossum 367ac80d3b From: Sjoerd Mullender
The filename to URL conversion didn't properly quote special
characters.
The URL to filename didn't properly unquote special chatacters.
1999-03-12 14:31:10 +00:00
Fred Drake cbd987040e Added .rdf and .xsl as application/xml types. (.rdf is for the
Resource Description Framework, a metadata encoding, and .xsl is for
the Extensible Stylesheet Language.)
1999-03-11 16:04:04 +00:00
Guido van Rossum 59e4f37d76 Test for popen2 module, by Chris Tismer. 1999-03-11 13:26:23 +00:00
Guido van Rossum 29aab7582f open_http also had the 'data is None' test backwards. don't call with the
extra argument if data is None.
1999-03-09 19:31:21 +00:00
Greg Ward db75afe6e5 Added collapse_ws option. 1999-03-08 21:46:11 +00:00
Jeremy Hylton b30f52a471 http_error had the 'data is None' test backwards. don't call with the
extra argument if data is None.
1999-02-25 16:14:58 +00:00
Jeremy Hylton f90b002e31 change indentation from 8 spaces to 4 spaces 1999-02-25 16:12:12 +00:00
Jeremy Hylton 547c3f1c13 pleasing the tabnanny 1999-02-25 15:59:54 +00:00
Fred Drake bff3ae1f75 Oops, one more "x, y, z" to convert... 1999-02-25 14:26:02 +00:00
Fred Drake 87209172f0 Adjusted comment at the top to be less confusing, following Fredrik
Lundh's example.

Converted comment to docstring.
1999-02-25 14:24:22 +00:00
Fred Drake e1c717bd9b Moved whatsound to lib-old/, since it was declared obsolete and is documented
as such.
1999-02-24 18:59:24 +00:00
Fred Drake 0652a4e7d5 Use sndhdr instead of the obsolete whatsound module. 1999-02-24 18:49:15 +00:00
Jeremy Hylton dbc8364e1f When performing a POST request, i.e. when the second argument to
urlopen is used to specify form data, make sure the second argument is
threaded through all of the http_error_NNN calls.  This allows error
handlers like the redirect and authorization handlers to properly
re-start the connection.
1999-02-24 18:42:38 +00:00
Guido van Rossum 4fe6caaaf0 Patch by Lars Wirzenius:
o the initial comment is wrong: creating messages is already
	  implemented

	o Message.getbodytext: if the mail or it's part contains an
	  empty content-transfer-encoding header, the code used to
	  break; the change below treats an empty encoding value the same
	  as the other types that do not need decoding

	o SubMessage.getbodytext was missing the decode argument; the
	  change below adds it; I also made it unconditionally return
	  the raw text if decoding was not desired, because my own
	  routines needed that (and it was easier than rewriting my
	  own routines ;-)
1999-02-24 16:25:17 +00:00
Barry Warsaw 40db48c5ec Document the correct class hierarchy for SystemExit. It is not an
error and so it derives from Exception and not SystemError.  The
docstring was incorrect but the implementation was fine.
1999-02-24 00:27:39 +00:00
Guido van Rossum 83c03e2d94 Add import sys, needed by reference to sys.exc_info() in rmtree().
Discovered by Mitch Chapman.
1999-02-23 23:07:51 +00:00
Guido van Rossum 74ee886409 1. Print the error message (carefully) when a dl.open() fails in verbose mode.
2. When no test case worked, raise ImportError instead of failing.
1999-02-23 17:58:48 +00:00
Guido van Rossum 027188a382 According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
list (of bsd variants that have a different lock structure).
1999-02-23 04:14:32 +00:00
Guido van Rossum 5ef8f0c3c7 According to Jeffrey Honig, bsd/os 4.0 should be added to the list. 1999-02-23 04:13:37 +00:00
Guido van Rossum 4505895e68 As Des Barry points out, we need to call pathname2url(file) in two
calls to addinfourl() in open_file().
1999-02-22 19:01:42 +00:00
Guido van Rossum fb801e7d33 As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
so they don't need to be treated specially here.
1999-02-22 15:40:34 +00:00
Guido van Rossum 974e32d910 Steve Clift pointed out that 'file' allows a netloc. 1999-02-22 15:38:46 +00:00
Guido van Rossum 11a8d0b684 Dang. Even though this is obsolete code, somebody found a bug, and I
fix it.  Oh well.
1999-02-22 15:19:47 +00:00
Fred Drake 3d199af40d Bow to font-lock at the end of the docstring, since it throws stuff
off.

Make sure the path paramter to readmodule() is a list before adding it
with sys.path, or the addition could fail.
1999-02-18 20:51:50 +00:00
Fred Drake d804f4eea0 _safe_repr(): Simplify the condition tests in the first possible
return path.
1999-02-17 17:30:52 +00:00
Guido van Rossum 5d856fcd0f The usual 1999-02-16 20:05:35 +00:00
Guido van Rossum ed52a20c6e In open_ftp(), check that retrlen is not None before using it in a %d format! 1999-02-16 15:10:12 +00:00
Guido van Rossum 72ce85823c Fix by Chris Petrilli (to his own code) to limit the number of
iterations looking for expansions to 10.
1999-02-12 14:13:10 +00:00
Guido van Rossum c731723730 Mod by Jack Jansen: on Macintosh, use EasyDialogs.GetPassword if it
exists.
1999-02-11 14:41:46 +00:00
Guido van Rossum 00f7da4f1e Patch by Steve Clift -- fix the indices now that f_fsid is no longer returned! 1999-02-10 13:12:07 +00:00
Guido van Rossum 2e7840fe8f The usual. 1999-02-09 18:40:13 +00:00
Guido van Rossum 9e1721fa79 Tim Peters:
+ Implements a put_nowait method.
+ Adds a corresponding Queue.Full exception.
+ Simplifies the implementation by adding optional "block" args to get() and
put(), and makes the old get_nowait() and new put_nowait() one-line
redirections to get() and put().
+ Uses (much) simpler logic for the nowait cases.
+ Regularizes the doc strings to something closer to "Guido style" <wink>.
+ Converts two stray tabs into spaces.
+ Removes confusing verbiage about the queue "not being available" from the
docstrings -- never knew what that meant as a user, and after digging into
the implementation still didn't know what it was trying to say.
1999-02-08 18:34:01 +00:00
Guido van Rossum c55b0ca601 Put a try-except around the "image delete" call in Image.__del__ to
avoid tracebacks when the root is destroyed before the image object.
1999-02-08 15:26:49 +00:00
Guido van Rossum d42e46ead5 Ehm, when we don't need to byteswap the data, don't go through an
array object at all.
1999-02-05 22:32:11 +00:00
Guido van Rossum ebb9c922cb Two important fixes:
(1) on a little-endian platform, don't byteswap;

(2) in _patchheader(), there was a missing self._file argument to a
_write_long() call.
1999-02-05 22:28:17 +00:00
Guido van Rossum 14162abf6e The encoding type was wrong, I think. 1999-02-05 20:57:44 +00:00
Guido van Rossum 2013ba48a6 Should open files in binary mode!
Also finally get rid of some obsolete commented-out access statements.

A note about the previous checkin: I believe it's correct, but I found
something strange: the file Lib/test/audiotest.au in the Python
distribution was evidently encoded in u-LAW format but had its
encoding set to 2, i.e. linear-8.  I hope that this is a mistake
caused by some conversion program that produced this .au file; I just
found it on a website.
1999-02-05 20:55:16 +00:00
Guido van Rossum 5ebeea0467 Shouldn't be treating linear-8 as u-law! 1999-02-05 19:59:27 +00:00
Guido van Rossum ead9d8d2d7 New test for ntpath module 1999-02-03 17:21:21 +00:00
Guido van Rossum 534972bce2 New splitdrive() that knows about UNC paths (e.g., network paths like
\\host\mountpoint\dir\file).  By Larry Hastings.

Also cleaned up some docstrings.
1999-02-03 17:20:50 +00:00
Guido van Rossum 2e3f7bece0 Fredrik Lundh fixes Sjoerd's patch...
"""Sjoerd's version stores unbound methods.  that's not good enough ;-)
Here's an alternative implementation of fixdict."""
1999-02-02 22:15:24 +00:00
Guido van Rossum cc2c291b7f Patch by Sjoerd Mullender to placate /F:
Fix leaking of instances by removing the elements variable that we
created on closing the parser.  The elements variable is now created
in the reset() method, so that the sequence close(); reset();
... works.
Also, add the name of the entity reference that wasn't found to the
error message.
1999-02-02 17:54:38 +00:00
Guido van Rossum 67c65b2954 Special-case _P_WAIT etc. for NT. 1999-02-01 23:52:29 +00:00
Guido van Rossum fe64935cf9 Patch by Sjoerd Mullender for better compatibility with the version
from Python 1.5.1:

If after __init__ finishes no new elements variable was created, this
patch will search the instance's namespace for all attributes whose
name start with start_ or end_ and put their value in a new elements
instance variable.
1999-02-01 15:35:13 +00:00
Guido van Rossum c0780ac8f3 From: Mike Orr <mso@oz.net>
In the docstring of ConfigParser.py  (Python 1.5.2b1):
    read(*filenames) -- read and parse the list of named configuration files

should be:
    read(filenames) -- read and parse the list of named configuration files

The method accepts a list, not a bunch of positional arguments.
Which is good, the list is much more convenient.
1999-01-30 04:35:47 +00:00
Guido van Rossum ca44236a1c Embarrassing: remove a debug print statement from set_break() for the
second time!
1999-01-29 22:39:32 +00:00
Guido van Rossum 9787bea4cd Use win32api.GetFullPathName(path) if it exists to implement abspath(). 1999-01-29 22:30:41 +00:00
Guido van Rossum 170e190f26 Support a canonical() method, implementable by a derived class, to be
applied to all filenames before they are compared, looked up in the
breaks dictionary, etc.  The default implementation does nothing --
it's implented as fast as possible via str().  A useful implementation
would make everything a absolute, e.g. return os.path.normcase(
os.path.abspath(filename)).
1999-01-29 22:03:51 +00:00
Guido van Rossum e294cf620a Add abspath() 1999-01-29 18:05:18 +00:00
Barry Warsaw e11e3dee3e Added a -s option which is useful for narrowing down memory leaks.
With -s only a single test is run.  The next test run is chosen
sequentially from the list of all tests.
1999-01-28 19:51:51 +00:00
Barry Warsaw ab11f60bb3 Added a new test for old filter() memory leak 1999-01-28 19:44:06 +00:00
Guido van Rossum b657c9344f Improvement of b/w compat note in help text for clear, by Richard Wolff. 1999-01-28 14:38:32 +00:00
Barry Warsaw 72588741dd Slight reworking of this test. If nis.maps() gives a nis.error, then
raise an ImportError if not running verbose.  This signals to the
regression framework that this test isn't applicable.
1999-01-28 04:54:33 +00:00
Guido van Rossum 583cc31c22 Get rid of do_clear_break / do_clb command -- it is redundant.
(It was left in accidentally after a long and arduous 3-way patch session.)
1999-01-27 22:43:55 +00:00
Barry Warsaw f09f6a5565 Re-format the module docstring and document the new get() argument. 1999-01-26 22:01:37 +00:00
Guido van Rossum e6506e753b Patch by Chris Petrilli (not really tested since I don't know this
module myself) to accept an option keyword argument (vars) that is
substituted on top of the defaults that were setup in __init__.  The
patch also fixes the problem where you can't have recusive references
inside your configuration file.
1999-01-26 19:29:25 +00:00
Guido van Rossum 3e0d319196 The usual. 1999-01-25 21:57:29 +00:00
Fred Drake dfd8954e36 Allow recognition of attributes even if they don't have space in front
of them.  I.e., '<a name="foo"href="bar.html">' will now have two
attributes recognized.

Based on comments from newgroup.
1999-01-25 21:57:07 +00:00
Guido van Rossum 2fff84d892 Don't die if CodeType doesn't exist -- ignore the error. This could
happen in restricted mode.
1999-01-25 21:37:02 +00:00
Guido van Rossum 0189c010c3 Correct typo in new function get_breaks(). 1999-01-25 20:56:33 +00:00
Guido van Rossum 816a9fbd2c Change clear syntax to support three alternatives:
clear
    clear file:line
    clear bpno bpno ...

Also print the breakpoint data after calling set_break(), because the
print statement in set_break() has gone.
1999-01-25 20:56:07 +00:00
Guido van Rossum 6ea27cc2c6 Change clear_break() to the old signature clear_break(file, line).
Add new clear_bpbynumber() with single bpno argument.  (Adapted from
a patch by Richard Wolff.)

Also some cleanup in error messages and moved some comments into a
docstring.
1999-01-25 20:51:34 +00:00
Fred Drake 0237909e42 Enable os.path as a mostly-normal submodule, including "from os.path
import isfile" and "import os.path".
1999-01-19 16:05:13 +00:00
Greg Ward f6cdcd509d Added 'warn' method. 1999-01-18 17:08:16 +00:00
Guido van Rossum 433892021e Added doc strings to the exception classes.
Contributed by Blake Winton, but considerably edited.
1999-01-15 04:03:46 +00:00
Guido van Rossum 40233ea70a Patch by Piers Lauder: make exceptions classes.
Take opportunity to add more explanatory messages to exceptions.
1999-01-15 03:23:55 +00:00
Barry Warsaw e75888eb85 Test the rfc822.py module. Contains just a few simple cases, and some
troublesome ones encountered on the c.l.py list.
1999-01-14 20:00:58 +00:00
Barry Warsaw 8a578436f4 Message.getaddrlist(): This now handles multiple occurances of the
named header, so that if a message has, e.g. multiple CC: lines, all
will get returned by the call to getaddrlist().  It also correctly
handles addresses which show up in continuation lines.

AdderlistClass.__init__(): Added \n to self.CR which fixes a bug that
sometimes, an address would contain a bogus trailing newline.

Message.getaddress(): In final else clause, added a test for the
character we're at being in self.specials.  Without this, such
characters never get consumed and we infloop.  Case in point (as
posted to c.l.py):

To: <[smtp:dd47@mail.xxx.edu]_at_hmhq@hdq-mdm1-imgout.companay.com>
----------------------------^
otherwise we'd infloop here
1999-01-14 19:59:58 +00:00
Guido van Rossum 348fd06890 In rcpt(), avoid a space after the TO: address when the option list is
empty.  Make sure there is a space when there are options.
1999-01-14 04:18:46 +00:00
Guido van Rossum e1bf7e8c1d Change the order of the utime() and the chmod() call in copystat().
This doesn't make a bit of difference on Unix, but apparently on
Windows NT you need write permission before you can set the utime...
1999-01-14 00:42:00 +00:00
Greg Ward d1dc47558c Added: mems.lib.text_file: provides TextFile class for parsing text
files with (optional) comment stripping, blank line skipping, whitespace
removal, and line joining with trailing backslashes.
1999-01-13 16:12:04 +00:00
Guido van Rossum 0039d7b4e6 A gift from Sam Rushing - modules asyncore and asynchat for the
standard Python library.  (Async socket support.)
1999-01-12 20:19:27 +00:00
Fred Drake f4bb656a4f DumbWriter.send_paragraph(): Fix problem with DumbWriter reported to
the newsgroup by Raymond Tong Leng Ng <rntl@yahoo.com>.
1999-01-12 18:13:27 +00:00
Fred Drake 6a1b53c165 get_config_h_filename(): Fix to work with current Python
installations; it was picking up a stale config.h from an
	overwritten installation.
1999-01-11 15:34:55 +00:00
Guido van Rossum 0bdbe6c5f0 Added some more comments. 1999-01-10 06:09:13 +00:00
Barry Warsaw 302331a3b6 FieldStorage.__init__(): if there is no content-type header, use
text/plain for inner parts, but application/x-www-form-urlencoded
for outer parts.  Honor any existing content-type header.

Lower down, if the content-type header is something we don't
understand (say because it there was a typo in the header coming from
the client), default to text/plain for inner parts, but
application/x-www-form-urlencoded for outer parts.
1999-01-08 17:42:03 +00:00
Andrew M. Kuchling 5c355201e2 Fixed bug in the common-case code for HTTP URLs; it would lose the query,
fragment, and/or parameter information.
3 cases added to the test suite to check for this bug.
1999-01-06 22:13:09 +00:00
Guido van Rossum 2386d7333f Constants for [f]statvfs() (new in posixmodule.c) by Steve Clift. 1999-01-06 18:54:57 +00:00
Fred Drake 522af3a126 Update and add docstrings. 1999-01-06 16:28:34 +00:00
Fred Drake dc1aedfe2e Move brief descriptions of what() and whathdr() to docstrings in the
functions (from comments).
1999-01-06 15:20:49 +00:00
Greg Ward 9ddaaa1a30 Another patch from Fred: factored _init_posix into
get_config_h_filename, get_makefile_filename, parse_config_h, and
parse_makefile.
1999-01-06 14:46:06 +00:00
Guido van Rossum f4bf044999 Got rid of whatraw().
Doc-string-ified the lead comments.
Added auto call of test() when run as script.
1999-01-06 13:05:58 +00:00
Guido van Rossum 638d7f14f8 Add extend() method. A small New Year's present from Jean-Claude Wippler. 1999-01-06 12:49:24 +00:00
Guido van Rossum 4494101858 Incorporate fix suggested by /Fredrik Lundh in the newsgroup to cope
with trailing garbage generated by some broke uuencoders.
1999-01-05 18:02:24 +00:00
Guido van Rossum f8d579c5e3 This hopefully fixes the problem of having to set PATH
in autoexec.bat in order to find the Tcl DLLs -- Tkinter calls FixTk
which will hunt around in a few common places and then set PATH
and try again, or else issue a big clarifying error message.
1999-01-04 18:06:45 +00:00
Guido van Rossum 82eae9eaa7 Added mt_interact() -- multithreaded version of interact().
interact() automatically uses this on Windows (where the
single-threaded version doesn't work).
1998-12-23 23:04:17 +00:00
Guido van Rossum db01ee0e22 Patch by Mike Meyer:
Extended the rfc822 parsedate routines to handle the cases they failed
on in an archive of ~37,000 messages.  I believe the changes are
compatible, in that all previously correct parsing are still correct.

[I still see problems with some messages, but no showstoppers.]
1998-12-23 22:22:10 +00:00
Guido van Rossum 9a4d63730e Patch by Mike Meyer:
Add a class to mailbox.py for dealing with qmail directory mailboxes.
The test code was extended to notice these being used as well.
1998-12-23 22:05:42 +00:00
Guido van Rossum 99e1131536 Avoid crash in parsedate_tz() on certain invalid dates -- when the
field assumed to be the time is in fact the year, the resulting list
doesn't have enough items, and this isn't checked for.  Return None
instead.
1998-12-23 21:58:38 +00:00
Barry Warsaw 0720177e3d Small, and final docstring merge with Dragon's version. 1998-12-22 20:37:36 +00:00
Guido van Rossum c822a453bd Add warning to Netrc's docstring that it is obsolete -- use the netrc
module instead.  (The main advantage of the latter is that it comes
with documentation.)
1998-12-22 16:49:16 +00:00
Guido van Rossum af5add4629 New test function by Sjoerd, adding -t option. 1998-12-22 14:23:50 +00:00
Guido van Rossum 7ea1d972d1 The usual.
# Message to all python-checkins readers: we have a problem with the
# CVS mirroring software.  You can't check out the latest changes yet.
# We hope to have fixed this by noon EST today.
1998-12-22 13:50:33 +00:00
Greg Ward 3c8e54bf62 Applied Fred's patch to fix the bugs that John Skaller noticed. 1998-12-22 12:42:04 +00:00
Guido van Rossum 9c30c24bc2 Adding shlex and netrc by Eric Raymond. 1998-12-22 05:19:29 +00:00
Barry Warsaw a7d9bdfab6 A few other docstring fixes, most importantly to be a little nicer to
Emacs ;-)
1998-12-22 03:24:27 +00:00
Barry Warsaw 4c4bec86f4 Nothing earthshattering, just some fixes to typos and other formatting
bugs in various docstrings.
1998-12-22 03:02:20 +00:00
Guido van Rossum d147a6c35a Renaming Lib/plat-beos1 to Lib/plat-beos at Chris Herborth's request 1998-12-21 19:18:55 +00:00
Guido van Rossum 98c17b3aee Marc-Andre Lemburg notes about statparse():
"""
The message ID is returned lowercased and there is no way to access
the original ID the server sent. Now at least some news servers
are very picky about the case of the ID and return errors when
fetching articles with mixed case given a lowercased version
of the ID.

The solution is simple: remove the string.lower() call.
"""

(I might add that the lowercasing was probably introduced as a result
of sloppy copy-and-paste coding; there's a string.lower in a similar
piece of code a bit higher in the source, that makes more sense --
it's lowercasing the group name.)
1998-12-21 18:51:23 +00:00
Guido van Rossum dfaac4df9e Add XXX comment about the need to add a dump() method to the Text
widget -- no time to do this right now.
1998-12-21 18:25:03 +00:00
Guido van Rossum c08cc50e00 Add XXX comment about a test that doesn't seem right -- no time to
explore this now.
1998-12-21 18:24:09 +00:00
Guido van Rossum 0b56a3e9a7 A mod whose author I forget. (I must've mislaid the email. If it's
yours, please let me know for propoer acknowledgement.)

This avoids recompiling files that haven't changed; it adds a -f
option to force recompilation.
1998-12-21 18:23:38 +00:00
Guido van Rossum 91c8f5901b Sjoerd Mullender:
- Fixed a bug where a syntax error was reported when a document
  started with white space.  (White space at the start of a document
  is valid if there is no XML declaration.)
- Improved the speed quite a bit for documents that don't make use of
  namespaces.
1998-12-21 18:15:28 +00:00
Guido van Rossum c6769c54f4 Typo discovered by Just. 1998-12-21 16:26:31 +00:00
Guido van Rossum 1f05708f69 Use __stdin__ instead of stdin to derive FileType -- safer against
assignments.
1998-12-19 23:53:33 +00:00
Greg Ward 1190ee3d03 Fred's sysconfig module. 1998-12-18 23:46:33 +00:00
Greg Ward ee789b9601 Initial checkin of distutils source files. 1998-12-18 22:00:30 +00:00
Guido van Rossum b083a9fb54 Sjoerd Mullender writes:
Here is my current version of xmllib.py and the documentation.  This
version has some API changes with respect to the version currently in
Python (also the one in 1.5.2a).
This version supports XML namespaces.
1998-12-18 20:17:13 +00:00
Guido van Rossum 33add0a95a Sjoerd Mullender:
File names with "funny" characters get translated wrong by
pathname2url (any variety).  E.g. the (Unix) file "/ufs/sjoerd/#tmp"
gets translated into "/ufs/sjoerd/#tmp" which, when interpreted as a
URL is file "/ufs/sjoerd/" with fragment ID "tmp".

Here's an easy fix.  (An alternative fix would be to change the
various implementations of pathname2url and url2pathname to include
calls to quote and unquote.

[The main problem is with the normal use of URLs:
	url = url2pathname(file)
	transmit url
	url, tag = splittag(url)
	urlopen(url)
]

In addition, this patch fixes some uses of unquote:
- the host part of URLs should be unquoted
- the file path in the FTP URL should be unquoted before it is split
  into components.
- because of the latter, I removed all unquoting from ftpwrapper,
  and moved it to the caller, but that is not essential
1998-12-18 15:25:22 +00:00
Andrew M. Kuchling dc86a4e5bb Added a -q ('quiet') option to tabnanny, which causes only the names of
offending files to be printed.  Good for emacs `tabnanny.py *.py`
1998-12-18 13:56:58 +00:00
Barry Warsaw 107e623ef0 grid_bbox(): support new Tk API: grid bbox ?column row? ?column2 row2? 1998-12-15 00:44:15 +00:00
Guido van Rossum 030d2ec16c In read_multi, allow a subclass to override the class we instantiate
when we create a recursive instance, by setting the class variable
'FieldStorageClass' to the desired class.  By default, this is set to
None, in which case we use self.__class__ (as before).
1998-12-09 22:16:46 +00:00
Guido van Rossum f8b3b944aa In __getslice__, use self.__class__ instead of UserList. 1998-12-09 22:15:01 +00:00
Guido van Rossum 204b65c50f Sjoerd patches the previous patch:
In literal mode, also don't do anything about entity and character
references, or about closing CDATA elements.
1998-12-08 13:25:00 +00:00
Guido van Rossum f484a3366b Sjoerd writes:
When literal mode is entered it should exit automatically when the
matching close tag of the last unclosed open tag is encountered.  This
patch fixes this.
1998-12-07 21:59:56 +00:00
Guido van Rossum 5c3b384a85 Patch by Jeff Rush:
In SimpleHTTPServer.py, the server specified in test() should
be BaseHTTPServer.HTTPServer, in case the request handler should
want to reference the two attributes added by
BaseHTTPServer.server_bind:

        self.server_name = hostname
        self.server_port = port

There was some Bobo CGI code that wanted access to those attributes.
1998-12-07 04:08:30 +00:00
Guido van Rossum 9228cbd084 Patch by Jeff Rush:
In CGIHTTPServer.py, the list of acceptable formats is -split-
on spaces but -joined- on commas, resulting in double commas
in the joined text.  It appears harmless to my browser but
ought to be fixed anyway.

    'A, B, C' -> 'A,', 'B,', 'C,' -> 'A,,B,,C'
1998-12-07 04:08:03 +00:00
Guido van Rossum 391c8b4ea2 Open the file in binary mode -- so serving images from a Windows box
might actually work.
1998-12-07 03:53:18 +00:00
Guido van Rossum b241b67b89 Turtle graphics 1998-12-04 16:42:46 +00:00
Barry Warsaw 8fe2a34e1f Added NotImplementedError, subclassed from RuntimeError 1998-12-01 18:36:30 +00:00
Guido van Rossum 67a40e814c Patch by Jeff Bauer: a minor change to declare two new
threaded versions of Unix Server classes, using the
ThreadingMixIn class:

    ThreadingUnixStreamServer
    ThreadingUnixDatagramServer
1998-11-30 15:07:01 +00:00
Guido van Rossum e720176548 Wrong pathname in docstring detected by Fredrik Nehr. 1998-11-25 15:57:47 +00:00
Guido van Rossum 691d27a7ae Bomb on deleting a temporary breakpoint: there's no method
do_delete(); do_clear() was meant.  By Greg Ward.
1998-11-18 15:56:06 +00:00
Guido van Rossum 6d06094c77 Accept a non-list sequence for the long options (request by Jack Jansen).
Because it might be a common mistake to pass a single string, this
situation is treated separately.

Since we were making a copy of the longopts list anyway, we now use
the list() function -- this made it necessary to change all uses of
the local variable (and argument) 'list' to something more meaningful,
i.e., 'opts'.

Also added docstrings (copied from the library manual) and removed the
(now redundant) module comments.
1998-11-17 04:16:37 +00:00
Guido van Rossum fdb3d1a75e Fix typo in docstring: client_request should be client_address.
Noted by Stefan Witzel.
1998-11-16 19:06:30 +00:00
Guido van Rossum e0fbe1c26d Declaring zmod and poly obsolete. They have problems. 1998-11-02 15:38:51 +00:00
Guido van Rossum 2457fc2a81 Improvement to the previous fix suggested by Thomas Bellman: if the
unlink() or fdopen() fail, close the file descriptor and re-raise the
exception.
1998-10-24 15:02:59 +00:00
Guido van Rossum dce3d5502e The TemporaryFile() function has a security leak -- because the
filenames generated are easily predictable, it is possible to trick an
unsuspecting program into overwriting another file by creating a
symbolic link with the predicted name.  Fix this by using the
low-level os.open() function with the O_EXCL flag and mode 0700.  On
non-Unix platforms, presumably there are no symbolic links so the
problem doesn't exist.  The explicit test for Unix (posix, actually)
makes it possible to change the non-Unix logic to work without a
try-except clause.

The mktemp() file is as unsafe as ever.
1998-10-24 01:34:45 +00:00
Guido van Rossum 5d42b5b74d Moved compile_command() to a file of its own (codeop.py). 1998-10-22 21:56:44 +00:00
Guido van Rossum c41c1a984e Moved compile_command() here from code.py, so JPython can provide its
own version.
1998-10-22 21:56:15 +00:00
Guido van Rossum d370379186 Jim Fulton writes:
"""
I've attached a long overdue patch to pickle.py to bring it to format
1.3, which is the same as 1.2 except that the binary float format
is supported.  This is done using the new platform-indepent format
features of struct.

This patch also gets rid of the undocumented obsolete Pickler
dump_special method.
"""
1998-10-22 20:15:36 +00:00
Guido van Rossum fbba304aaa Move 'import sys' to top of module, as noted by Tim Peters. 1998-10-22 16:18:25 +00:00
Guido van Rossum 04da10c7a2 Piers Lauder writes:
"""
Jochen Hayek has reported a problem with some versions of IMAP4
servers that choose to mix the case in their CAPABILITIES response.

The patch below fixes the problem.
"""
1998-10-21 22:06:56 +00:00
Guido van Rossum a9832bc572 Use (f1, f2) as cache key instead of f1 + ' ' + f2.
Noted by Fredrik Lundh.
(Note -- this module is pretty silly.)
1998-10-21 15:23:52 +00:00
Guido van Rossum f5745008d2 Patch by Jim Fulton, who writes:
"""
The FieldStorage constructor calls the read_multi method.  The read_multi
method creates new FieldStorage objects, re-invoking the constructor
(on the new objects).  The problem is that the 'environ', 'keep_blank_values',
and 'strict_parsing' arguments originally passed to the constructor are not
propigated to the new object constructors.  This causes os.environ to be used,
leading to a miss-handling of the parts.

I fixed this by passing these arguments to read_multi and then on to the
constructor.  See the context diff below.
"""
1998-10-20 14:43:02 +00:00
Guido van Rossum d90ae19b92 Rename 'locals' argument to top-level interact() function to 'local'
for b/w compatibility with 1.5.1.
1998-10-19 18:42:53 +00:00
Guido van Rossum eeb2f32aad Fixed a problem where xmllib didn't handle the tag
<sometag attrib=">">
correctly.
Also changed comparisons of re matches and searches into explicit
comparisons with None.
(Sjoerd Mullender)
1998-10-19 13:28:26 +00:00
Guido van Rossum d54fb7ae9b The usual 1998-10-17 18:09:27 +00:00
Guido van Rossum c2047c19f5 When run as a script, don't pass a fake __main__ dictionary; use the
real one.
1998-10-15 01:38:23 +00:00
Guido van Rossum b0e5718643 Fix so that after a fork() -- on Unix only -- the template gets
recalculated.
1998-10-14 20:27:05 +00:00
Guido van Rossum 9f1292d840 Perhaps a controversial change: when reporting a callback exception,
assign the exception info to sys.last_{type,value,traceback}.  That
way, an introspective Tkinter app can inspect its own stack trace.

(The controversy is that it would keep some objects alive, but that's
probably no big deal.)
1998-10-13 20:02:39 +00:00
Barry Warsaw 4eaadf002e Added {xview,yview}_{moveto,scroll} to the Canvas class. 1998-10-13 19:01:10 +00:00
Guido van Rossum e73d702344 Ever-so-slight improvementL the patterns to recognize import
statements now also stop at ';' (formerly they only stopped at '#').
1998-10-13 16:12:36 +00:00
Guido van Rossum 243ac4f497 Updated listbox methods to Tk 8.0. (Moved some around, added
x/yview_scroll/moveto.)
1998-10-13 13:37:30 +00:00
Guido van Rossum 3179b36014 When no master widget is specified, use options['parent'] if it exists. 1998-10-12 20:40:47 +00:00
Guido van Rossum 7f20263349 Only reference Tkinter._default_root when needed. 1998-10-12 20:40:09 +00:00
Guido van Rossum 0688436305 Enhancements by Sjoerd Mullender: support for
from a.b import c
	import a . b
1998-10-12 15:23:04 +00:00
Guido van Rossum 7a840e8d50 Add support for dotted module names to readmodule(). 1998-10-12 15:21:38 +00:00
Guido van Rossum 1c5fb1cd1b Make mimetypes.guess_type understand data URLs. (Sjoerd Mullender) 1998-10-12 15:12:28 +00:00
Guido van Rossum 56440a58f7 Fix two bugs in the fstat() line, reported by Fredruk Lundh. 1998-10-07 14:06:03 +00:00
Guido van Rossum d832f9e425 Fix append() calls with more than 1 argument. 1998-10-07 13:18:17 +00:00
Guido van Rossum da65450530 The message "Exception in Tkinter callback" should go to stderr.
Fix bug in NoDefaultRoot() -- _default_root wasn't declared global;
and made it reentrant.

Don't set _default_root to whatever master gets passed in to
BaseWidget._setup() (only set it when we need to create a new Tk()
widget).
1998-10-06 19:06:27 +00:00
Guido van Rossum 96372a2657 ST_MODE should be ST_MTIME in utime call in copystat. Thanks to Mike Orr. 1998-10-02 03:16:08 +00:00
Guido van Rossum 64e736ba4e Some new blood and some updated versions. 1998-10-02 01:23:47 +00:00
Guido van Rossum 4581a0c07b New test_long.py from Tim Peters. 1998-10-02 01:19:48 +00:00
Barry Warsaw 4cbe3876ec NSEW is also valid for -sticky 1998-10-01 15:54:48 +00:00
Barry Warsaw 9190046289 Added NS and EW constants, which are meaningful values for grid's
-sticky option.
1998-10-01 13:49:37 +00:00
Guido van Rossum f984a65267 Fix suggested by Sjoerd (long ago!) to get a better error message when
there's a syntax error.  (In particular, display the correct
filename).  This changes the API: if there's a syntax error, the
function now returns normally after dumping the error to sys.stderr.
I changed Sjoerd's use of string.join(string.split(...)) with
string.replace().
1998-09-29 15:57:42 +00:00
Guido van Rossum 26367a001d New version from Piers Lauder, who writes:
Added a debug function to replace 'print' statements.
Ensured that response attached to 'NO' replies is passed back.
added readonly exception.
Rearranged method order into types.
Ensure select returns a meaningful error on 'NO'.
'NO' returns from authenticate and login raise error with last message,
not list.
1998-09-28 15:34:46 +00:00
Guido van Rossum 75bb54c3d8 Don't set a local variable named __args__; this feature no longer
works and Greg Ward just reported a problem it caused...
1998-09-28 15:33:38 +00:00
Guido van Rossum 9ab96d40eb Changes by Eric Raymond:
1. Generate a correct Content-Length header visible through the info() method
   if a request to open an FTP URL gets a length in the response to RETR.

2. Take a third argument to urlretrieve() that makes it possible to progress-
   meter an urlretrieve call (this is what I needed the above change for).
   See the second patch band below for details.

3. To avoid spurious errors, I commented out the gopher test.  The target
   document no longer exists.
1998-09-28 14:07:00 +00:00
Barry Warsaw 9195f55bbf Updated the docstring and class hierarchy diagram 1998-09-25 22:43:21 +00:00
Guido van Rossum f7d77009c1 Add two constants (with the same value) to specify the on-board CD input. 1998-09-24 18:09:47 +00:00
Guido van Rossum 5227f0fdcd Reworked it quite a bit. There are now two classes: a base class,
InteractiveInterpreter, which handles parsing and interpreter state
but doesn't know deal with buffering or prompting or input file
naming.  And a derived class, InteractiveConsole, which adds buffering
and prompting and supports setting the filename once.  Also tweak the
algorithm in compile_command() a bit so that input consisting of all
blank lines or comments always succeeds immediately, and note the fact
that apart from SyntaxError it can also raise OverflowError.
1998-09-22 20:38:53 +00:00
Guido van Rossum 0238a25b20 Do the check for lacking sys.stdin.fileno() *before* testing for
Windows.  If sys.stdin doesn't appear to be a real file (characterized
by having a working fileno()), don't use any console specific methods
-- go straight to the default.
1998-09-22 02:38:42 +00:00
Guido van Rossum ef0056ae1a When sys.stdin.fileno() doesn't work, fall back to default_getpass()
-- don't just die.
1998-09-21 20:00:35 +00:00
Guido van Rossum 4ecd85aad7 After the previous changes, func_normalize() turned out to be redundant.
This simplified some other places in the code.
1998-09-21 17:40:47 +00:00
Guido van Rossum b0a94c0549 Changes so that JPython can also use this version of profile.py.
Suggested by Jim Hugunin.
1998-09-21 16:52:44 +00:00
Guido van Rossum f07029e4ba Get rid of the classes RModuleLoader and RModuleImporter -- these were
only there to override reload() in a way that doesn't make a whole lot
of sense and moreover broke since the latest changes in ihooks.
1998-09-21 14:53:26 +00:00
Guido van Rossum e3f8a64906 Comment out 't = t[0] + t[1]' in profiler_simulation() -- this
function is only used when running the calibration code, and it turns
out that recent changes in the timing code caused this statement to
raise an exception.
1998-09-21 14:52:22 +00:00
Guido van Rossum fc076d4ce2 Untabified and applied Richard Wolff's changes (plus my own reflowing
of some paragraphs).
1998-09-17 15:01:38 +00:00
Guido van Rossum 3a98e78a6e Richard Wolff's additional changes; some layout nits, and change the
alias delimiter to ';;'.
1998-09-17 15:00:30 +00:00
Guido van Rossum 743d17e3aa In load_inst(), when instantiating an instance the old way (i.e. when
there's an __getinitargs__() method), if a TypeError occurs, catch and
reraise it but add info to the error about the class name being
instantiated.  This makes debugging a lot easier if __getinitargs__()
returns something bogus (e.g. a string instead of a singleton tuple).
1998-09-15 20:25:57 +00:00
Guido van Rossum 0c92000b7a Ignore the TclError exception raised when deleting the registration
for callit, used by the after() command.  This can happen when the
callback deletes the window.
1998-09-14 19:06:39 +00:00
Guido van Rossum 8d5bef7fb8 There was a confusion in my checkin of the code to support list() with
and without a message number argument: the argument was called 'msg'
but the code expected it to be called 'which'.  In line with the other
methods, I've renamed the argument to 'which', and adapted the doc
string not to refer to 'msg'.
1998-09-14 17:36:51 +00:00
Guido van Rossum f9a6d7d494 Print serious errors to stderr instead of stdout. 1998-09-14 16:22:21 +00:00
Guido van Rossum 7944ea523e Patch by Marc-Andre Lemburg: use re module to compare test results.
This makes it possible to accept that on Linux %w returns "01" instead
of "1", for example.
1998-09-14 15:50:40 +00:00
Guido van Rossum f0a275d4db Richard Wolff's changes:
pdb.doc		Updated to reflect better the various changes.
1998-09-12 14:42:23 +00:00
Guido van Rossum 2424f855f3 Richard Wolff's changes:
pdb.py  Uses the Breakpoint class so one can enable/disable breakpoints,
	set temporary ones, set ignore counts, and conditions.  The last
	can be set using the 'b' command
		b 243 , i>4		( b 243,i>4 if you are space adverse)
	or with the condition command so conditions can be changed
	for a particular breakpoint.

	Breakpoints are numbered from 1 on, and if a breakpoint is deleted,
	the number is not reused.  All the breakpoint handling commands
	refer to breakpoints by number.  To be consistent, the clear command
	does so as well, which is the one change from the original pdb that
	is not transparent.  Thus only the breakpoint command 'b' uses a
	line number or file:line or method.  You can also give
		b whrandom.random    and the method will be searched for along
	sys.path.  This is implemented with an 'egrep' command and so
	is not as portable as it might be.  [ see  lineinfo() and
	lineinfoCmd ]

	Breakpoints cannot be set at a line that is blank or a '#' comment
	or starts a triply quoted comment.  This is because I would like
	this behavior in my DDD interface and think it reasonable for
	pdb as well.  It can be removed readily, however as it is all
	incorporated in the routine checkline().  If one attempts to
	set a breakpoint at a 'def' line, the breakpoint is automatically
	moved to the first executable line after the 'def'.  This too is
	in checkline().

	do_EOF() returns zero so typing an end-of-file character as a command
	does nothing.  'quit' does the quitting.

	The routine defaultFile() is present so as to preserve the current
	pdb behavior and yet allow me to override it in pydb.

	There's some code in lineinfo() that is probably mainly useful only
	for pydb and if you prefer, much up to the comment "Best first guess"
	could be removed.

	Keith Davidson provided the code for handling $HOME/.pdbrc and
	./.pdbrc, and it has been incorporated.  He also provided the
	alias handling routine.  I modified it a bit so it could live
	nicely in precmd().  He and I have been in contact; he has the
	new pdb (and pydb) with his code incorporated.  He also asked
	about the possibility of allowing multiple commands on one
	line, such as step;step  or s;s  or with an alias such as
		alias ct tbreak %1 ; continue
	and since it was so easy, that's in place as well.  It's a simple
	'split the line at the first ";"' operation and puts the second
	half in the command queue (self.cmdqueue).  This has the unfortunate
	effect of destroying a line like   print "i: "+i+"; j: "+j
	but either there's a simple way to deal with this, or my attitude
	will remain that pdb is a debugger, not a compiler/parser/etc.
	An alias like   alias 4s  s;;s;
	will work because the adjacent and trailing ";" act like a <cr> which
	repeats the last command.  Of course, either s;s;s;s or s;;;  would be
	a bit more sensible.

	The help commands have been updated.
1998-09-11 22:50:09 +00:00
Guido van Rossum d93643fe4a Richard Wolff's changes:
bdb.py  now has a class definition called Breakpoint along with
	associated methods.  There's no reason why this class has to
	be there; if you prefer it elsewhere, 'tis easily done.

(Minor reformatting by GvR; e.g. moved Breakpoint's doc string to
proper point.)
1998-09-11 22:38:35 +00:00
Guido van Rossum 5fca6fd2d9 Richard Wolff's changes:
cmd.py  has incorporated the changes we discussed a couple of weeks ago
	(a command queue, returning line from precmd, and stop from postcmd)
	and some changes to help that were occasioned because I wanted to
	inherit from pdb which inherits from cmd.py and the help routine
	didn't look for commands or the associated help deeply enough.
1998-09-11 22:33:08 +00:00
Guido van Rossum a063303693 Patch suggested by Perry Stoll -- os.path.normpath(".//x") returned
"/x", should return "x".
1998-09-08 22:28:06 +00:00
Jeremy Hylton b85c8479eb Easy optimizations of urlparse for the common case of parsing an http URL.
1. use dict.get instead of try/except KeyError
2. if the url scheme is 'http' then avoid the series of
   'if var in [someseq]:'.  instead, inline all of the code.
3. find = string.find
1998-09-02 21:53:16 +00:00
Guido van Rossum f6ae743cb5 Fix suggested by movits@lockstar.com (plus doc string by myself)
for LIST command with msg argument.
1998-09-02 14:42:02 +00:00
Guido van Rossum c86b7c63e0 Make bind variants without a sequence return a tuple of sequences
(formerly it returned a string, which wasn't very convenient).

Add image commands to the Text widget (these are new in Tk 8.0).
1998-08-31 16:54:33 +00:00
Guido van Rossum b9f48608f6 Changes by Richard Wolff:
1) I added a command queue which is helpful to me (at least so far) and
   would also allow syntax like 's;s' (step; step) in conjunction with precmd
2) doc_leader allows the derived class to print a message before the help
   output.  Defaults to current practise of a blank line
3) nohelp allows one to override the 'No help on' message.  I need
    'Undefined command: "%s".  Try "help".'
4) Pass line to self.precmd to allow one to do some parsing: change first
   word to lower case, strip out a leading number, whatever.
5) Pass the result of onecmd and the input line to postcmd.  This allows
   one to ponder the stop result before it is effective.
6) emptyline() requires a   if self.lastcmd:  conditional because if the
   first command is null (<cr>), you get an infinite recursion with the
   code as it stands.
1998-08-27 19:02:51 +00:00
Jeremy Hylton 4722da6ebf fix typo in keyword argument 'allow_frament' should be 'allow_fragment' 1998-08-25 19:45:24 +00:00
Guido van Rossum 6c74fea07d There was still something wrong. The original NOTTESTS are replaced
by the new '-x' arguments, losing the previous items.  Thus,
test_support, test_b1 & test_b2 are executed (and warnings issued).
(Discovered by Vladimir Marangozov.)
1998-08-25 12:29:08 +00:00
Guido van Rossum 5fdf85254c Patch by Chris Herborth (posted to comp.lang.python)to make it behave
with tags that have - or . in their names.
1998-08-24 20:59:13 +00:00
Guido van Rossum 747e1cade6 Should pass explicit arguments to findtests(). Should initialize 'nottests'. 1998-08-24 13:48:36 +00:00
Andrew M. Kuchling 9a80e00cac The .subn() method wasn't setting _num_regs, which is used by the .groups()
method, so .groups() didn't work inside the replacement function
	called by re.sub.  One-line fix: set self._num_regs inside subn().
1998-08-21 18:39:38 +00:00
Fred Drake ce4ba897be Raise the right exception (ValueError) for attempted I/O on closed StringIO
objects; this makes the emulation of file objects a bit better, and the
exceptions explain things a bit better.
1998-08-18 17:43:08 +00:00
Jeremy Hylton 31bb8cef2c Change interface to sendmail: if the destination address is a string
instead of a list, turn it into a list containing that string.  This
avoids an apparently common newbie mistake -- passing in a single
string for the destination and have it treated as a sequence of
characters.
1998-08-13 19:57:46 +00:00
Guido van Rossum 4365cabf3c Add Tim Peters' test for long ints 1998-08-13 14:20:17 +00:00
Guido van Rossum e03c050595 The usual. 1998-08-12 02:38:11 +00:00
Guido van Rossum 3d16d3e643 Fredrik Lundh's font wrapper. 1998-08-11 19:07:58 +00:00
Guido van Rossum b4750db3b3 Added coords() and identify() methods to Scale class. 1998-08-11 19:07:14 +00:00
Guido van Rossum be21d98cee Use repr() on the filename in EnvironmentError.__str__(). This
displays funny characters, like spaces or control characters, more
clearly (one of my pet peeves in error messages).  Also only suppress
the filename if it is None; display it if it is '', since that would
be a genuine (illegal) filename passed in!
1998-08-11 18:01:32 +00:00
Guido van Rossum df23ef4763 Guess what -- BSD has bifurcated again. :-( 1998-08-11 16:21:04 +00:00
Guido van Rossum 9279ec2504 On the mac, shouldn't change the creator+type of the *source* file! 1998-08-11 14:13:44 +00:00
Guido van Rossum 3da987c292 Checking in BeOS specific socket module. 1998-08-10 20:15:32 +00:00
Guido van Rossum 2b427c74e1 Nannified. 1998-08-10 20:13:17 +00:00
Guido van Rossum 27d445f59e Nannified, and re-indented with 4 spaces. 1998-08-10 20:12:34 +00:00
Guido van Rossum cc221c470f Fixed a few lines that tabnanny complained about (one space before the
tabs).
1998-08-10 20:07:53 +00:00
Guido van Rossum 2880f6ec95 Untabified and deleted trailing blank lines. 1998-08-10 20:07:00 +00:00
Guido van Rossum 449fdf1d76 The doc string for setDaemon() disagreed with the implementation. The
implementation wins.
1998-08-07 19:15:20 +00:00
Guido van Rossum d89fa0c576 Add built-in string variables 'quit' and 'exit' that display a hint on
how to exit (in a platform dependent way!).  We use os.sep to
determine which platform we're on, since I expect that this will work
better for minority platforms.
1998-08-07 18:01:14 +00:00
Guido van Rossum 2c2f731daf [Sjoerd Mullender]
Don't use CL module since all constants are now in cl.
1998-08-07 15:28:23 +00:00
Guido van Rossum 1015be3812 [Sjoerd Mullender]
Fixed infinite loop when a message ends prematurely in some
circumstances.
1998-08-07 15:26:56 +00:00
Guido van Rossum 5ff1761d3f From: "Fredrik Lundh" <fredrik@pythonware.com>
Date: Fri, 7 Aug 1998 13:37:12 +0100

the "initialcolor" code is broken in several places in the
current version of tkColorChooser.  I've attached an up-
dated version for 1.5.2.
1998-08-07 14:55:21 +00:00
Barry Warsaw 6446212593 Time machine experiment. Use '__name__' as the special key (always
present) that refers to the section name.  Also added a (slightly)
better InterpolationError error message, which includes the raw
string.
1998-08-06 18:48:41 +00:00
Guido van Rossum 4163e708ed On the Mac, use Internet Config to find the proxies (Jack Jansen).
Also added two XXX comments about lingering thread unsafeness.
1998-08-06 13:39:09 +00:00
Guido van Rossum 4ff6d27319 Quote/unquote slashes in macintosh pathname components (Jack Jansen). 1998-08-06 13:37:21 +00:00
Guido van Rossum de23cb0e7e Bug in how an except statement was written (submitted by Piers himself). 1998-08-06 02:59:07 +00:00
Guido van Rossum da4d6daa4a Support case insensitive treatment of os.environ keys on Windows and
DOS (as well as OS/2).  I presume that making a call to putenv() with
a lowercase key will actually do the right thing.  I know this is so
on Windows/DOS, and I expect it is so OS/2 -- but the old OS/2 code
didn't assume this.  (I don't know if the person who provided the OS/2
patch was clueless or just didn't care about DOS and Windows.)

Also ripped out the support for pickling -- as of 1.5, this is no
longer needed to make pickling work.
1998-08-04 16:01:23 +00:00
Guido van Rossum fcfb6323fb Latest version by The Dragon, who writes:
I did some bugfixes, and fixed a major problem with the esmtp suport (I
think the person who did that part misunderstood RFC1869) Some of the
interface fer esmtp-related things has changed as a result.

I also added some documentation to the SMTP class' docstring.
1998-08-04 15:29:54 +00:00
Guido van Rossum 84c6fc9653 Patch by Ron Klatchko: fix invariant in _unread(). Also fixed
readlines() to behave like it should (return lines with "\n" appended).
1998-08-03 15:41:39 +00:00
Guido van Rossum 6fd83b7b38 Generalized so it's useful for testing other packages, by Andrew
Kuchling @ CNRI.
1998-08-01 17:04:08 +00:00
Guido van Rossum 3357561476 Added randrange to list of exported functions. 1998-07-31 13:40:05 +00:00
Guido van Rossum 187f154243 Introducing randrange([start,] stop [,step]) -- same as
choice(range(start, stop, step)) but faster.  This addresses the
problem that randint() was accidentally defined as taking an inclusive
range (how unpythonic).

The code is longish because Tim Peters insisted that it reject
non-integral arguments while I insisted that it be not much slower
than randint(); the compromise satisfies both but is somewhat
convoluted.

Also changed randint() to be implemented through randrange().  This is
a semantic change because old randint() didn't test its arguments for
validity.  (It also makes randrange() win any contest with randint()
:-)
1998-07-31 13:39:44 +00:00
Guido van Rossum 1a7bab05e8 Don't use raw_input() to ask for the password; this puts the password
in the GNU readline history buffer which is not such a great idea.
1998-07-28 19:28:43 +00:00
Jeremy Hylton ec8c8c2ef2 fix __str__ method of EnvironmentError (base class of IOError): was
using "%d" % errno to print out IOError exceptions -- but urllib.py
raises exceptions where the errno slot in the exception tuple is a
string.
1998-07-28 17:30:06 +00:00
Guido van Rossum 2bc1f8f07e Added getsize(), getmtime(), getatime() 1998-07-24 20:49:26 +00:00
Guido van Rossum 4def7de7c6 Add makedirs(), removedirs(), renames() -- ESR-inspired super-versions
of mkdir(), rmdir() and rename() that make or remove intermediate
directories as well.
1998-07-24 20:48:03 +00:00
Barry Warsaw 2dfe4de614 Added support for including the filename in IOErrors and OSErrors that
involve a filesystem path.  To that end:

- Changed IOError to EnvironmentError and added a hack which checks
  for arg of len 3.  When constructed with a 3-tuple, the third item
  is the filename and this is squirreled away in the `filename'
  attribute.   However, for in-place unpacking backwards
  compatibility, self.args still only gets the first two items.  Added
  a __str__() which prints the filename if it is given.

- IOError now inherits from EnvironmentError

- New class OSError which also inherits from EnvironmentError and is
  used by the posix module.
1998-07-23 16:03:46 +00:00
Guido van Rossum 810a3396d1 Speed up the implementation of quote().
Fix the implementation of quote_plus().  (It wouldn't treat '+' in the
original data right.)

Add urlencode(dict) which is handy to create the data for sending a
POST request with urlopen().
1998-07-22 21:33:23 +00:00
Guido van Rossum 1f00eed8b5 Feature added by Harri Pasanen (at my suggestion): .py suffix on
filename may be omitted.
1998-07-22 13:35:21 +00:00
Guido van Rossum 052969a602 Don't use calculations on values gotten from tell(). Also use a
slightly different way to test for the existence of unread.
1998-07-21 14:24:04 +00:00
Guido van Rossum 136a112bf1 Untabified. 1998-07-20 23:22:51 +00:00
Guido van Rossum f60e8e8108 Update the documentation. Get rid of the section "how it works"
(which is not very relevant when you're in the debugger :-).
1998-07-20 23:21:21 +00:00
Guido van Rossum b5699c7240 Added support for specifying a filename for a breakpoint, roughly
according to an idea by Harri Pasanen (but with different syntax).
This affects the 'break' and 'clear' commands and their help
functions.  Also added a helper method lookupmodule().

Also:

- Try to import readline (important when pdb is used from/as a script).
- Get rid of reference to ancient __privileged__ magic variable.
- Moved all import out of functions to the top.
- When used as a script, check that the script file exists.
1998-07-20 23:13:54 +00:00
Guido van Rossum c612681b20 Fix another bug in ESR's changes. In order to work properly,
onecmd(line) must return the value returned by emptyline() or
default(line).
1998-07-20 21:22:08 +00:00
Guido van Rossum 0aec9fb183 Add missing initializer for self._backupfilename. Due to Ralph Butler. 1998-07-20 15:49:28 +00:00
Guido van Rossum 3a8d1f5a6b Modest speed improvement to escape() by Piet van Oostrum. 1998-07-20 15:46:13 +00:00
Guido van Rossum 7333c4cafc Patch by Piet van Oostrum to avoid calculating with the result of
fp.tell() -- that won't work on Windows.

(A patch for rfc822 is still needed for one case where it finds a bad
header line and wants to back up.)
1998-07-20 15:24:01 +00:00
Guido van Rossum bd9f093fcd Measure performance of sub(), split(), findall(). 1998-07-17 21:10:42 +00:00
Guido van Rossum 0e5ab17ad3 Get a 3- to 4-fold speedup for sub()/subn(), split() and findall() by
not calling self.search(); instead, call self.code.match() directly
and interpret the list of registers it returns directly.  This saves
the overhead of instantiating a MatchObject for each hit, basically
inlining search() as well as group().  When a MatchObject is still
needed, one is allocated and reused for the duration of the scan.
1998-07-17 20:18:49 +00:00
Guido van Rossum c364cf8228 Added tests for findall().
Added test for m.groups() with default.
Added a few prints announcing various tests in verbose mode.
1998-07-17 20:05:02 +00:00
Guido van Rossum 7f1d3aa3d9 Add tests for array self-assigns. (This one has no relevance to JPython.) 1998-07-16 15:31:43 +00:00
Guido van Rossum affd77f71e Add tests for list self-assigns. (Sorry, this should have been here
before JPython 1.0 came out.)
1998-07-16 15:29:06 +00:00
Guido van Rossum 93d1fe1c56 From: Nicolas CHAUVAT <nico@caesium.fr>
In the bbox method of Group (Canvas.py file), you should read

	return self.canvas._getints(self._do('bbox'))

instead of

	return self._getints(self._do('bbox'))
1998-07-16 13:43:05 +00:00
Fred Drake 182c590869 Tk.__init__(): In computing baseName, add ".pyo" to list of dropped
extensions, and include the "." in ".pyc".  Still need to get
	_tkinter.c:Tkapp_New() to use baseName....
1998-07-15 04:36:56 +00:00
Guido van Rossum 69a79bca68 Better RFC 821 compliance (MAIL and RCPT, and CRLF in data)
by Carey Evans <c.evans@clear.net.nz>, for picky mail servers.
1998-07-13 15:18:49 +00:00
Guido van Rossum eeb64287f1 (1) Added a sys.exc_info() emulation. (It returns None for the traceback.)
(2) Made the test script a bit fancier -- you can now use it to run
arbitrary scripts in restricted mode, and it will do the right thing.
(The interactive mode is still pretty lame; should integrate this with
code.interact().)
1998-07-09 13:52:38 +00:00
Guido van Rossum b84ef9bc61 Put back the call to report_unbalanced() that was lost when
parse_endtag() was restructured in parse_endtag() and finish_endtag().
1998-07-07 22:46:11 +00:00
Guido van Rossum 9d865e1a30 Get rid of some obsolete opcodes. 1998-07-07 14:58:39 +00:00
Guido van Rossum 9f2b524385 The permissions ('mode' flag) should default to 0666. 1998-07-03 14:16:55 +00:00
Guido van Rossum 8ba4036a40 The _fromlinepattern was a little too restrictive -- some sendmails
don't put the seconds in the time!
1998-07-02 23:05:32 +00:00
Guido van Rossum 6bbd1d0f0e According to Robin Dunn, at least one FTP server returns 200 instead
of 250 on a successful delete.
1998-07-02 20:41:20 +00:00
Guido van Rossum 030eb11823 Gotta have an __init__() method -- pdb.py calls it! 1998-07-01 22:53:04 +00:00
Barry Warsaw bfa3f6b673 Several changes:
1. Convert to using re module

2. Added two new exception classes

    a. MissingSectionHeaderError which signals an early parsing
       exception when options appear in the file before any section
       header.  Previously a bogus TypeError was thrown deeper down.

    b. ParsingError which collates any non-fatal parsing errors.
       ConfigParser.read() will raise this after the entire file was
       parsed if any errors occurred during parsing (client could just
       catch the exception and continue, because the ConfigParser
       instance would still be initialized with the valid data).

   (small note: Error.__msg => Error._msg)

3. ConfigParser.__read() now uses re which has the following minor
   semantic change: underscore is now allowed in section header and
   option name.  Also, because of the old regexps, theoretically.
   Fixed continuation line bug reported by F. Lundh.

4. It seemed that the old ConfigParser automatically added the option
   `name' to every section, which contained the name of the section.
   This seemed bogus to me so I took it out.
1998-07-01 20:41:12 +00:00
Guido van Rossum 7011504e27 Improved test set for int() and long() string conversions. 1998-06-30 17:02:20 +00:00
Guido van Rossum bf0db032cd Add pop method. 1998-06-30 15:40:05 +00:00
Guido van Rossum 0f91183b1a Fix the comments describing the return values of the head(), body(),
article() commands.
1998-06-30 14:50:26 +00:00
Guido van Rossum 8b3282be9f For completeness, add a dummy load_package() method to RHooks. It
should never be called, so this isn't really needed, but this
signifies that rexec now supports packages -- because ihooks does.
1998-06-29 20:32:57 +00:00
Guido van Rossum 9f5c36fddb Support loading of packages. (I had this coded up for a while but
didn't want to commit until it had been tested.  I presume that it
works in Grail.)
1998-06-29 20:31:16 +00:00
Guido van Rossum be0b62cab4 Added findall() to RegexObject -- return a list of all matches in a
string.  Added groupdict() to MatchObject -- return the named groups
as a dict.  Added default argument to groups() to specify what to
return for unmatching groups; groupdict() also has this.
1998-06-29 20:29:08 +00:00
Guido van Rossum 80884075f0 Improved by Eric Raymond. 1998-06-29 17:58:55 +00:00
Guido van Rossum 716b78474c # Make tabnanny happy. 1998-06-29 17:58:43 +00:00
Guido van Rossum 3ad9dd559a Improved by Eric Raymond. 1998-06-29 17:56:06 +00:00
Guido van Rossum c94f16f156 Oops! Of course, Tim is right -- when the item is not a hex number,
the '%' should be put back in.
1998-06-29 00:42:54 +00:00
Guido van Rossum 52e86ad05b Speed-up unquote(), inspired by post from Daniel Walton. 1998-06-28 23:49:35 +00:00
Guido van Rossum 1cd4d52f2f Remove RCS and #! cruft at top. 1998-06-26 13:38:38 +00:00
Guido van Rossum 88b63b8d30 Allow binding a Tcl command (given as a string) as well as a Python
function.
1998-06-25 18:54:49 +00:00
Guido van Rossum 01852838f3 Treat "HEAD" same as "GET", so that CGI scripts won't fail. 1998-06-25 02:40:17 +00:00
Guido van Rossum 2349015a87 Rewrite the (test) main program so that when used as a script, it can
retrieve one or more URLs to stdout.  Use -t to run the self-test.
1998-06-25 02:39:00 +00:00
Guido van Rossum b1f0812be7 Piers' latest version, labeled 2.11. This time he integrated my
changes, and made only a few minor changes.  No changes of my own this
time.
1998-06-25 02:22:16 +00:00
Guido van Rossum 95e6f7089a Eric Raymond added support for ESMTP protocol and corrected some typos
in comments and doc strings.
1998-06-25 02:15:50 +00:00
Guido van Rossum a93b848e33 Subsume the interact() function in a class. This should make it
possible to use this in PythonWin, and to replace Fredrik Lundh's
PythonInterpreter class.  Fredrik is credited with the class' API.
1998-06-23 19:31:19 +00:00
Guido van Rossum d9d2625dbd "if match(x) >= 0:" smells of regex matching; should use "if match(x):" 1998-06-23 14:43:06 +00:00
Guido van Rossum 4d40b0a165 Patch by Eric Raymond: add an optional 'seekable' flag to the
MultiFile constructor, and only do the posstack bookkeeping when it is
true.
1998-06-23 14:20:27 +00:00
Guido van Rossum 5430b432e6 Bugfix to ESR's code reported by himself: should use hasattr() to test
for presence unread, not getattr()!
1998-06-22 15:46:26 +00:00
Guido van Rossum cef4c844df Turns out that 'winfo id' returns the id as a hex string, with 0x prefix.
The int() function (aliased to getint()) doesn't handle that, so we must
use self.tk.getint() again...
1998-06-19 04:35:45 +00:00
Guido van Rossum 268824e089 Different trick to get the _test() window to pop up. 1998-06-19 04:34:19 +00:00
Guido van Rossum eda960a1dd Piers' latest version -- authentication added by Donn Cave. 1998-06-18 14:24:28 +00:00
Guido van Rossum e50b0a44cb In class _Subfile, make sure read(n) can't read beyond EOF. Also
allow negative numbers to specify read until EOF (like for a regular
file's read() method).
1998-06-17 18:34:40 +00:00
Guido van Rossum 81d10b479e Add __getitem__ to AddressList object, to make it a sequence. 1998-06-16 22:29:03 +00:00
Guido van Rossum 4d4ab9245f Some extra comments and docstrings, and a new class (AddressList), all by ESR. 1998-06-16 22:27:09 +00:00
Guido van Rossum 32490824b6 Fixed the UDP server -- this never worked. Ray Loyzaga deserves
credit for complaining about this and for testing these changes.
1998-06-16 02:27:33 +00:00
Guido van Rossum d458faadc3 In completer(), return None instead of raising an IndexError when
there are no more completions left.  (This for compatibility with
Donald Beaudry's code.)
1998-06-12 19:42:14 +00:00
Guido van Rossum c3da02e904 Don't catch interrupts in getpass() -- the finally clause will reset
the tty and the caller can deal with the interrupt.

In the windows version, recognize ^C and raise KeyboardInterrupt (not
sure if this is needed, but can't hurt).
1998-06-12 14:28:38 +00:00
Guido van Rossum ae9ee7329d Use the getpass module instead of having platform-specific echo on/off
code here.
1998-06-12 14:21:13 +00:00
Guido van Rossum 69256612d7 With the recent change that makes numbers compare smaller than anything,
the outcome of the test for max has changed.
1998-06-11 22:25:59 +00:00
Guido van Rossum 08636f08ed Now that test_MimeWriter is untabified, do the same here! 1998-06-11 22:22:39 +00:00
Guido van Rossum cff311aa37 Be more careful than the previous patch. The default content-type
should only be set to application/x-www-form-urlencoded when the
method is POST.  E.g. for PUT, an empty default (defaulting to
text/plain later) makes more sense.
1998-06-11 14:06:59 +00:00
Guido van Rossum e894fc0ea3 Support new overridable method, isheader() (ESR).
Also implement __setitem__(), more-or-less correctly (GvR).
1998-06-11 13:58:40 +00:00
Guido van Rossum c7bb8577c7 Some changes suggested/provided by Eric Raymond:
- explain seekable
- when seekable==1, test fp.tell() and set it to 0 if that fails
- support overridable method iscomment(line) to weed out comments
- check for unread() method on file object before trying to seek

And one of my own:

- Add a get() method which behaves like a dictionary's get(); this is
actually implemented by giving getheader() an optional second argument
to specify the default, and aliasing get to getheader.
1998-06-10 21:31:01 +00:00
Guido van Rossum 1f40cd6314 Add the __doc__ string from the original module on copy_none(). 1998-06-09 21:33:44 +00:00
Guido van Rossum dd47ec98e2 Default content-type to application/x-www-form-urlencoded at the top
level of a form.  This means that browsers that omit the content-type
header when sending a POST command aren't penalized so heavily.
1998-06-09 19:49:16 +00:00
Guido van Rossum e614fb12a0 Changed runs of 8 spaces to tab -- to satisfy the tab nanny. 1998-06-09 19:20:12 +00:00
Guido van Rossum 068ad97330 Untabified -- to satisfy the tab nanny. 1998-06-09 19:19:40 +00:00
Guido van Rossum 5a43e1a90c Get rid of tabnanny's last complaints. 1998-06-09 19:04:26 +00:00
Guido van Rossum aa2a7a4ae6 From: "Tim Peters" <tim_one@msn.com>
The 1.5.1 tabnanny.py suffers an assert error if fed a script whose last
line is both indented and lacks a newline:

if 1:
    print 'oh fudge' # no newline here:

The attached version repairs that.
1998-06-09 19:02:21 +00:00
Guido van Rossum fe02efdbf4 getint() now raises ValueError, not TclError, on errors. 1998-06-09 02:37:45 +00:00
Guido van Rossum 3c46234e5e Remove Emacs and #! cruft. 1998-05-29 18:22:53 +00:00
Guido van Rossum d659693b5b Improve the self-test code a bit: read a host from sys.argv[1] if set,
and list the host name when prompting for the password.
1998-05-29 18:08:48 +00:00
Guido van Rossum cc20b76ad0 Add comments explaining thread unsafety of this code. 1998-05-29 17:51:59 +00:00
Guido van Rossum d03e1197cb Make gauss() semi-thread-safe. It can still give duplicate results,
but it can no longer raise an exception when called by several threads
simultaneously.
1998-05-29 17:51:31 +00:00
Guido van Rossum b39e461b89 Two places where _time() should be used said time.time(), which
doesn't work of course.
1998-05-29 17:47:10 +00:00
Guido van Rossum 6884af706b Piers Lauders' latest version, with some of my own changes reapplied.
Also replaced random()*32000 with randint(0, 31999).
1998-05-29 13:34:03 +00:00
Guido van Rossum 1ad00717fb Patch by Lars Marius Garshol:
- Handle <? processing instructions >.

- Allow . and - in entity names.

Also fixed an oversight in the previous fix (in one place, [ \t\r\n]
was used instead of string.whitespace).
1998-05-28 22:48:53 +00:00
Jeremy Hylton 2b9d029308 add handler for JPython's org.python.core.PyStringMap object, which
walks and quacks like a dictionary.
1998-05-27 22:38:22 +00:00
Guido van Rossum 16653cb273 Add Tim's worst case scenario.
Revert to using whrandom so it will work with older versions of Python.
1998-05-26 15:05:12 +00:00
Guido van Rossum 7462942b69 Added some tests to make sure that long->int conversions near
sys.maxint and near -sys.maxint-1 work correctly.
1998-05-26 14:51:55 +00:00
Fred Drake 5b34ec1b14 Fixed spelling in comment: "RFC", not "RFX". 1998-05-22 18:18:08 +00:00
Guido van Rossum e9387ea773 introduce a new platform-specific variable: os.linesep is the
platform's line separator.  \n on Unix, \r\n on DOS, OS/2 and Windows,
\r on Macs.
1998-05-22 15:26:04 +00:00
Guido van Rossum 26fd98201f Change the last 4-space indent into a 1-tab indent. 1998-05-22 15:05:36 +00:00
Guido van Rossum 7ef2a1de9b Shouldn't use newdir.dir(), which no longer exists! 1998-05-22 14:11:57 +00:00
Fred Drake c9132066e7 knownfiles: Add the default installation dirs for Apache
versions <= 1.2, >= 1.3.
1998-05-21 13:15:45 +00:00
Guido van Rossum b26a1b4e2b Use random instead of whrandom. 1998-05-20 17:05:52 +00:00
Guido van Rossum 33d7f1a76c Add Interfaces to replace remaining needs for importing whrandom.
# XXX TO DO: make the distribution functions below into methods.
1998-05-20 16:28:24 +00:00
Guido van Rossum 0bd5433cf8 Get rid of nearly all clals to self._do -- turns out self.tk.call can
be used just as well, so this saves one Python call in many cases!
1998-05-19 21:18:13 +00:00
Fred Drake 4941341858 guess_extension(): Revise documentation string to be more clear. If not
inited, call init().
1998-05-19 15:15:59 +00:00
Guido van Rossum 5f4fb913a2 Test that "import sys.imp" fails as it should. 1998-05-19 15:09:42 +00:00
Fred Drake 5109ffd607 guess_extension(): New function. Performs a reverse mapping from MIME type
to filename extension.
1998-05-18 16:27:20 +00:00
Guido van Rossum 67133e25a2 Neatify the _timezones table and remove a misleading comment about
inaccuracies in mktime_tz().
1998-05-18 16:09:10 +00:00
Fred Drake 3130b7a2a9 Fixed typo in docstring: suffixes_map --> suffix_map. 1998-05-18 16:05:24 +00:00
Guido van Rossum 4658682205 Subject: bug fixes for imaplib.py
From: Piers Lauder <piers@staff.cs.usyd.edu.au>
To: Python List <python-list@cwi.nl>
Date: Mon, 18 May 1998 09:51:53 +1000

Following is a context diff for imaplib.py in the Python1.5.1 distribution.
It fixes 2 bugs. One to do with argument quoting, and the other to do with
caching of un-tagged responses. Apologies for its size.
1998-05-18 14:39:42 +00:00
Guido van Rossum 7beaad4e75 Add file extension .xml, mapping it to text/xml. 1998-05-18 14:25:08 +00:00
Jeremy Hylton ee918cb487 Fix bug reported by Harri Pasanen: gzip + cPickle doesn't work. The
problem was a couple of bugs in the readline implementation.

1. Include the '\n' in the string returned by readline
2. Bug calculating new buffer size in _unread

Also remove unncessary import of StringIO
1998-05-13 21:49:58 +00:00
Guido van Rossum 01fc65d92f From: conrad@cgl.ucsf.edu (Conrad Huang %CGL)
To: python-list@cwi.nl
Date: 13 May 98 18:33:11 GMT

I think I found a bug in CGIHTTPServer.py.  (Does anyone care? :-)
I was trying to use it as the web server for uploading files.
Python CGI scripts (using the CGI module) that worked for other
servers (e.g., Netscape Enterprise server) hang when run from
CGIHTTPServer.  The problem is that the content type parameters,
in particular the boundary parameter, were not passed through to
the CGI scripts, thus making the MIME parsing code choke.

My simple-minded fix is:

	% diff CGIHTTPServer.py /usr/local/lib/python1.5/CGIHTTPServer.py
	137,140c136
	<           if self.headers.typeheader is None:
	<               env['CONTENT_TYPE'] = self.headers.type
	<           else:
	<               env['CONTENT_TYPE'] = self.headers.typeheader
	---
	>           env['CONTENT_TYPE'] = self.headers.type

Conrad
1998-05-13 20:13:24 +00:00
Guido van Rossum b298a300dd Reduce memory requirements. 1998-05-12 13:21:31 +00:00
Guido van Rossum 03e35c548f Add a few doc strings. 1998-05-10 18:27:29 +00:00
Guido van Rossum ea176b663e benchmark for list.sort() 1998-05-10 18:20:05 +00:00
Guido van Rossum b1b4f94527 Make Tim O'Malley's requested change: in FieldStorage.__init__(), when
method='GET', always get the query string from environ['QUERY_STRING']
or sys.argv[1] -- ignore an explicitly passed in fp.
1998-05-08 19:55:51 +00:00
Fred Drake 073b829021 When a file name is selected ("OK" button, <Return> in the filename entry),
and the "key" keyword parameter was used to invoke .go(), use the directory
of the selected file as the stored directory to return to when the same key
is used again.  This is useful since the user may well entry at least part
of the path in the filename box instead of doing a lot of clicking around in
the listboxes.
1998-05-06 17:28:23 +00:00
Guido van Rossum e7b6e396fc New files from Thomas Gellekum 1998-05-06 15:14:36 +00:00
Guido van Rossum d618c91f14 Added table of WSA error codes. 1998-05-06 13:48:04 +00:00
Guido van Rossum e0c0da98d8 Patches to make the proxy code work again. (Why does that always break
as soon as I change things even just a little bit? :-)  Even works
when accessing a password-protected page through the proxy.  Prompted
by complaints from, and correct operation verified by, Nigel O'Brian.
1998-05-05 13:58:13 +00:00
Guido van Rossum a986bb7e5c Take out the check for AUTH-LOGIN or AUTH=LOGIN in login() -- some
servers support LOGIN but don't advertise it.  If it's not supported
the protocol will respond NO.  Approved by Piers Lauder.
1998-05-05 03:08:46 +00:00
Guido van Rossum b485224d82 REMOVE samefile(), sameopenfile(), samestat() -- these cannot be made
to work reliably (at least I wouldn't know how).
1998-05-02 00:47:09 +00:00
Guido van Rossum e365a590d4 Change the names of all methods in the Wm class: they are now
wm_title(), etc.  The old names (title() etc.) are still defined as
aliases.

This brings all methods up to use the same naming convention: whether
the Tcl syntax is

   .window.path.name command subcommand [options]

or

   command subcommand .window.path.name [optins]

the Python equivalent is always

   windowobject.command_subcommand(options)
1998-05-01 19:48:20 +00:00
Guido van Rossum 0132f69c2e Another optimization, probably of negligeable effect: instead of
calling self.tk.getint() and self.tk.getdouble(), call the globals
getint() and getdouble(), which in turn are just names for the Python
builtins int() and double().  (Making them globals actually save a
dict lookup compared to using the built-in.)  The corresponding
methods of class Misc have been changed similarly.  (Note that
getboolean() hasn't been changed because there's no Python
equivalent.)

The use of int() and float() has another advantage: if/when Tcl calls
can actually return Tcl objects with other types than string, use of
int() and float() is essential.
1998-04-30 17:50:36 +00:00
Guido van Rossum dc59340646 In _bind(), found a way to test for break without a temp variable. 1998-04-29 22:16:57 +00:00
Guido van Rossum f975699c07 Save a tiny bit of time: self.tk.call takes a tuple argument so it's
not needed to say apply(self.tk.call, t); self.tk.call(t) has the same
effect.  This cuts down tremendously on the number of apply() calls
made.  No measurable effect, but at the very least it saves the lookup
of apply() in the globals!
1998-04-29 21:57:08 +00:00
Guido van Rossum f0c891a2b2 Import MacOS at the top instead of insize Tk.__init__() -- the latter
repeats the I/O for the failed import on each interpreter creation.
1998-04-29 21:43:36 +00:00
Guido van Rossum 7e6d18c1c0 Replace all calls to acquire_lock() and release_lock() with acquire()
and release() instead.
1998-04-29 14:29:32 +00:00
Guido van Rossum 57a0661cb8 On the Mac, create the Temporary Items folder if it does not exist yet.
(Jack)
1998-04-28 16:03:34 +00:00
Guido van Rossum 9c93a69335 Put quotes around the filename, so spaces in filenames work.
(Jack)
1998-04-28 16:03:03 +00:00
Guido van Rossum 53117ae82a typo in error message (fname vs. file).
(Jack)
1998-04-28 16:01:13 +00:00
Guido van Rossum b86ba124ea Support byte-swapped dbhash (bsddb) files. Found by Ben Sayer. 1998-04-28 15:41:03 +00:00
Guido van Rossum fc1f64d90d Oops, I had 'n' and 'c' mixed up in my mind. Get rid of the comment
that wonders what the difference is and explain them properly.
1998-04-28 15:23:09 +00:00
Guido van Rossum a5c0998242 Inspired by Ben Sayer, rewritten the code and some of the comments to
be more intelligent when the database already exists (use the module
for the existing file, according to whichdb).  Noted in the doc
strings that there doesn't seem to be a different between 'c' and 'n'.
1998-04-28 15:19:34 +00:00
Guido van Rossum e86271af72 When setting the event structure fields, don't die when the widget
name is not registered; simply use the string.  This happens for
tear-off widgets (e.g. if you've registered enter/leave events for the
menu).
1998-04-27 19:32:59 +00:00
Guido van Rossum 0eae8fba81 Feeble attempt at making urlopen more robust -- don't call splituser()
when splithost() returned no useable host, to avoid calling
splituser() on None.
1998-04-27 15:19:17 +00:00
Fred Drake 9291d271fb parse150(): Simplify RE used to parse the message a little, taking advantage
of using re instead of regex.
1998-04-27 14:39:44 +00:00
Guido van Rossum 446898ff4a Use hex() when outputting the various checksums so the test output is the
same on 32 and 64 bit machines.
1998-04-24 18:31:28 +00:00
Guido van Rossum bb189dbcb0 Small corrections to comments that were cloned from aifc; moreover
the description of setparams() was wrong.

wave.py: Include the tag of an unknown format in the exception.
1998-04-23 21:40:02 +00:00
Guido van Rossum 1740b8d2f7 New test sample -- "Nobody expects the Spanish Inquisition!" 1998-04-23 21:37:22 +00:00
Guido van Rossum e26132cf5e Move unified findfile() into test_support.py 1998-04-23 20:13:30 +00:00
Guido van Rossum 5fd90684a9 Run the self-test (test.test_MimeWriter) when invoked as a script. 1998-04-23 13:34:57 +00:00
Guido van Rossum 2ad816f47e Add test for MimeWriter module 1998-04-23 13:33:56 +00:00
Guido van Rossum e87ed5f6d4 Add writelines() method to Compare class. 1998-04-23 13:33:21 +00:00
Guido van Rossum 9a34523e19 As Tim Peters points out, ``from string import *'' should not set re to None.
Also rename safe_env to _safe_env.
1998-04-20 14:01:00 +00:00
Fred Drake de2f708299 Fix regexp for attrfind; bug reported by Lars Marius Garshol
<larsga@ifi.uio.no>.
1998-04-16 21:04:26 +00:00
Fred Drake ac36c6403f Open wave files in binary mode.
Accept 'rb' and 'wb' as well as 'r' and 'w' as the mode parameter to open().
1998-04-16 16:44:33 +00:00
Guido van Rossum 64d036c8fe Add connect_ex to list of methods. 1998-04-14 01:30:45 +00:00
Guido van Rossum fb9b7fd5ee Be nicer to systems that have neither termios nor msvcrt. 1998-04-13 20:22:21 +00:00
Guido van Rossum b19e2a383c Whoops! Add a missing 'instantiated = 1' to load_inst(); otherwise it
would still try to call the class...
1998-04-13 18:08:45 +00:00
Guido van Rossum be14e69742 New revision -- sometimes it's AUTH-LOGIN, sometimes AUTH=LOGIN! 1998-04-11 03:11:51 +00:00
Guido van Rossum 5c7e8cd267 Avoid using the obsolete rand module; and improve the randomness
of the boundary chosen by choose_boudary() by using milliseconds
of the timestamp.
1998-04-11 03:06:02 +00:00
Guido van Rossum 38d8f4e1c2 New version doesn't require REV1 capability. 1998-04-11 01:22:34 +00:00
Guido van Rossum c74521acc4 Oops -- remove some debug print statements! 1998-04-11 01:18:35 +00:00
Guido van Rossum c296651e10 Add image_types() and image_names() as methods to Misc class. 1998-04-10 19:16:10 +00:00
Guido van Rossum ce73acf5e6 Tim's version 4, with my mods 1998-04-10 19:14:59 +00:00
Guido van Rossum 4cee3c49c2 Another easter present. 1998-04-10 16:14:34 +00:00
Guido van Rossum 7f5013a9a9 New Java-style threading module. The doc strings are in a separate module. 1998-04-09 22:01:42 +00:00
Guido van Rossum bb08066053 The usual 1998-04-09 21:47:39 +00:00
Guido van Rossum b5903ac9fb Another new utility: getpass() prompts for a password, with echo off.
Also contains getuser(), which returns the username (not prompting though).
These work on Unix and Windows!
1998-04-09 20:37:16 +00:00
Guido van Rossum 29e5f5d81f When getcwd() doesn't exist or raises an exception, don't fail but
fall back to using os.curdir instead; if it is fine, don't use
os.curdir at all.
1998-04-09 14:27:57 +00:00
Guido van Rossum c09e6b1c0a Clarify that put *blocks* when the queue is full. Add some blank
lines to doc strings.
1998-04-09 14:25:32 +00:00
Guido van Rossum eeec0af307 Piers' new version (but I unfolded a few doc strings). 1998-04-09 14:20:31 +00:00
Guido van Rossum c2c07fa10c Piers Lauder's IMAP module. 1998-04-09 13:51:46 +00:00
Guido van Rossum 03774bb5ea Version with docstrings and some other changes, by Piers Lauder.
(Adapted by Just, I believe.)
1998-04-09 13:50:55 +00:00
Fred Drake 3217be9395 Relocating file to Lib/lib-old. 1998-04-09 04:05:43 +00:00
Fred Drake 153165ca3d Restore ni as an obsolete module. 1998-04-09 04:04:18 +00:00
Guido van Rossum 484772d472 Dave Ascher's pop client code. 1998-04-06 18:27:27 +00:00
Guido van Rossum 8053d89f7b Add usage message when no arguments. 1998-04-06 14:45:26 +00:00
Guido van Rossum f4b44fa6ef Tim's latest version (supports old and new tokenize modules) 1998-04-06 14:41:20 +00:00
Guido van Rossum 986abac1ba Give in to tabnanny 1998-04-06 14:29:28 +00:00
Guido van Rossum 1ae297ae8b Remove some long obsolete files... 1998-04-06 14:16:12 +00:00
Guido van Rossum f62cf61548 Give in to tabnanny. 1998-04-06 14:14:25 +00:00
Guido van Rossum 5810297052 Correction to vonmisesvariate() by Magnus Kessler: it should take and
return something between 0 and 2*pi.  Also added a reference to the
literature.
1998-04-06 14:12:13 +00:00
Guido van Rossum 56c04b8376 Restructured the event_* calls slightly -- there's really no need to
use the default root, and instead of string.split, use splitlist.
1998-04-06 03:10:03 +00:00
Fred Drake bdc61b1c7b Relocating file to Lib/lib-old. 1998-04-04 01:05:17 +00:00
Fred Drake a351f89a94 Relocating file to Lib/lib-old. 1998-04-04 00:54:56 +00:00
Guido van Rossum 8430c583da AMK's latest 1998-04-03 21:47:12 +00:00
Guido van Rossum a50547e0c0 Track changes in tokenize.py 1998-04-03 19:56:40 +00:00
Guido van Rossum 18586f4c48 Add optional argument to help(). 1998-04-03 17:03:13 +00:00
Guido van Rossum 1d5102cac1 Explicitly close rfile and wfile in StreamRequestHandler.finish() --
mostly for jpython.
1998-04-03 16:49:52 +00:00
Guido van Rossum a90c78b918 Differentiate between NEWLINE token (an official newline) and NL token
(a newline that the grammar ignores).
1998-04-03 16:05:38 +00:00
Guido van Rossum fbe63de37d UnixMailbox: don't be fooled by lines that begin with "From " but
otherwise don't look like headers at all...
Also robustify the test code a bit.
1998-04-03 16:04:05 +00:00
Guido van Rossum 7e07b3845b Sjoerd's latest. 1998-04-03 16:02:39 +00:00
Guido van Rossum 0454b51282 Oops, pulled over by the tab police :-) 1998-04-03 15:57:58 +00:00
Guido van Rossum b5916ab065 Change by Sjoerd (with minor reformatting):
guess the mime type of a local file.

Change suggested by Sjoerd (with different implementation):
  when retrieve() creates a temporary file, preserve the suffix.

Corrollary of the first change:
  also return the mime type of a local file in retrieve().
1998-04-03 15:56:16 +00:00
Guido van Rossum 75d92c1864 Added a __delitem__ to the Message class.
(Still no __setitem__, until I get a request to add it!)
1998-04-02 21:33:20 +00:00
Guido van Rossum b1062fc9d2 Correct dumb typo found by kjpylint (stack should be self.stack). 1998-03-31 17:00:46 +00:00
Guido van Rossum 599174f74d Correct a definite typo ('mem' should be 'memo'). 1998-03-31 16:30:28 +00:00
Guido van Rossum 9ab75cbaab Tim Peters' program for checking whether a program's indentation is
sensitive to tab size.  Uses a different strategy than tabpolice.py,
but has compatible usage.
1998-03-31 14:31:39 +00:00
Guido van Rossum a6bb6be95f Strip argument to atol and atof to match what strop does better. 1998-03-30 17:22:30 +00:00
Guido van Rossum a08fabad72 A few lines were indented using spaces instead of tabs -- fix them. 1998-03-30 17:17:24 +00:00
Guido van Rossum 117a5a8138 Return the name of the Tcl command defined by _bind(). This can
optionally be passed to unbind() (or you can apss it to
deletecommand()).
1998-03-27 21:26:51 +00:00
Guido van Rossum 548703a1b8 The usual. 1998-03-26 22:14:20 +00:00
Guido van Rossum 65e5399081 Don't write "if self.dict: self.dict.close()"; just write
"self.dict.close()" and ignore the exception.  The "if self.dict:"
part would be calculated through len(self.dict.keys()), which is very
expensive for a large dictionary...
1998-03-26 22:12:22 +00:00
Guido van Rossum 3ec38f0ee4 A few lines were indented using tabs instead of spaces -- fix them. 1998-03-26 22:10:50 +00:00
Guido van Rossum 45e2fbc2e7 Mass check-in after untabifying all files that need it. 1998-03-26 21:13:24 +00:00
Guido van Rossum 9ea7024754 Delete this unused relic. 1998-03-26 21:07:14 +00:00
Guido van Rossum 7e7ca0ba17 A few lines were indented using spaces instead of tabs -- fix them. 1998-03-26 21:01:39 +00:00
Guido van Rossum 8ca842066c A few lines were indented using spaces instead of tabs -- fix them. 1998-03-26 20:56:10 +00:00
Guido van Rossum fa6e254b34 Mass check-in after untabifying all files that need it. 1998-03-26 20:23:01 +00:00
Guido van Rossum 1847d06493 Reindented with tabs only (seems fair to the Windows crowd). 1998-03-26 20:22:30 +00:00
Guido van Rossum 2830dcc15c Get rid of the Emacs cruft now that Python-mode guess the desired settings! 1998-03-26 19:52:46 +00:00
Guido van Rossum 41360a4696 Mass check-in after untabifying all files that need it. 1998-03-26 19:42:58 +00:00
Guido van Rossum cd0f59ea08 Get rid of the Emacs cruft now that Python-mode guess the desired settings! 1998-03-26 19:30:30 +00:00
Guido van Rossum 69c70a2fd1 Support 'whence' parameter to seek(). 1998-03-25 16:25:26 +00:00
Guido van Rossum c8d36284f3 Give in to Timmy's Tedious Tab Theorem. 1998-03-23 15:31:22 +00:00
Guido van Rossum c457048744 Give in to the tab police. 1998-03-20 20:45:49 +00:00
Guido van Rossum 677bedab0c Fix indent of one line in mkarg(), that got indented badly by the
recent reindent!
1998-03-19 15:14:24 +00:00
Guido van Rossum 3f0666c4a2 Add obvious needed else clause to format_exception(). 1998-03-18 17:48:06 +00:00
Guido van Rossum 96c07fefa9 Prefer clock() over times() for timer function, except on the Mac,
where we use GetTicks() -- its clock() is a crock, with only 1 second
accuracy, I believe.
1998-03-17 14:46:43 +00:00
Guido van Rossum 677fc843ea As Mike Fletcher pointed out, a __deepcopy__() method should be called
with the memo as an argument.
1998-03-13 20:12:17 +00:00
Guido van Rossum 6d4d1c2a25 Added support for "data" URL, by Sjoerd Mullender. 1998-03-12 14:32:55 +00:00
Guido van Rossum 5c1d2297ea Instead of 'import mac', use 'import os' -- this way, the path syntax
manipulation routines can be used on non-Mac platforms (e.g. to
manipulate pathnames in a Mac specific archive).
1998-03-03 21:49:01 +00:00
Guido van Rossum 9e43adbe78 Initialize adlist variable in getrouteaddr(), so an illegal address
doesn't cause a traceback.
1998-03-03 16:17:52 +00:00
Guido van Rossum d8c5b8c90f Typo (coestring -> codestring) discovered by Mark Hammond. 1998-03-02 02:40:39 +00:00
Guido van Rossum 13452644d5 Sjoerd writes: When a multipart message is incomplete, mimify crashes. 1998-02-27 14:40:38 +00:00
Guido van Rossum 6e73af723c New version of tb_lineno(), this time *not* using try-except, to avoid
disturbing the current exception, and returning tb.tb_lineno, which is
the line number of thr traceback, rather than the current line number.
By Jim Hugunin.
1998-02-26 17:25:02 +00:00
Guido van Rossum 46c86bbca9 A working version of the 'args' command (it prints the current values
of the variables known to hold arguments, but that's as close as I can
get, and generally it's close enough).
1998-02-25 20:50:32 +00:00
Guido van Rossum d151d34ebd Add test for core dump -- make sure it doesn't come back! 1998-02-25 17:51:50 +00:00
Guido van Rossum 7266496b00 Tweak the tb_lineno() function to be compatible with JPython, which
has no line number table etc.
1998-02-25 16:33:39 +00:00
Guido van Rossum 21df8f5dc4 Typo: baseWidht -> baseWidth. 1998-02-24 23:26:18 +00:00
Guido van Rossum 0001a11986 Fix bug in trace_vdelete(); should use master's delete command. 1998-02-19 21:20:30 +00:00
Guido van Rossum 2fc4d581ba Added debug statements to report data actually sent and received on
the socket.
1998-02-19 21:19:48 +00:00
Guido van Rossum b1908846af Fix for literal null bytes -- these must be replaced by the four
characters \, 0, 0, 0.
1998-02-19 21:18:56 +00:00
Guido van Rossum 72c2e1b56e Fixed a bug in the gauss() function. The bug was reported by Mike
Miller, who complained that its kurtosis was bad, and then fixed by
Lambert Meertens (author of the original algorithm) who discovered
that the mathematical analysis leading to his solution was wrong, and
provided a corrected version.  Mike then tested the fix and reported
that the kurtosis was now good.
1998-02-19 21:17:42 +00:00
Guido van Rossum 9824509d3e Add rmd() (remove directory command); fix comment in parse257.
In login(), force passwd and acct to '' when they are None (this can
happen in the test program!).
1998-02-19 21:15:44 +00:00
Guido van Rossum 0d530cedd7 Faster implementation of normcase (using string.lower(
string.replace(...)) instead of a for loop).

Don't call normcase() in normpath() -- the filesystem just might be
case preserving...
1998-02-19 21:08:36 +00:00
Guido van Rossum a73033fcc2 Feature added by Bill van Melle: when no timezone is present, assume
local time -- that's better than failure.
1998-02-19 00:28:58 +00:00
Guido van Rossum 16a0bc278e (1) Change normpath() to *not* also call normcase().
(2) Fix normcase() to use string.lower() and string.replace() -- it
turns out that the table constructed for translate() didn't work in
locales that have a different number of lowercase and uppercase
letters.
1998-02-18 13:48:31 +00:00
Guido van Rossum 00455b77a6 Fix sign reversal in mktime_tz discovered by Bill van Melle. 1998-02-18 05:06:30 +00:00
Guido van Rossum 358473c1a2 Andrew Kuchling writes:
First, the RNG in whrandom.py sucks if you let it seed itself from the time.
The problem is the line:
			t = int((t&0xffffff) | (t>>24))
Since it ORs the two parts together, the resulting value has mostly
ON bits.  Change | to ^, and you don't lose any randomness.
1998-02-16 14:52:42 +00:00
Guido van Rossum e60142f2c1 Adding output of test_xmllib.py 1998-02-13 16:35:21 +00:00
Fred Drake fe82acc3b1 Fixed typo in docstring: "__ version__" --> "__version__" 1998-02-13 03:24:48 +00:00
Guido van Rossum 8a666e7c56 Fix a horrible race condition -- various routines were storing the
most recently opened URL in self.openedurl of the URLopener instance.
This doesn't really work if multiple threads share the same opener
instance!

Fix: openedurl was actually simply the type prefix (e.g. "http:")
followed by the rest of the URL; since the rest of the URL is
available and the type is effectively determined by where you are in
the code, I can reconstruct the full URL easily, e.g. "http:" + url.
1998-02-13 01:39:16 +00:00
Guido van Rossum d76732918a Added rmtree(), to recursively remove a directory tree.
Code by David Ascher (docstring by me).
1998-02-06 21:38:09 +00:00
Guido van Rossum 03710d2a40 Two suggested features by Sjoerd:
- use the tempcache in the open() method, too.

- use the "unwrap"ped url as key for the tempcache.
1998-02-05 16:22:27 +00:00
Guido van Rossum c5d8fed261 (1) Use matchobj.groups(), not matchbj.group() to get all groups.
(2) Provisional hack to avoid dying when trying to turn echo on or off
on Macs, where os.system() doesn't exist.
1998-02-05 16:21:28 +00:00
Guido van Rossum c9aef03af4 Make this test work when imported from the interpreter instead of run
from regrtest.py (it still works there too, of course).
1998-01-29 21:53:17 +00:00
Guido van Rossum fc40a8316a Sez The Dragon:
Ok, I fixed the quotes, along with a bug or two.
	Also added another exception.
1998-01-29 17:26:45 +00:00
Guido van Rossum bbe323e52c SMTP client by The Dragon De Monsyne <dragondm@integral.org>. 1998-01-29 17:24:40 +00:00
Guido van Rossum 02505e4850 New version of xmllib from Sjoerd.
The main incompatibility is that the error reporting method is now
called as
 parser.syntax_error(msg)
instead of
 parser.syntax_error(lineno, msg)

This new version also has some code to deal with the <?xml?> and
<!DOCTYPE> tags at the start of an XML document.
The documentation has been updated, and a small test module has been
created.
1998-01-29 14:55:24 +00:00
Guido van Rossum b16a3b8450 (This fix is really by Jeremy)
Here's my suggested replacement for gzip.py for 1.5.1.  I've
re-implemeted methods readline and readlines, added an _unread, and
tweaked read and _read.

I tried a more complicated buffer scheme for unread (using a list of
strings and string.join), but it was more complicated and slower.
This version is a lot faster than the current version and is still
pretty simple.
1998-01-27 19:29:45 +00:00
Barry Warsaw abe2a457de Unpickler.load_inst(), Unpickler.load_obj(), Unpickler.load_build():
Fixed problems when unpickling in restricted execution environments.
These methods try to assign to an instance's __class__ attribute, or
access the instances __dict__, which are prohibited in REE.  For the
first two methods, I re-implemented the old behavior when assignment
to value.__class__ fails.

For the load_build() I also re-implemented the old behavior when
inst.__dict__.update() fails but this means that unpickling in REE is
semantically different than unpickling in unrestricted mode.
1998-01-26 22:47:35 +00:00
Barry Warsaw 5da0f504ba get(): Fixed a bug in the merge order of the dictionaries. This makes
a copy of the defaults dictionary and merges the section's dictionary
into it so that sections can override the defaults.
1998-01-26 22:42:48 +00:00
Guido van Rossum c567b8176a Revamped, to match py_compile.py:
- added docstrings
- support option to specify a different purported directory name
- reindented with 4 spaces
1998-01-19 23:07:55 +00:00
Guido van Rossum f7edadbc58 Add Gopher to list of protocols that support query strings. 1998-01-19 22:27:21 +00:00
Guido van Rossum e7579624ef Fix bad new bug in ftp code -- the test for existing file using NLST
would set the transfer to text mode instead of the specified mode.
1998-01-19 22:26:54 +00:00
Guido van Rossum ca99c2ce75 Fix to ismount(). Can't remember who told me this. 1998-01-19 22:25:59 +00:00
Guido van Rossum 29c4688659 Patch by Tim O'Malley for servers that send a response looking just like
HTTP/1.x 200
instead of
    HTTP/1.x 200 OK
1998-01-19 22:25:24 +00:00
Guido van Rossum d2dd9a8b7f Some patches by Lars Marius Garshol:
- fix type_to_name(); it never worked
- add path_to_selector()
add path_to_datatype_name()
1998-01-19 21:59:48 +00:00
Guido van Rossum 63566e2ef2 Added docstrings.
Added an optional third parameter giving the purported filename for
error messages from the module.

Append a newline to the code string if needed.
1998-01-19 04:01:26 +00:00
Guido van Rossum e2c6e203c6 Add trace methods to class Variable 1998-01-14 16:44:34 +00:00
Guido van Rossum f473cb007b Added tests for qualified sub and split 1998-01-14 16:42:17 +00:00
Guido van Rossum 8687164426 Seems I've found a way to fix this. 1998-01-14 15:40:30 +00:00
Guido van Rossum 0d8fcb233e Update the doc string to emphasize non-Unix behavior earlier;
sys.prefix is no longer empty on any platform that I know of.
1998-01-13 18:32:40 +00:00
Guido van Rossum 2b2b3f9bcb Fix two bugs:
(1) maxsplit was ignored in split().

(2) groups() would return a string instead of a singleton tuple when
there was only one group.
1998-01-12 18:57:53 +00:00
Guido van Rossum 46f37144d3 New module added. 1997-12-31 00:11:03 +00:00
Guido van Rossum 51ca6e3e42 When there's no filename, don't make one up.
Added _test() that behaves (a bit) like gzip.
Fix a comment (*sequential* access is okay -- *random* access it out!)
1997-12-30 20:09:08 +00:00
Guido van Rossum f5910e42d1 Add tests for re.L(OCALE). 1997-12-30 17:32:33 +00:00
Guido van Rossum 380bf64424 Since DSA.py never made it to the release, neither should dos-8x3/dsa.py. 1997-12-30 05:03:39 +00:00
Guido van Rossum d01e9aa0df the usual 1997-12-30 04:20:58 +00:00
Guido van Rossum 1cd6a457d9 Two critical fixes to the changes that I made for Greg McFarlane --
patches provided by Greg (am I glad I sent him my latest version!).
1997-12-30 04:07:19 +00:00
Guido van Rossum 5baf4bc978 Moved things around a bit in interact(), so outout is processed before
input.  When an EOF is read, break out of the loop instead of (by
default) writing an empty line (which doesn't do much good).  Don't
close self when falling through the loop.
1997-12-29 20:05:45 +00:00
Guido van Rossum 9fd41e363b Fixed several bugs reported by Greg McFarmane:
*  The invoke methods of the three Tkinter widgets Button,
    Checkbutton and Radiobutton should return the value returned by
    the callback, (like the Menu widget does):

	def invoke(self):
	    return self.tk.call(self._w, 'invoke')

 *  The select_from method of the Canvas widget should use 'from', not
    'set':

	def select_from(self, tagOrId, index):
	    self.tk.call(self._w, 'select', 'from', tagOrId, index)

    Currently, if you use select_from, you get the error message:
 'TclError: bad select option "set": must be adjust, clear, from, item, or to'

 *  The 'entrycget' and 'type' methods of the Tk menu widget are
    missing from Tkinter.

 *  There is a bug in grid_columnconfigure and grid_rowconfigure.  For
    example, this should return the current value of the 'minsize'
    option for column 0:

	f.grid_columnconfigure(0, 'minsize')

    Instead it returns the same as:

	f.grid_columnconfigure(0)

    I suggest that the hint given in the comment in the
    Tkinter.Misc.configure method should be followed - "ought to
    generalize this so tag_config etc.  can use it".  Repeating the
    same configure code several times in Tkinter is inviting errors.
    [I did not follow this advice --G]

 *  The grid_slaves method should handle options.  Currently, to pass
    options to the grid_slaves method, you have to do something like:

	grid_slaves('-row', 1)
1997-12-29 19:59:33 +00:00
Guido van Rossum 23e21e7cf3 Minor editing corrections. 1997-12-29 19:57:36 +00:00
Guido van Rossum 2003204ba7 Added doc string, provided by Charles Waldman (with some reformatting
and a little editing my me).
1997-12-29 19:26:28 +00:00
Guido van Rossum d499004860 Solve two annoying problems with ftp URLs for Jack: when repeated
retrieving files from the same host and directory, you had to close
the previous instance before opening a new one; and retrieving a
non-existent file would return an empty file.  (The latter fix relies
on maybe an undocumented property of NLST -- NLST of a file returns
just that file, while NLST of a non-existent file returns nothing.  A
side effect, unfortunately, seems to be that now ftp-retrieving an
*empty* directory may fail.  Ah well.)
1997-12-28 04:21:20 +00:00
Guido van Rossum adfacf4e2e Do a better job of keeping the dialog visible when the master window
is near or beyond the edge of the screen.  Patch by Skip Montanaro.
1997-12-28 03:42:50 +00:00
Guido van Rossum 4d9d3f18c2 Typo: Widht instead of Width... 1997-12-27 15:14:43 +00:00
Guido van Rossum ccb5ec62e1 Added expect() method which takes a list of regular expressions and an
optional timeout.  Also moved some imports around.
1997-12-24 22:24:19 +00:00
Guido van Rossum 00f9fea288 Use string.replace instead of regsub.[g]sub. 1997-12-24 21:18:41 +00:00
Guido van Rossum b9b50eb7e0 Decided to add the telnet library that I wrote long ago (it's still in
the Demos/cwilib directory).  Converted comments to doc strings and
used default arguments instead of *args.  Updated the example.
1997-12-24 21:07:04 +00:00
Guido van Rossum b8c42c9825 Add new optional parameter 'suffix' (default ''), which is appended to
the temporary file name.  Also some minor formatting of Jim F's code.
1997-12-19 04:29:50 +00:00
Guido van Rossum 629bcfb8f9 Make this test succeed even when using "import test.test_zlib". 1997-12-18 05:21:07 +00:00
Guido van Rossum fedc6d0d5a Added SOLID definition. 1997-12-16 17:54:18 +00:00
Fred Drake b5323999d2 PhotoImage.put(): Fixed -to handling, including backward compatibility hack.
Guido, please take a look at this.
1997-12-16 15:03:43 +00:00
Guido van Rossum 80fb344a18 On NT, use a better template, ~XXX- where XXX is os.getpid(). 1997-12-15 19:11:53 +00:00
Guido van Rossum 92d91f56a7 Move %x test to nonstandard section because it appears to be locale specific. 1997-12-15 18:06:19 +00:00
Guido van Rossum f0413d4841 Added tag_prevrange analogous to rag_nextrange. 1997-12-15 17:31:52 +00:00
Guido van Rossum 30da0ea124 Believe it or not, some people have an empty group database.
Prevent the test from failing there.
1997-12-15 14:57:19 +00:00
Guido van Rossum 98b9d77666 Change _nametowidget to nametowidget -- it is a public interface. 1997-12-12 00:09:34 +00:00
Guido van Rossum 9e326665cf Remove unneeded "import re". 1997-12-11 21:41:13 +00:00
Guido van Rossum 7814ea64ff Last minute fix to Text.window_cget(), which should properly Tcl-ify
the option name (prepend '-', strip trailing '_').
1997-12-11 17:08:52 +00:00
Guido van Rossum 4d35e6f092 yeah, yeah. 1997-12-11 02:36:42 +00:00
Guido van Rossum 5ac00ac140 Fix problem detected by Greg McFarlane -- callbacks passed to
bind_class() and bind_all() are destroyed when the widget to which
they were passed is destroyed.
1997-12-11 02:03:55 +00:00
Guido van Rossum d1f4984a9b Jim Fulton writes:
The attached patch adds the following behavior to the handling
of REDUCE codes:

- A user-defined type may have a __reduce__ method that returns
  a string rather than a tuple, in which case the object is
  saved as a global object with a name given by the string returned
  by reduce.

  This was a feature added to cPickle a long time ago.


- User-defined types can now support unpickling without
  executing a constructor.

  The second value returned from '__reduce__' can now be None,
  rather than an argument tuple.  On unpickling, if the
  second value returned from '__reduce__' during pickling was
  None, then rather than calling the first value returned from
  '__reduce__', directly, the '__basicnew__' method of the
  first value returned from '__reduce__' is called without
  arguments.

I also got rid of a few of Chris' extra ()s, which he used
to make python ifs look like C ifs.
1997-12-10 23:40:18 +00:00
Guido van Rossum d0753e20b2 At Barry's suggestion, plug the security leak by using an empty
__builtins__ for all calls to eval().  This still allows someone to
write string.atof("[1]*1000000") (which Jim Fulton worries about) but
effectively disables access to system modules and functions.
1997-12-10 22:59:55 +00:00
Guido van Rossum 90d62ab0a1 Since this module is used as a fallback in case no built-in modules
have been configured, string.atof() should not fail when "import re"
fails (usually because pcre is not there).

This opens up a tiny security hole: *if* an attacker can make "import
re" fail, they can also make string.atof(arbitrary_string) evaluate
the arbitrary string.  Nothing to keep me awake at night...
1997-12-10 22:35:02 +00:00
Guido van Rossum e680546894 Don't specify base 0 to string.atoi when unpickling integers in text
mode.  The pickler always uses base 10 so the default base should be
fine.  (The base gets us in trouble when there's no strop module, as
the atoi() in string.py only supports base 10.  This is for JPython.)
1997-12-10 19:36:41 +00:00
Guido van Rossum e44a8d9987 Support uue and x-uue as short names for uuencode. 1997-12-10 18:54:36 +00:00
Guido van Rossum 9ab94c18d8 Doc strings and reformatting with 4 spaces bty Mitch Chapman.
Untabified and minor tweaks by me.
1997-12-10 16:17:39 +00:00
Guido van Rossum 5bdea89c89 # Typos in the comments giving the names of two recently added distributions. 1997-12-09 19:43:18 +00:00
Guido van Rossum b978d18fec Guess... :-) 1997-12-09 16:56:41 +00:00
Guido van Rossum 3d20986d96 Checking in ConfigParser.py -- I don't see a reason why this can't be
liberated.  This was originally written by Ken and later revamped by
Barry.
1997-12-09 16:10:31 +00:00
Guido van Rossum 7b8970ac88 Deleting ni.py; renamed to ni1.py, really. 1997-12-09 14:58:26 +00:00
Guido van Rossum 6599fb0917 Make close(), and hence __del__(), robust in the light of the world
being destroyed already.
1997-12-09 14:18:33 +00:00
Guido van Rossum 41999c164e Doc strings by Mitch Chapman (with a little reformatting).
Also reformatted the whole module with 4 spaces and no tabs.
1997-12-09 00:12:23 +00:00
Guido van Rossum 6a99984e79 Use long() instead of int() to compare mktime(localtime(t) with t... 1997-12-08 21:48:01 +00:00
Guido van Rossum dfa6790bd6 New re version from AMK 1997-12-08 17:12:06 +00:00
Guido van Rossum c5d2d51700 Apply the same change to classes without an __getinitargs__() method
as in pickle: the new instance is created without calling __init__().
1997-12-07 16:18:22 +00:00
Guido van Rossum 61de0ac4bb Reindented according to new standard, without tabs.
Also added one more os2 specific piece of code, by Jeff Rush.
1997-12-05 21:24:30 +00:00
Guido van Rossum 63cf3960df ospath.py has been obsolete for long enough. 1997-12-05 19:49:14 +00:00
Guido van Rossum e467be6511 When instantiating a class with no arguments and where the class does
not define __getinitargs__, bypass the __init__ constructor
completely.  This uses the trick of instantiating an empty dummy class
and then changing inst.__class__ to the real class.  This is done in
two places: once for the INST and once for the OBJ format code.

Also replaced the much outdated long doc string with a short summary
of the module; the information of that doc string is already
incorporated in the library reference manual.
1997-12-05 19:42:42 +00:00
Guido van Rossum 346f7af8ff Added doc strings and reindented according to new standard, without tabs.
(Like ntpath.py, this was contributed by "Charles G. Waldman" <cgw@pgt.com>)
1997-12-05 19:04:51 +00:00
Guido van Rossum 15e22e1c3a Added doc strings and reindented according to new standard, without tabs. 1997-12-05 19:03:01 +00:00
Guido van Rossum 7f9732880e Fix the exclusion of "config" in the methods copied from Pack to also
exclude "configure".
1997-12-05 17:05:04 +00:00
Guido van Rossum e612be5926 Patch my Marc Lemburg to fix urljoin("/a", "..") and urljoin("/a", "..#1"). 1997-12-03 22:38:56 +00:00
Guido van Rossum 3fa440ea91 Refinement of home for NT, courtesy Jeff Bauer. 1997-12-03 22:34:03 +00:00
Guido van Rossum ab76af3d65 Provide default for blocksize on retrbinary (Skip Montanaro). 1997-12-03 19:34:14 +00:00
Guido van Rossum 98ee50b5a4 More generated files for netbsd 1.x, by Anders Andersen. 1997-12-03 18:44:57 +00:00
Guido van Rossum 91221c29f2 Support for netbsd1 and freebsd3, after suggestions by Anders Andersen
and Jacques Vidrine.
1997-12-02 20:30:29 +00:00
Guido van Rossum c0f29c2d31 When a port is specified in an ftp:// URL, must convert it to a number! 1997-12-02 20:26:21 +00:00
Guido van Rossum 80f8be8901 Support for the "event" command, new in Tk 4.2.
By Case Roole.
1997-12-02 19:51:39 +00:00
Guido van Rossum 11fbef5f92 Sjoerd sez: global substitute \240 with \177. 1997-12-02 17:45:39 +00:00
Guido van Rossum 376467ada6 Added stropts.h to the list of files automatically regenerated. 1997-12-02 14:37:20 +00:00
Barry Warsaw 5284589097 Generated from Solaris 2.6's /usr/include/sys/stropts.h via
Tools/scripts/h2py.py.  This file contains many useful streamio(7)
constants, especially the ones that support passing open file
descriptors through a pipe: I_RECVFD and I_SENDFD.
1997-12-02 04:49:09 +00:00
Guido van Rossum 893a8cbae7 *** empty log message *** 1997-12-02 03:42:17 +00:00
Guido van Rossum cf4559a62e Added Pareto and Weibull distributions, courtesy Jeremy Hylton. 1997-12-02 02:47:39 +00:00
Barry Warsaw c99a239f42 Added strop.split tests when sep is None. 1997-12-02 00:30:04 +00:00
Guido van Rossum 06ba34c5d4 In string.split(), honor maxsplit (if > 0).
In string.splitfields(), ignore maxsplit if <= 0, rather than ignoring
maxsplit=0 but effectively treating negative numbers the same as
maxsplit=1.  Also made the test for maxsplit slightly more efficient
(set it to the length of the string when <= 0 so the test for its
presence can be omitted from the loop).
1997-12-01 15:25:19 +00:00
Barry Warsaw 58a88b3e34 _Environ(): Added __getinitargs__() method so os.environ.copy() works,
as does unpickling, as in: pickle.loads(pickle.dumps(os.environ)).

Hope this is right!  Don't shoot me Guido. :-)
1997-12-01 04:30:19 +00:00
Barry Warsaw 9181190c76 Added tests of strop.replace() 1997-11-29 00:25:30 +00:00
Guido van Rossum 0b23348aa9 The usual 1997-11-26 15:44:34 +00:00
Guido van Rossum e2d4dd194b Use fuzzy comparison from test_support to compare outcome of
pow(x,y,z) to pow(x,y)%z.
1997-11-24 22:24:22 +00:00
Guido van Rossum 8e9ebfd337 os2 patch by Jeff Rush 1997-11-22 21:53:48 +00:00
Guido van Rossum c0b93191e6 bind_class should return a value 1997-11-22 21:49:56 +00:00
Guido van Rossum be7c45eec4 New address parser by Ben Escoto replaces
Sjoerd Mullender's parseaddr()
1997-11-22 21:49:19 +00:00
Guido van Rossum e6c128f428 Use fstat if we can; write MAGIC into file last. 1997-11-22 21:48:26 +00:00
Guido van Rossum 7d5b99d8bf A new standard module, as discussed on comp.lang.python, to simplify
the writing of filters.

Typical use is:

    import fileinput
    for line in fileinput.input():
        process(line)

This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty or when a filename is
'-'.

There is also an option to use this to direct the output back to the
input files.
1997-11-21 17:12:59 +00:00
Barry Warsaw 3d96d522ec (Queue.Empty): When class based exceptions are in force, derive this
class from the standard base exception Exception.  Otherwise define
Queue.Empty as a string exception.

(Queue): 8-space to 4-space indentation conversion.  Also, basically
recast all method comments into docstrings.
1997-11-20 19:56:38 +00:00
Guido van Rossum bd1169a93e Add Martin von Loewis as the author of this module. 1997-11-19 19:02:09 +00:00
Guido van Rossum eef1d4e8b1 User-level locale module. A wrapper around _locale which adds
format(), str(), atof(), and atoi().  The last three are locale
sensitive versions of the corresponding standard functions (only for
numbers though); format() does general %[efg] formatting taking the
locale into account, optionally with thousands grouping.
1997-11-19 19:01:43 +00:00
Guido van Rossum 83600050d0 Assert that the proxies object passed in to the URLopener constructor
is indeed a dictionary (or a mapping).
1997-11-18 15:50:39 +00:00
Guido van Rossum 421c224044 Added docstrings (contributed by Martin von Loewis). 1997-11-18 15:47:55 +00:00
Guido van Rossum 5d68e8e312 Fixed case sensitivity of attributes (they are case *sensitive*). 1997-11-18 15:27:20 +00:00
Guido van Rossum a219efaa7b Sjoerd Mullender's xml parser (based on sgmllib, somewhat). 1997-11-18 15:09:54 +00:00
Guido van Rossum 368e06b6f0 Some restructuring.
All geometry manager methods that apply to a master widget instead of
to a slave widget have been moved to the Misc class, which is
inherited by all of Tk(), Toplevel() and Widget().  They have been
renamed to have their geometry manager name as a prefix,
e.g. pack_propagate(); the short names can still be used where
ambiguities are resolved so that pack has priority over place has
priority over grid (since this was the old rule).

Also, the method definitions in the Pack, Place and Grid classes now
all have their respective geometry manager name as a prefix
(e.g. pack_configure); the shorter names are aliases defined through
assignment.

A similar renaming has been done for all config() methods found
elsewhere; these have been renamed to configure() with config being
the alias (instead of the other way around).  (This may not make much
of a difference but the official Tk command name is now 'configure'
and it may help in debugging tracebacks.)

Finally, a new base class BaseWidget has been introduced, which
implements the methods common between Widget and Toplevel (the
difference between those two classes is that Toplevel has a different
__init__() but also that Toplevel doesn't inherit from Pack, Place or
Grid.
1997-11-07 20:38:49 +00:00
Guido van Rossum c1189eb524 Separate out a function pystones(loops=LOOPS) which runs the benchmark
and returns a (benchtime, stones) tuple.  The main() function now
calls this and prints the report.  Fred Drake's code.
1997-11-06 15:45:05 +00:00
Guido van Rossum f849291e2b Add __init__.py to test package. 1997-11-06 15:41:23 +00:00
Guido van Rossum bfa9f13e14 islink() returns false, but there is no constant false! Return 0 instead. 1997-11-04 18:40:53 +00:00
Guido van Rossum 19f44560f2 Use ``0'' instead of ``None'' to reset the underlying object in close
methods.  Using None causes problems if the destructor is called after
the __builtin__ module has already been destroyed (unfortunately, this
can happen!).  I can't just delete the object because it is actually
tested for (if self._sock: ...).  Setting it to 0 is a bit weird but
works.
1997-11-04 17:32:59 +00:00
Guido van Rossum e8d113976c Add empty __init__.py files to the test packages so the new policy
will recognize them.
1997-10-31 18:33:41 +00:00
Guido van Rossum 613418aa09 New version from Sjoerd, small bugfix + optimizations. 1997-10-30 15:27:37 +00:00
Guido van Rossum 0874f7fdaf Tests for tokenize.py (Ka-Ping Yee) 1997-10-27 22:15:06 +00:00
Guido van Rossum fefc922cef New, fixed version with proper r"..." and R"..." support from Ka-Ping. 1997-10-27 21:17:24 +00:00
Guido van Rossum 3b631775b2 Redone (by Ka-Ping) using the new re module, and adding recognition
for r"..." raw strings.  (And R"..." string support added by Guido.)
1997-10-27 20:44:15 +00:00
Guido van Rossum 036309b13e This should hopefully finally clean up the remaining __del__ related
problems with this module, even if an instance of a derived class is
kept alive longer than the urllib module itself...
1997-10-27 18:56:19 +00:00
Guido van Rossum af8d2bf4d8 Bugfix in match() -- the number of registers shouldn't be divided by two! 1997-10-27 18:17:19 +00:00
Guido van Rossum e6eef4b4a3 Use __dict__.update(state) instead of for loop over state.items() and
call to setattr().  This changes semantics, following the change
already implemented in pickle.

Also reindented a few lines properly.
1997-10-26 17:00:25 +00:00
Guido van Rossum 31626bce66 re -> regex conversions by Sjoerd. 1997-10-24 14:46:16 +00:00
Guido van Rossum f81e5b9c78 New module -- converts regex regular expressions to re style.
There are two ways to use this -- as a filter (e.g. using C-U M-| on a
regex string literal in an Emacs buffer) or from a Python program
which imports this as a module.  Read the doc string for more info,
and also some caveats (some cases aren't handled right).
1997-10-23 22:43:50 +00:00
Guido van Rossum 1fef181183 Although it's hard to be sure, I *think* this is a working conversion
from regex to re style regular expressions.  This should make sgmllib
and htmllib threadsafe, so I can now create a threaded version of
webchecker...
1997-10-23 19:09:21 +00:00
Guido van Rossum 57a68e08f9 Remove redundant import regsub. 1997-10-23 17:50:10 +00:00
Guido van Rossum 9694fcab53 Convert all remaining *simple* cases of regex usage to re usage. 1997-10-22 21:00:49 +00:00
Guido van Rossum 426916e50e Add pcre to the list of safe modules. 1997-10-22 20:56:32 +00:00
Guido van Rossum f7a8b45d71 Remove outdated comments. 1997-10-22 20:54:50 +00:00
Guido van Rossum 12f86ade21 Removed some unneeded imports, moved others around. 1997-10-22 20:52:53 +00:00
Guido van Rossum a8832b45e7 Removed unneeded imports of regex and regsub. 1997-10-22 20:50:37 +00:00
Guido van Rossum acfb82a530 Use re instead of regex. Also remove bogus return statement from __init__(). 1997-10-22 20:49:52 +00:00
Guido van Rossum 8566e474b4 Added pgrep() function, which is like grep/egrep/emgrep but uses Perl
syntax, by virtue of the new re module.
1997-10-22 20:44:58 +00:00
Guido van Rossum b49144244c Deleted this long-obsolete module 1997-10-22 16:29:53 +00:00
Guido van Rossum 24986204cf Added "new" symbol defns for RE_ANSI_HEX and RE_NO_GNU_EXTENSIONS --
hopefully the last maintenance on this module, ever.
1997-10-22 16:28:53 +00:00
Guido van Rossum 4e8ef5fcd3 Catch KeyboardInterrupt separately and propagate it, instead of
reporting a "crash".

Use sys.exc_info() instead of sys.exc_type and sys.exc_value.
1997-10-20 23:46:54 +00:00
Guido van Rossum 1510565cb5 Add optional 4th argument to count(), matching find() etc.
Also change all occurrences of "x == None" to "x is None" (not that it
matters much, these functions are all reimplemented in strop -- but
count() is not).
1997-10-20 23:31:15 +00:00
Guido van Rossum dd65975ac7 Patch by Charles G. Waldman to add optional user and password
arguments to NNTP.__init__(), for nntp servers that need them.
1997-10-20 23:29:44 +00:00
Guido van Rossum 7eecc246a7 Remove .pyo files like .pyc files. 1997-10-20 23:16:58 +00:00
Guido van Rossum fb5cef1160 Added separate tests for {}.get(). 1997-10-20 20:10:43 +00:00
Barry Warsaw 9b887c7911 Added tests of dict.get() 1997-10-20 17:34:43 +00:00
Fred Drake 654451dc54 splitpasswd(): The parameter is named "user", not "host". 1997-10-14 13:30:57 +00:00
Guido van Rossum 2861f4ec6e Open files in binary mode (Jack) 1997-10-08 15:23:23 +00:00
Guido van Rossum cbf3dd53b4 Use better timer on the mac
Open files in binary mode
(Jack)
1997-10-08 15:23:02 +00:00
Guido van Rossum 45ac47c0b2 Allow open file as parameter (must be seekable) (Jack) 1997-10-08 15:22:32 +00:00
Guido van Rossum 9ec2ed466b Change test for re.sub() involving g<...> to use a multi-character
identifier.  The previous re.py had a bug that wouldn't show up with
single-char identifier...
1997-10-08 04:05:08 +00:00
Guido van Rossum 5bc5b14f6d Checking in AMK's latest installement. 1997-10-08 02:08:04 +00:00
Guido van Rossum d2c0ec78d2 Use `...` around binary strings. 1997-10-07 21:22:48 +00:00
Fred Drake 53ad776cbf Remove this pathetic little module! 1997-10-07 18:12:20 +00:00
Guido van Rossum c6e8fd6de7 Temporary fix to valid_identifier(). 1997-10-07 14:51:18 +00:00
Guido van Rossum 2f3941d743 Return the error code from most commands, rather than swallowing it.
Adapted the example (lying slightly about the string printed by
login()).
1997-10-07 14:49:56 +00:00
Guido van Rossum ae590db3ce Fix join to support multiple arguments.
(Why isn't this file identical to ntpath.py?)
1997-10-07 14:48:23 +00:00
Guido van Rossum abfdd70665 Add XXX note about wanting support for copy_reg.py... 1997-10-07 14:47:50 +00:00
Guido van Rossum 90981e0e70 Add Jeff Epler's interact() function. Note that it is broken.
(It should probably be withdrawn :-( )
1997-10-07 14:47:24 +00:00
Guido van Rossum d5484fb75c Add optional arguments lo and hi to insort() and bisect(), to support
using arrays containing leading or trailing garbage.
1997-10-07 14:45:49 +00:00
Fred Drake e3dbc7e422 Reduced number of temporary names used at module scope. Use underscores in
front of temporary names in the module namespace.
1997-10-06 21:28:04 +00:00
Fred Drake dc1a072e02 Reduced number of temporary names used at module scope. Use underscores in
front of temporary names in the module namespace.
1997-10-06 21:06:29 +00:00
Fred Drake 923c4eeeef Don't do weird things with the "import parser"; just do it. Sheesh... 1997-10-06 20:56:43 +00:00
Guido van Rossum a11ccccd24 The usual (and some new modules). 1997-10-06 20:19:59 +00:00
Barry Warsaw fc3e61cd28 UserDict.get(): New method to mirror built-in dictionaries' get()
method.
1997-10-06 17:50:04 +00:00
Fred Drake 596db3161c Move the __getitem__() definition from StandardException to Exception.
This allows stuff like this out of the box:

	try:
	    ...
	except socket.error, (code, msg):
	    ...
1997-10-06 15:48:20 +00:00
Guido van Rossum bf9d353bab New "re" regular expression support.
The new re module was written by Andrew Kuchling and uses the pcre
code in ../Modules/.  The old re module has been renamed to re1,
just in case you need it for comparison.
1997-10-06 14:45:17 +00:00
Guido van Rossum 6af6d3511e Turns out whatsound.py and sndhdr.py were identical modules.
Since there's also an imghdr.py file, I propose to make sndhdr.py the
official one.  For compatibility, whatsound.py imports * from
sndhdr.py.
1997-10-04 20:29:17 +00:00
Guido van Rossum f1b0009a78 Fix path search for test data file so it works under more circumstances. 1997-10-01 22:10:32 +00:00
Guido van Rossum ae631f7f45 There was actually a test that ensured that raising an exception A
with an instance of a derived class B would really raise an A, not a
B.  Since Barry fixed this anomalous behaviour, I though I might as
well fix the test!  (Hmm, Barry, did you not run the tests or did you
miss that test_opcodes failed?)
1997-10-01 04:41:05 +00:00
Guido van Rossum a008fa52be Fixed test for socket.error to work when it's a class exception. 1997-10-01 04:39:05 +00:00
Guido van Rossum ac8a9f3ee9 Handy utility to guess MIME type from extension. 1997-09-30 19:05:50 +00:00
Guido van Rossum 83bd9a9c8c Move Widget.config() c.s. to Misc class, so the Tk class also inherits them. 1997-09-29 23:24:52 +00:00
Guido van Rossum 332e14437c Use sys.exc_info() where needed.
Use "re" module, making it threadsafe.
1997-09-29 23:23:46 +00:00
Guido van Rossum f15d15964b Use sys.exc_info() where needed. 1997-09-29 23:22:12 +00:00
Guido van Rossum c90ad2103e No longer need to be very careful with saving the exception state
first.  Don't store the traceback as a local variable, to avoid
circular references.
1997-09-29 23:17:48 +00:00
Guido van Rossum a3beb63eb7 Removing emacs.py, which is obsolete. 1997-09-29 13:19:53 +00:00
Guido van Rossum da286666b2 Add optional bufsize argument to various calls so we can make the
os.fdopen() calls unbuffered.  I presume that it's enough if we can
make all three of them (for stdin, stdout, and stderr) unbuffered and
don't need to specify different buffer sizes per file -- that would
complicate the interface more than I care for.
1997-09-29 04:04:39 +00:00
Guido van Rossum 4752966193 Use Marc Lemburg's tb_lineno() to calculate the correct line number.
Apparently the traceback object doesn't contains the right linenumber
when -O is used.  Rather than guessing whether -O is on or off, use
tb_lineno() unconditionally.
1997-09-26 22:43:02 +00:00
Guido van Rossum 2781fbe46c Word completion for the new readline.set_completer() function.
When completing a simple identifier, it completes keywords, built-ins
and globals in __main__; when completing NAME.NAME..., it evaluates
(!) the expression up to the last dot and completes its attributes.

It's very cool to do "import string" type "string.", hit the
completion key (twice), and see the list of names defined by the
string module!

Tip: to use the tab key as the completion key, call

    readline.parse_and_bind("tab: complete")
1997-09-26 22:04:56 +00:00
Guido van Rossum 6dd4868681 The command can now either be a string (as before) or a list of
arguments for execvp (for those who don't want the shell's argument
parsing).
1997-09-18 20:00:39 +00:00
Barry Warsaw 25131faffe NumberError => ArithmeticError 1997-09-16 21:50:59 +00:00
Guido van Rossum c56ba38350 Two subtle changes:
(1) Introduce Exception as the conceptual root class for all exceptions.

(2) Do less work in __init__(), and more in __str__ (store args
unchanged).
1997-09-16 18:42:04 +00:00
Guido van Rossum 7883e1dfbd Entirely rewritten parseaddr() function by Sjoerd Mullender.
(Includes a patch he sent me a few days later.)
1997-09-15 14:12:54 +00:00
Guido van Rossum a1dbe50ec2 Added code to emit trailing ',' for singleton tuples in two places. 1997-09-14 23:21:51 +00:00
Guido van Rossum 4fb5b28dfc Three independent changes:
- Don't use "from copy_reg import *".

- Use cls.__module__ instead of calling whichobject(cls, cls.__name__);
  also try __module__ in whichmodule(), just in case.

- After calling save_reduce(), add the object to the memo.
1997-09-12 20:07:24 +00:00
Guido van Rossum 4ece95d55a #Added doc string. 1997-09-09 20:44:04 +00:00
Guido van Rossum 4f9f8e3599 Make functionality more closely the same as what's implemented by default. 1997-09-09 20:39:58 +00:00
Guido van Rossum 501d0bb7ad *** empty log message *** 1997-09-09 20:35:20 +00:00
Guido van Rossum 1c0d851a32 Renamed platform specific subdirectories to plat-*. 1997-09-09 03:50:59 +00:00
Guido van Rossum 5c1f5bd5f6 Renamed dos_8x3 to dos-8x3. 1997-09-09 03:42:09 +00:00
Guido van Rossum d7500fcbb4 These directories renamed: tkinter -> lib-tk, stdwin -> lib-stdwin. 1997-09-09 03:39:21 +00:00
Guido van Rossum c8bf884248 Added test for __all__. 1997-09-08 16:06:20 +00:00
Guido van Rossum e8fd143b7e #Adapt the doc string to reality. 1997-09-08 02:47:46 +00:00
Guido van Rossum 10499324cf Initialize self.__tempfiles to [] in the constructor (else it remains
a shared class variable -- but each instance will attempt to clean it
up entirely ob cleanup).
1997-09-08 02:16:33 +00:00
Guido van Rossum 62b297b698 Change packages -> site-packages 1997-09-08 02:14:09 +00:00
Guido van Rossum d6ead328b3 *Semantic change*: when unpickling the instance variables of an
instance, use inst.__dict__.update(value) instead of a for loop with
setattr() over the value.keys().  This is more consistent (the
pickling doesn't use getattr() either but pickles inst.__dict__) and
avoids problems with instances that have a __setattr__ hook.

But it *is* a semantic change (because the setattr hook is no longer
used).  So beware!
1997-09-08 02:08:11 +00:00
Guido van Rossum eeadc04200 Look for uuencoded test files in the directory containing this module, too.
(This is necessary because when imported as test.test_rgbimg, the test
directory is not on sys.path.)
1997-09-07 16:54:34 +00:00
Guido van Rossum bc8b2bd95e Look for uuencoded test files in the directory containing this module, too.
(This is necessary because when imported as test.test_rgbimg, the test
directory is not on sys.path.)
1997-09-07 16:50:45 +00:00
Guido van Rossum f9fa20b2d2 Pass optional arguments (globals(), locals(), []) to __import__() so
it will run as package test, e.g. this will run the test suite:

    import test.regrtest
    test.regrtest.main()
1997-09-07 16:42:34 +00:00
Guido van Rossum 10887a3067 Fix details in the test:
- traceback should go to stdout!
- don't import ni, import t1!
- nicer support for command line options, only if run as __main__
1997-09-07 06:12:11 +00:00
Guido van Rossum 81da02e6aa Added feeble test for reload() of packages and submodules. 1997-09-06 19:58:53 +00:00
Guido van Rossum 6c61242c78 Test set for package import. 1997-09-06 18:42:57 +00:00
Guido van Rossum f394f56c2b Made the 'info' argument to SyntaxError optional, so phase-2 syntax
errors are handled (these gave ``TypeError: not enough arguments'').

Also changed its __str__() to correct a typo (missing self.) and
return str(self.msg) to ensure the result is always string.

Also changed the default __str__ to simply return str(self.args).
1997-09-05 19:00:56 +00:00
Jeremy Hylton 6459627b12 Now produces some reassuring output. 1997-09-04 23:42:01 +00:00
Jeremy Hylton 9dc2b8ee07 Many more tests, including tests of many optional arguments. 1997-09-04 23:41:37 +00:00
Guido van Rossum 898c915a31 Added some try-excepts so that it can be imported in restricted mode
(though some type names are undefined in that case, e.g. CodeType
(inaccessible), FileType (not always accessible), and TracebackType
and FrameType (inaccessible).
1997-09-04 22:12:34 +00:00
Guido van Rossum d807b7589b The re test suite is very slow on slower hosts.
To save time, only run the first and last 10 tests except in verbose mode.
1997-09-04 14:35:45 +00:00
Guido van Rossum dc5d07d952 Different test for Unix -- rely on os.sep instead of sys.platform. 1997-09-03 23:12:18 +00:00
Guido van Rossum 2b3fd76cc7 One patch from Sjoerd and one from Jack.
Sjoerd: add separate administration of temporary files created y
URLopener.retrieve() so cleanup can properly remove them.  The old
code removed everything in tempcache which was a bad idea if the user
had passed a non-temp file into it.  (I added a line to delete the
tempcache in cleanup() -- it still seems to make sense.)

Jack: in basejoin(), interpret relative paths starting in "../".  This
is necessary if the server uses symbolic links.
1997-09-03 22:36:15 +00:00
Guido van Rossum ad87d3e826 Give in to Mike Meyer -- add *both* lib/python1.5/packages and
lib/site-python to the path (if they exist).  This is a reasonable
compromise.
1997-09-03 21:41:30 +00:00
Guido van Rossum fc6efffbf9 #Removed debug print that was accidentally left in. 1997-09-03 00:35:38 +00:00
Guido van Rossum 5ed5c4c364 Add the same _keep_alive patch (by Michael Scharff) that was added to
copy.deepcopy() a while ago.  Can't reproduce this but it doesn't
break anything and it looks like the code could have the same problem.
1997-09-03 00:23:54 +00:00
Guido van Rossum 625f40de05 #typo 1997-08-30 20:04:42 +00:00
Guido van Rossum a28dab5ea2 Write out the dynamic OS choice, to avoid exec statements.
Adding support for a new OS is now a bit more work, but I bet that
'dos' or 'nt' will cover most situations...
1997-08-29 22:36:47 +00:00
Guido van Rossum f30bec7bb2 New site.py semantics. Searches in
<*prefix>/lib/python<version>/packages for *.pth files containing
directories that are appended to sys.path.
1997-08-29 22:30:45 +00:00
Barry Warsaw 3e613ce79b New file, which is imported by the built-in module when python is
started with the -X option.  This file contains the definitions for
the built-in exception classes.
1997-08-29 21:59:26 +00:00
Barry Warsaw 6ed41a0a87 Expanded r() function to handle class exceptions. 1997-08-29 21:58:25 +00:00
Guido van Rossum 02840fdf84 user.py -- when imported, execfile(~/.pythonrc.py). 1997-08-28 14:32:14 +00:00
Guido van Rossum e2ed9df645 Fixed bugs regarding lines starting with '.' (both receiving and sending).
Added a minimal test function.
1997-08-26 23:26:18 +00:00
Guido van Rossum ab0abdcef8 Explicitly close the socket and temp file in URLopener.retrieve(), so
that multiple retrievals using the same connection will work.

This leaves open the more general problem that after
    f = urlopen("ftp://...")
f must be closed before another retrieval from the same host should be
attempted.
1997-08-26 19:06:40 +00:00
Barry Warsaw 09f9547393 regression test for new sequence unpacking semantics 1997-08-25 22:17:45 +00:00
Barry Warsaw 9525df03bf Output for sequence unpacking test 1997-08-25 22:15:22 +00:00
Barry Warsaw 558f66ff53 Added a few more tests of exception class raising 1997-08-22 21:28:05 +00:00
Barry Warsaw ac405ce3f9 generated output for new tests 1997-08-22 21:27:40 +00:00
Barry Warsaw d543077aa6 Added tests of the new builtin functions issubclass() and isinstance() 1997-08-22 21:27:03 +00:00
Guido van Rossum b6784dc53f Interpret three slashes in file: URL as local file (for Netscape on
Windows/Mac).
1997-08-20 23:34:01 +00:00
Guido van Rossum 558be283bf Make sure the objects returned by __getinitargs__() are kept alive (in
the memo) to avoid a certain kind of nasty crash.  (Not easily
reproducable because it requires a later call to __getinitargs__() to
return a tuple that happens to be allocated at the same address.)
1997-08-20 22:26:19 +00:00
Guido van Rossum a412220bbf Change default verbosity so that there are only three levels left: -q,
default and -v.  In default mode, the name of each test is printed.
-v is the same as the old -vv.  -q is more quiet than the old default
mode; that's fine I think.
1997-08-18 20:08:24 +00:00
Guido van Rossum e7038425b1 Tweaks to cope with strftime returning 0 without error for %Z 1997-08-18 15:37:38 +00:00
Guido van Rossum f07eaea134 Forgot to check in the fixed output for print 1997-08-18 15:36:05 +00:00
Guido van Rossum 9918e0c750 Add missing comma to make a tuple of (tagOrId). 1997-08-18 14:44:04 +00:00
Guido van Rossum ce32096661 Oops. Of course, print b should also be print `b`. :-( 1997-08-18 13:42:28 +00:00
Guido van Rossum c95a6c1af5 Use imp.find_module() as the most certain way to find the test data. 1997-08-15 16:23:32 +00:00
Jeremy Hylton 57fa217b01 generated by regrtest.py -g 1997-08-15 16:00:02 +00:00
Jeremy Hylton 6eb4b6a0bd test the zlib module
only produce output if somethign goes wrong
1997-08-15 15:59:43 +00:00
Guido van Rossum cf00505325 Added tests for \b, \B (AMK). 1997-08-15 15:44:58 +00:00
Guido van Rossum 827ea7cf5d Last minut changes for \B, \S (?). AMK. 1997-08-15 15:44:23 +00:00
Guido van Rossum ff712aa8ab The usual. 1997-08-15 00:45:26 +00:00
Guido van Rossum 2b41fdccd3 Moved some non-standard format characters out of the standard list.
Also moved %c and %Z out of there, even though they are standard,
because these are locale dependent (and e.g. on Windows and Mac they
return different strings).  Finally, sorted the tables slightly
different, to match my standard docs better (%a before %A).
1997-08-14 22:23:42 +00:00
Guido van Rossum c4d6c4d950 OK, reop is safe again. 1997-08-14 21:23:07 +00:00
Guido van Rossum 5526e394a2 set LOOPS to 10000 1997-08-14 20:14:12 +00:00
Guido van Rossum c4c26414c5 Print `a` so encrypted text is shown in ascii, not binary. 1997-08-14 19:55:00 +00:00
Guido van Rossum e83870131b Don't call sys.exit() all over the place -- simply return the exit
status from main() and call sys.exit(main()) in the startup stub at
the end of the file.
1997-08-14 19:40:34 +00:00
Guido van Rossum 257c772afa Comment out use of reop.expand_escape and reop._expand until their
bugginess has been fixed.
1997-08-14 19:33:06 +00:00
Guido van Rossum 1530c87985 Fred Lundh's latest versions. 1997-08-14 14:17:28 +00:00
Guido van Rossum f53c86c2b6 Add dummies for create/delete filehandles, just so that vanilla Grail
0.3 won't break on Windows.
1997-08-14 14:15:54 +00:00
Guido van Rossum 88bb808d77 Fixed (and documented, see Doc/libmimify.tex) mime_decode_header() and
mime_encode_header().
1997-08-14 14:10:37 +00:00
Guido van Rossum 95e8053a9f 1.5a3 prerelease 1 from AMK 1997-08-13 22:34:14 +00:00
Guido van Rossum 6dc61b110f Add try-finally to close the file after loading it in
ModuleLoader.load_module!  (Thanks to Daniel Larsson who complained
about this.)
1997-08-13 14:48:36 +00:00
Guido van Rossum 6af4abdba0 Various changes by AMK, e.g. remove \e, \cX, add \v 1997-08-13 03:25:34 +00:00
Guido van Rossum f55afae3c6 New dialog from Fred Lundh 1997-08-12 18:21:21 +00:00
Guido van Rossum 9d9af2c7a8 Fixes for the Mac. (Jack) 1997-08-12 18:21:08 +00:00
Guido van Rossum a5e9fb6a65 Changes suggested by Jim fulton:
- Moved most imports to the top, for faster loadingf when using ni.
- Always open the temp file in binary mode.
1997-08-12 18:18:13 +00:00
Guido van Rossum ca54982b2a Added TemporaryFile and wrapper class by Jim Fulton.
Look in more env vars (for NT: TEMP, TMP).
1997-08-12 18:00:12 +00:00
Guido van Rossum d510b72fff Allow paths without drive specifier (Jack). 1997-08-12 14:47:24 +00:00
Guido van Rossum e2ad88c202 Rewrite normcase() using string.translate... 1997-08-12 14:46:58 +00:00
Guido van Rossum efa683726f Treat all HTTP/1.* versions the same. 1997-08-12 14:46:13 +00:00
Guido van Rossum 2567dd6d44 Two changes:
(1) No longer close self.sock; close it on close().  (Guido)

(2) Don't use regular expressions for what can be done simply with
string.split() -- regex is thread unsafe.  (Jeremy)

(3) Delete unused imports.  (Jeremy)
1997-08-11 21:52:17 +00:00
Guido van Rossum 0357d02eab Rewrite using class, to make waiting for processes possible;
by default children are waited for automatically.
1997-08-11 03:27:24 +00:00
Guido van Rossum 570278be6e Add test for function comparisons 1997-08-05 16:52:50 +00:00
Guido van Rossum d6615ab30c Get READABLE c.s. from _tkinter instead of conditional definition.
in Tk.destroy(), reset _default_root to None when it is us.
1997-08-05 02:35:01 +00:00
Guido van Rossum 7995ed204a The reload(sys) test no longer works due to changes in the import
semantics.
1997-08-02 03:19:26 +00:00
Guido van Rossum 74d25e7d8a Mention decode_base64 in example. 1997-07-30 22:02:28 +00:00
Guido van Rossum 9a876a4500 Tweaks by Lars Wirzenius to parse some more forms of illegal dates:
the comma after the day name is optional if it is a recognized day
name; and the date and month may be swapped.  Thus, the following two
test dates will now be parsed correctly:
	Thu, Feb 13 12:16:57 1992
	Thu Feb 13 12:16:57 1992
1997-07-25 15:20:52 +00:00
Guido van Rossum 4e5cbcf5af Added createmessage() -- Lars Wirzenius. 1997-07-25 14:59:10 +00:00
Guido van Rossum 2e2525fd3c Patch by Lars Wirzenius to allow f.readline(length). 1997-07-25 14:56:01 +00:00
Guido van Rossum ed57d7663e Regenerated; __assert__ becomes assert. 1997-07-23 18:10:52 +00:00
Guido van Rossum 68de37973f Add the option to pass an open file object to GzipFile. This obviates
the need for the StringIO subclass.
1997-07-19 20:22:23 +00:00
Guido van Rossum 64c6620934 Add optional 'quote' flag argument to escape(); if true, translate '"'
to '&quot;'.
1997-07-19 20:11:53 +00:00
Guido van Rossum 1e8c8a20f2 New dialog routines (Fred Lundh) 1997-07-19 20:02:36 +00:00
Guido van Rossum 65c78e18b5 Use dictionary's update() method in _cnfmerge(). 1997-07-19 20:02:04 +00:00
Guido van Rossum c864ad695f Nit: round delays to 0.1 second. 1997-07-18 23:50:22 +00:00
Fred Drake e0ffabe375 Slight mods to make the module conform to the documentation. 1997-07-18 20:42:39 +00:00
Guido van Rossum 1557a7314c Checking in new module code.py -- utilities dealing with code objects.
Currently, contains one function: compile_command(), which helps
determining whether a source string is complete, incomplete or in
error.  This is useful when writing your own version of the Python
read-eval-print loop.
1997-07-18 16:57:52 +00:00
Guido van Rossum f357d3ef52 This module is now completely obsolete.
Noted this in the XXX comments.
Also, changed all three functions to use the attributes if they exist.
1997-07-18 16:48:30 +00:00
Guido van Rossum c444865994 No longer need to use codehack -- use co.co_firstlineno instead. 1997-07-18 16:47:40 +00:00
Guido van Rossum 2deb73a961 Use sys.exc_info() instead of sys.exc_{type,value,traceback}.
Also corrected a typo in format_stack (t should've been f).
1997-07-18 16:46:36 +00:00
Guido van Rossum 4994657c5f Some new tests by Jeffrey 1997-07-18 04:26:25 +00:00
Guido van Rossum 71fa97c60d Jeffrey's latest -- reorder my chages somewhat,
removed some of his own cruft.  Added \g<...> references in replacement text.
1997-07-18 04:26:03 +00:00
Guido van Rossum 9e18ec7dc9 Correctly implement sub, subn, and split. Also correct and augment
the cache code.
1997-07-17 22:39:13 +00:00
Guido van Rossum a4f1a78b6e Jeffrey's next installment 1997-07-17 22:38:10 +00:00
Guido van Rossum 32d6f3c0ce Corresponding output. 1997-07-17 22:37:07 +00:00
Guido van Rossum 06c0ec94e4 Several additions from Jeffrey. 1997-07-17 22:36:39 +00:00
Guido van Rossum 23b225741c Added tests for sub, subn, and split. 1997-07-17 22:36:14 +00:00
Guido van Rossum c3fb88be8b Fix xover implementation according to Fred Lundh. 1997-07-17 15:21:52 +00:00
Guido van Rossum a0e4c1bffc Jeffrey's latest -- seems to solve most problems! 1997-07-17 14:52:48 +00:00
Guido van Rossum 75fce308bc Add flush() method to fake file. 1997-07-17 14:51:37 +00:00
Guido van Rossum db2b70cb99 Fix bug found by kjpylint; change doc string to avoid "(" in column 1. 1997-07-16 16:21:38 +00:00
Guido van Rossum 9e48b272b9 Catch all exceptions in test modules. 1997-07-16 01:56:13 +00:00
Guido van Rossum 65cd989441 Added output from new tests. 1997-07-15 19:01:38 +00:00
Guido van Rossum 9ddd9dad80 Fixed a syntax error caused by a bad line in the Perl source. 1997-07-15 19:01:04 +00:00
Guido van Rossum 26d80e6714 Correct inf. while loop. 1997-07-15 18:59:04 +00:00
Guido van Rossum e8b81313db Merged Jeffrey's changes in. 1997-07-15 18:47:48 +00:00
Guido van Rossum 16bd0ff16a Merged my changes in, and added all converted Perl tests. 1997-07-15 18:45:20 +00:00
Guido van Rossum 337c6d41d4 Jeffrey's version 1997-07-15 18:42:58 +00:00
Guido van Rossum 9f845ec64b More changes by Jeffrey. 1997-07-15 18:11:42 +00:00
Guido van Rossum 23b8d4c15e Tweak re_tests and test_re to differentiate between
groups that have no value and groups that are out of bounds.
1997-07-15 15:49:52 +00:00
Guido van Rossum 847ed4afb5 More tweaks; re.py is nearly there... 1997-07-15 15:40:57 +00:00
Guido van Rossum 531097502c Fix group() -- should be tuple even when re has exactly one group. 1997-07-15 15:40:29 +00:00
Guido van Rossum 09bcfd649a Jeffrey's latest -- almost there. 1997-07-15 15:38:20 +00:00
Guido van Rossum 04a1d74229 Jeffrey's newest 1997-07-15 14:38:13 +00:00
Guido van Rossum 70f107f63d Three fewer incorrect failures 1997-07-15 02:49:15 +00:00
Guido van Rossum 7449540986 After some discussion with Jeremy and Fred, decided to limit the
default urlparse cache size to 20 instead of 2000.  The main use of
the cache seems to be to gain some speed in Grail, which is calling
urljoin with the same base for each anchor.  2000 is a bit too big for
Jeremy, who doesn't need the cache at all.  20 should keep at least
95% of the Grail speedup while wasting an insignificant amount of
memory in Jeremy's application.
1997-07-14 19:08:15 +00:00
Guido van Rossum 1d8b7583dc Removed the traceback output in non-verbose mode 1997-07-11 21:14:53 +00:00
Guido van Rossum 5d6de256d5 New from Jeffrey; small nits. 1997-07-11 21:10:17 +00:00
Guido van Rossum 8a9a4a2336 Jeffrey's latest. 1997-07-11 20:48:25 +00:00
Guido van Rossum 035aae0f09 Some small nits. 1997-07-11 20:47:58 +00:00
Guido van Rossum 185147f1d0 Test urlparse cache with try/except instead of has_key.
This makes it thread-safe again.
1997-07-11 20:13:10 +00:00
Guido van Rossum 7ffbd2f86c This is pretty pathetic and full of errors,
but it makes the regression test not complain about test_re.
1997-07-11 19:43:46 +00:00
Guido van Rossum 8e0ce30ce4 test suite for re.py 1997-07-11 19:34:44 +00:00
Guido van Rossum 105bd989e3 Added /usr/bin/env python and made executable. 1997-07-11 18:39:03 +00:00
Guido van Rossum e3cd151d1f Use the modules base64, quopri, and uu, instead of external programs
to decode/encode the standard transfer encodings.
1997-07-11 16:33:26 +00:00
Guido van Rossum 9e1ee9715e Support for conditional breakpoints (Jim Fulton, with some changes). 1997-07-11 13:43:53 +00:00
Guido van Rossum 668361766a Normalize whitespace. 1997-07-11 13:43:31 +00:00
Guido van Rossum ff02e1ddde Support for conditional breakpoints (Jim Fulton). 1997-07-11 13:42:50 +00:00
Guido van Rossum 65c28b7efb Removed debug print in set construction.
Changed some '==' to 'in' (Tim Peters).
1997-07-11 11:10:44 +00:00
Guido van Rossum 63e18195b8 New version from Jeffrey after I complained about some glaring bugs. 1997-07-11 11:08:38 +00:00
Guido van Rossum 5ca1b711b5 Straight from Jeffrey Ollie's web page. 1997-07-10 21:00:31 +00:00
Guido van Rossum d247812521 Two improvements suggested by Tim Peters: speed up random() since we
know Python integers are at least 32 bits long; and avoid zeros in
initial seed value.
1997-07-10 15:14:50 +00:00
Fred Drake 475d51d7b2 Wrapped up the ~/.netrc support. This is basically just the changes Guido &
I discussed to the original version way-back-when.
1997-06-24 22:02:54 +00:00
Fred Drake bcdb9403d4 Added docstrings by Sue Williams, re-indented to 4 spaces / level. 1997-06-12 16:17:00 +00:00
Guido van Rossum d9c6f4fd7d Allow oct() result for 64-bit machines. 1997-06-06 21:14:14 +00:00
Guido van Rossum 914c938cc5 Use cPickle and cStringIO when available. 1997-06-06 21:12:45 +00:00
Guido van Rossum f668d17e01 Clear the ftp cache when it contains more than 10 entries. 1997-06-06 21:11:11 +00:00
Guido van Rossum 2966b32205 Catch *all* errors that ftplib can raise (ftplib.all_errors) rather
than just the four.

Also folded some long lines.
1997-06-06 17:44:07 +00:00
Guido van Rossum 2b1566be9d Correct typo in last line (test program invocation). 1997-06-03 22:05:15 +00:00
Guido van Rossum 876736cd0d AMK's regex test suite 1997-06-03 18:07:49 +00:00
Fred Drake cf3527b705 socket_type --> SocketType 1997-06-03 17:58:31 +00:00
Guido van Rossum c24751b57a Add Host: header to URL request. 1997-06-03 14:34:19 +00:00
Guido van Rossum b94cd96977 Fix bug in copy() by using copy.copy() instead of making assumptions
(it so happens that copy.copy() works fine for the base UserDict
type).  Also reindented the entire module to have 4-space indents.
1997-06-03 14:10:01 +00:00
Fred Drake bd40d7e69f Added the new dictionary methods to the wrapper class. 1997-06-03 13:07:59 +00:00
Guido van Rossum 2d3aac2377 The usual 1997-06-02 23:14:37 +00:00
Guido van Rossum ce1fa263e6 Added tests for dict.clear(), dict.update(), dict.copy(). 1997-06-02 23:14:00 +00:00
Guido van Rossum 77e1db3b34 Support $HOME in expanduser().
(Who'd thought that *anyone* would be interested in writing ~/foo on NT :-)
1997-06-02 23:11:57 +00:00
Barry Warsaw 1d0fe31d7e Packer.pack_uhyper(): Fixes needed to properly pack unsigned 64 bit
longs where the top bit is set.  First, change the masks so that they
are `L' longs, otherwise the sign bits will get propagated to the
result.  Next, do not coerce to int before sending to pack_uint()
otherwise Python will generate an OverflowError.  Here is a test
program that fails without the patch, but now succeeds:

import xdrlib

addr = (132, 151, 1, 71)
uint = 0L
for a in addr:
    uint = (uint << 8) | a

ulong64 = uint << 32

p = xdrlib.Packer()
p.pack_uhyper(ulong64)
buf = p.get_buffer()
u = xdrlib.Unpacker(buf)
ulong64prime = u.unpack_uhyper()

if ulong64 == ulong64prime:
    print 'okay'
else:
    print 'bogus'

print ulong64, ulong64prime
1997-05-29 21:01:35 +00:00
Guido van Rossum f7cea10f80 Remove '(' in column 0 of doc strings.
Add dependency on dict.copy().
1997-05-28 19:31:14 +00:00
Guido van Rossum d7c9d96d3e Tweak default source of query a bit so it is possible to invoke
a CGI script from the command line with not environment variables.
1997-05-28 15:39:15 +00:00
Guido van Rossum 1aec3f087e lowercase proxies env variables, for Windows. 1997-05-28 15:37:19 +00:00
Guido van Rossum 4305542517 Reworded the doc string to remove the need for The Emacs font-lock kludge.
This required (re)moving all occurrences of '(' in column 0, as well
as changing "#!" to #!.
1997-05-28 15:11:01 +00:00
Fred Drake c8296db67d Widget._setup(): Support name=None in a similar way to the handling of other
Tkinter keyword parameters.
1997-05-27 22:45:10 +00:00
Guido van Rossum f1e6354548 The usual 1997-05-22 20:48:03 +00:00
Guido van Rossum d6a111e2dd Fix for boundary case (Jack) 1997-05-21 14:59:17 +00:00
Guido van Rossum f8580215c1 Add test for presence of socket_type. 1997-05-21 14:38:57 +00:00
Guido van Rossum 05ba2ab720 Fix ratecv test (Sjoerd). 1997-05-21 14:27:20 +00:00
Guido van Rossum 462d6e6484 More robust way of choosing a non-existant uid (faster, too).
(Correct version -- the previous checkin was a keyboard slip.)
1997-05-20 19:32:22 +00:00
Guido van Rossum 6308d510e9 More robust way of choosing a non-existant uid (faster, too). 1997-05-20 19:31:25 +00:00
Guido van Rossum 72be30690f Added some minimal comments and tweaked lay-out a bit. 1997-05-20 18:03:22 +00:00
Guido van Rossum 32f92caa98 Handling of pathnames pointing to files on toplevel folder of disk was
incorrect (Jack)
1997-05-20 16:00:07 +00:00
Guido van Rossum 3f11da0aaf Changes to make these tests work on the Mac. 1997-05-16 13:51:48 +00:00
Guido van Rossum 9522274205 Increase the child's sleep time to 5 for slow machines. 1997-05-16 13:40:41 +00:00
Barry Warsaw 4c4d5ce78a Catch nis.error and raise TestFailed instead. This catches the
problem where Python is configured with the nismodule but NIS isn't
installed, or the map names don't correspond to those hardcoded in
nismodule.c (which is bogus in and of itself).
1997-05-15 18:27:49 +00:00
Guido van Rossum fdf58fe59a Added BabylMailbox class by Fred Lundh (untested). 1997-05-15 14:33:09 +00:00
Guido van Rossum 4dfd458611 Fix typo in error reporting. 1997-05-14 21:38:03 +00:00
Guido van Rossum c1c96d1b5c Fix hex tests for 64-bit machines. 1997-05-14 21:37:23 +00:00
Guido van Rossum 2b4d2800af Suppress fork part of socket test when we can't fork. 1997-05-14 21:12:51 +00:00
Guido van Rossum 4a0694d235 Fix sys.platform test -- on Win, it is 'win32', not 'win'. 1997-05-14 19:06:36 +00:00
Guido van Rossum 0ba7e5958c More rational implementation of get_qualified_path() -- search along
sys.path instead of assuming __file__ works.
1997-05-14 18:57:21 +00:00
Guido van Rossum ad16471b27 Untested changes by Skip Montanaro to have an optional limit on the
size of uploads to POST (new version of these patches).
1997-05-13 19:03:23 +00:00
Guido van Rossum 725a67e5c2 Regenerated on newer Solaris version 1997-05-13 17:45:56 +00:00
Guido van Rossum 0e351f34c5 Finally found a wat to set a file nonblocking that works on Irix,
Solaris and Linux: use os.O_NONBLOCK.
1997-05-12 22:15:52 +00:00
Guido van Rossum d0f2372cb9 Modernized for 1.5 1997-05-09 03:21:44 +00:00
Guido van Rossum 57c30f6f37 Regenerated on a newer Linux version. 1997-05-09 02:21:06 +00:00
Guido van Rossum 16dffdca1a Fix the NDELAY test; avoid outputting binary garbage. 1997-05-09 02:06:05 +00:00
Guido van Rossum f518d5e98e Print less in test_socket. 1997-05-09 01:54:45 +00:00
Guido van Rossum 16cd332aab Add root.tkraise() to the _test() program so the window doesn't hide
behind the shell window on NT.
1997-05-09 00:59:43 +00:00
Guido van Rossum de554ece41 The usual. 1997-05-08 23:14:57 +00:00
Guido van Rossum 6dd87830d0 Improve getting the mailbox from the environment. 1997-05-08 23:11:52 +00:00
Guido van Rossum 56f78d9e3c Set correct RFC number. 1997-05-08 23:11:04 +00:00
Guido van Rossum 25107deb9f Set correct RFC number. Open input in binary. 1997-05-08 23:10:42 +00:00
Fred Drake 526749b678 Misc.__init__(): Removed method, replaced with class attribute (which
was all that the method set anyway).  Removed calls to the
	constructor.  This reduces the number of Python function calls
	per widget construction by one, for every widget construction.
1997-05-03 04:16:23 +00:00
Guido van Rossum 1526219431 Adding Jeremy Hylton's gzip module.
This requires Andrew Kuchling's zlib extension module.
It still needs some doc strings.
1997-04-30 16:04:57 +00:00
Guido van Rossum 9d0a3dfa3d Transformed comments to doc strings.
Added symlinks option to copytree.
1997-04-29 14:45:19 +00:00
Guido van Rossum a2baf46c89 Reindented at 4 spaces. 1997-04-29 14:06:46 +00:00
Guido van Rossum 5980845bd5 Add feature to copy(), copy2(): dst may be a directory.
Remove unneeded check for '.' / '..' from copytree().
Add some comments.
1997-04-29 14:06:05 +00:00
Guido van Rossum 277206b08e Improvements to copyfile(): open the files in binary mode, and close
them in a finally clause.
1997-04-29 13:08:15 +00:00
Guido van Rossum 8be9a11617 Restore two features of the original 1.4 pickle:
- which_module() search __main__ last;

- load_inst() no longer checks that the classname really refers to a class.
1997-04-25 19:52:29 +00:00
Guido van Rossum faeae5cd78 Alas, I have to restore 'marshal', since it is needed by the new
cPickle-compatible pickle, and pickle must be importable in restricted
mode.  I guess I'll have to make marshal safe.
1997-04-25 19:10:15 +00:00
Guido van Rossum caa9f234bc Change inspired by Tommy Burnette to add an interface to get stderr, too. 1997-04-21 14:15:55 +00:00
Fred Drake 5fd026dc5e Fix a couple of glitches identified by Greg Stein. 1997-04-18 13:54:13 +00:00
Fred Drake f39d0516b4 _safe_repr(): Make the context parameter required; ok since it's only for
internal use.  Make sure the maxlevels and level parameters get
	passed to recursive invocations.
1997-04-16 18:55:58 +00:00
Fred Drake a89fda0fe2 Muchly changed and improved pprint.py:
- handles recursive data structures
	- formatting based on a PrettyPrinter object
	- allows a maximum nesting depth to be specified
	- provides safe repr()-like function which does not pretty-print
1997-04-16 16:59:30 +00:00
Guido van Rossum ab0d1afdf3 spliturl() should not throw away everything past first newline 1997-04-16 15:17:06 +00:00
Guido van Rossum 0c5e049c75 Reindented with 4 spaces. 1997-04-16 02:47:12 +00:00
Guido van Rossum 7cfd31ee8a Rewrite parsesequence() to emulate MH without invoking pick.
Test it extensively by using pick.
1997-04-16 02:45:08 +00:00
Guido van Rossum 5e92affc54 Checking in a copy of Fred Drake's data structure pretty-printer
(with some slight formatting changes).

Feature requests:

- Make it a class (everything should be a class);

- support recursive data structures (like pp.py on the ftp contrib site).
1997-04-16 00:49:59 +00:00
Guido van Rossum 7aa9fc5642 Use uuencoded test images. 1997-04-16 00:30:45 +00:00
Guido van Rossum 684480f419 Soft failure for Win32 and Mac platforms. Less output unless verbose. 1997-04-16 00:29:59 +00:00
Guido van Rossum cc5a91dc4f Soft failure for Win32 platform. 1997-04-16 00:29:15 +00:00
Guido van Rossum 505043f35e No need to define assert, it's built in. 1997-04-16 00:27:45 +00:00
Guido van Rossum 103cc6dd11 Patch by Craig McPheeters to clean up the back-references to widgets
contained in commands created by those same widgets.
1997-04-14 13:30:24 +00:00
Guido van Rossum 5a56649e09 Remove Digital Creations copyright (Jim sez it's okay). 1997-04-11 22:31:56 +00:00
Guido van Rossum 62bd30c430 Catch and report ValueError raised by strftime. 1997-04-11 22:26:42 +00:00
Guido van Rossum 54a1d0bc69 (Jack+Guido:) interpret ../ in basejoin() according to RFC1808. 1997-04-11 19:09:51 +00:00
Guido van Rossum c511aee0e3 Open files in binary mode. 1997-04-11 19:01:48 +00:00
Guido van Rossum f4f756cf55 (Jack:) Better MacOS support. 1997-04-11 19:00:53 +00:00
Guido van Rossum 9e3307494d (Jack:) Recognize PNG files. 1997-04-11 18:59:38 +00:00
Guido van Rossum 5f32248d56 From: Clarence Gardner <clarence@king.silcom.com>
The function parse_qs currently calls urllib.unquote on the
value of the field submitted, but not on the name.  It needs
to do both.
1997-04-11 18:20:42 +00:00
Guido van Rossum a3d9e02593 base64 support by Sjoerd. 1997-04-11 15:22:56 +00:00
Guido van Rossum cb5cf9b186 Use uuencoded test images. 1997-04-09 21:25:01 +00:00
Guido van Rossum cee1dd3f9d Don't just die when an error is not defined; print a warning instead.
This for errno-challenged platforms like Windows.
1997-04-09 21:02:17 +00:00
Guido van Rossum a6ed2254e1 Try calling getpid() from /usr/lib/libc.so instead of some other
random things.
1997-04-09 20:57:52 +00:00
Guido van Rossum c9f8f1467e Use TESTFN instead of /etc/passwd and /dev/null as test files. 1997-04-09 20:51:54 +00:00
Guido van Rossum 47065620f2 support module for cPickle 1997-04-09 17:44:11 +00:00
Guido van Rossum b72cf2d697 New version by Digital Creations, supports binary format compatible
with cPickle.
1997-04-09 17:32:51 +00:00
Guido van Rossum de65527e4b Ping's latest. Fixes triple quoted strings ending in odd
#backslashes, and other stuff I don't know.
1997-04-09 17:15:54 +00:00
Guido van Rossum 3ccd2f153f while (1) -> while 1. Sorry. 1997-04-08 19:46:53 +00:00
Guido van Rossum 2ebaa1796e Search for a valid begin line instead of requiring the first line. 1997-04-08 19:46:02 +00:00
Guido van Rossum 1aec32363f Ka-Ping's muich improved version of March 26, 1997:
#     Ignore now accepts \f as whitespace.  Operator now includes '**'.
#     Ignore and Special now accept \n or \r\n at the end of a line.
#     Imagnumber is new.  Expfloat is corrected to reject '0e4'.
1997-04-08 14:24:39 +00:00
Guido van Rossum 228b8e88bc Whole lotta changes. 1997-04-02 06:13:34 +00:00
Guido van Rossum 21aa0ef351 Changed my mind on replace().
It's now replace(str, old, new, maxsplit=0).
Note new ordering of parameters (string first);
this is more consistent with translate().
1997-04-02 05:49:46 +00:00
Guido van Rossum aa925a5efd Add #! line. 1997-04-02 05:47:39 +00:00
Guido van Rossum ab096c91e2 New doc strings. 1997-04-02 05:47:11 +00:00
Guido van Rossum fd79566d0f Fix two small bugs with proxies. 1997-04-02 05:46:35 +00:00
Guido van Rossum a9a3575e26 New symbols due to assert statement. 1997-04-02 05:46:05 +00:00
Guido van Rossum c1a4ba97b7 New test output for test_builtin 1997-04-02 05:44:51 +00:00
Guido van Rossum 659a3b5881 Optimized the hell out of listmessages().
Changed numericprog regexpr to make it faster to check.
Removed now unnecessary checks for os.curdir, os.pardir.
1997-04-02 01:18:30 +00:00
Guido van Rossum dddf7a6fb4 Added test of complex() (that catches a bug in 1.4!).
Added test that ensures that int() and long() truncate float numbers
towards zero.
1997-03-31 17:13:17 +00:00
Guido van Rossum bfc3944bfd Change by Andrew Kuchling (edited by Guido):
Removed unused import tempfile.

Added some docstrings.
1997-03-25 21:58:08 +00:00
Guido van Rossum 1eb9a81eb9 Added new functions replace() and replace1(). 1997-03-25 16:50:31 +00:00
Roger E. Masse 4fc7067055 Added a 'sync' method to shelve. If the underlying database does not have a sync
attribute, this method silently ignores this fact.  The default (bsddb's dbhash) does.
1997-03-25 16:06:03 +00:00
Guido van Rossum 3ee6b195bb Removed 'marshal' from the list of "ok" built-in functions -- the
unmarshalling code is actually rather naive and can easily be
caused to crash by feeding it invalid data.  This should be fixed in
the marshal module, but I don't have the time to fix it now :-(
1997-03-21 21:18:16 +00:00
Guido van Rossum 4d81984011 Ping's new version -- more efficient at finding the keywords. 1997-03-20 20:40:45 +00:00
Guido van Rossum 3d99e35884 Added __assert__. 1997-03-20 19:46:41 +00:00
Guido van Rossum eb8c972648 Ka-Ping Yee's version is better:
Here's a "keyword" module which, in the spirit of "token.py", updates
the list of keywords automatically from a source file (in this case,
"graminit.c" seemed like a reasonable choice, easier than "Grammar/Grammar").

You get "kwlist", a sorted list of keywords; "kwdict", a dictionary
mapping each keyword to 1; and "iskeyword", a function which tells
you if a given string happens to be a keyword.
1997-03-20 19:45:51 +00:00
Guido van Rossum 90d556fb6e Simple module to publish list of Python keywords. 1997-03-20 19:44:30 +00:00
Guido van Rossum f789ee4a86 Avoid crashes with nested multipart/mixed parts. 1997-03-20 14:42:17 +00:00
Guido van Rossum efd3a3a843 Implement find_class() without exec statement. 1997-03-14 04:21:10 +00:00
Guido van Rossum c69955343c Change the list() function to match the documentation in the comment
(it should return a list of tuples, not a list of lists).
1997-03-14 04:18:20 +00:00
Guido van Rossum 56d1e3a517 Added Fred Drake's netrc parser class. 1997-03-14 04:16:54 +00:00
Guido van Rossum 18aef3c102 Support disassembly of a variety of objects through dis.dis(). 1997-03-14 04:15:43 +00:00
Guido van Rossum 7b7c578616 Add optional 4th argument to [r]find and [r]index (end of slice). 1997-03-14 04:13:56 +00:00
Fred Drake ef8dc06c01 compile(): Use the __debug__ flag to determine the proper filename extension
to use for the cached module code object.
1997-03-13 14:13:16 +00:00
Guido van Rossum b5dc5e3d7e Added support for imaginary constants (e.g. 0j, 1j, 1.0j). 1997-03-10 23:17:01 +00:00
Guido van Rossum 27e280dc77 Restore old behavior of autotest and testall, using regrtest.
This is done for backward compatibility with Python 1.4.
1997-03-07 21:05:43 +00:00
Guido van Rossum f58ed25967 Add "extra-verbose" mode, triggered by specifying two -v flags. In
this mode, all tests are run in verbose mode with their output to
stdout.  No comparing of output is done.
1997-03-07 21:04:33 +00:00
Guido van Rossum e69be3eb93 Much more rigorous testing -- we now try many times, varying in time
of day, day of week, and season.

Fix the weekday predictions -- these seemed to be all bogus.  The new
predictions seem to correspond with strftime() on Solaris and IRIX, so
I believe they are correct.

Get rid of the test for non-standard format %C returning "the same as
date(1)".  This is hard to do reliably without opening a pipe to date,
and moreover, on IRIX 6.2, %C yields the Century.  So we use that
instead.  (We don't complain about this in non-verbose mode anyway.)
1997-03-07 20:30:03 +00:00
Guido van Rossum b51eaa183e Fixed doc string, added __version__, fixed 1 bug. 1997-03-07 00:21:55 +00:00
Guido van Rossum fc6f5339a9 Ka-Ping's version. 1997-03-07 00:21:12 +00:00
Guido van Rossum 2a0711d8db Removing this -- complex numbers are now builtin,
and there is already a similar demo in Demo/classes/Complex.py.
1997-02-23 05:37:36 +00:00
Guido van Rossum ad183bbfe6 Removed nonstandard strftime formats (strftime is tested more
extensively in test_strftime.py anyway).
1997-02-20 16:23:01 +00:00
Guido van Rossum 78016145d6 Remove some bogus code that would cause a NameError if a -r option was passed. 1997-02-19 20:07:38 +00:00
Guido van Rossum 13ddde0653 Remove %n and %t from the list of standard expectations. 1997-02-19 16:25:52 +00:00
Barry Warsaw 19302de7a0 join(): Wax the incorrect leading comment 1997-02-18 22:06:21 +00:00
Barry Warsaw 384d249006 join(): join one or more path components 1997-02-18 21:53:25 +00:00
Barry Warsaw b67a25c079 Store the current regex syntax along with the regular expression
string as the key to the cache.  This means that changing the syntax
will return the correct compiled pattern.

clear_cache(): New function.
1997-02-18 18:52:55 +00:00
Guido van Rossum 152f9d9663 Put back #! /usr/local/bin/python. For cgi scripts, /usr/bin/env is
unlikely to find a python binary, as /usr/local/bin is usually not on
the default search path.
1997-02-18 16:55:33 +00:00
Guido van Rossum 9580609ba3 Require _tkinter -- don't attempt to import tkinter when _tkinter does
not exist.  All 8 uses of tkinter are replaced with _tkinter.  Still
create a variable tkinter though, because that is used by other
modules importing Tkinter (e.g. tkinter.createfilehandler()).

Also added a comment to the 'import _tkinter' line saying that if this
fails, Python is not configured correctly.
1997-02-15 18:33:24 +00:00
Guido van Rossum 764d6c7acd Gave the Listbox selection methods their correct (longer) names.
Removed select_adjust -- Tk no longer supports this.
1997-02-14 16:21:16 +00:00
Guido van Rossum c8504e2764 Added test for ratecv (from Sjoerd, reformatted). 1997-02-14 15:58:00 +00:00
Guido van Rossum 17ca992818 Put support for a cnf dictionary back in, since it is still supported
by all true Tkinter widgets.  (Not that I *like* this module -- it
stinks, but until I have something better, I can't nuke it.)
1997-02-12 16:49:57 +00:00
Guido van Rossum 50b82e8e18 Merged in Jack's fixes. This brings some lines beyond 79 chars again;
I'll clean that up later.  Also corrected a mistake introduced by the
previous reformatting: an 'else' belonging to a 'for' was accidentally
reindented to belong to the 'if' inside the 'for'.  Note that the
module uses inconsistent indentation -- most code is indented with 8
spaces, but some of the reformatted code uses 4 spaces.  I'll fix this
later in the promised cleanup pass.
1997-02-11 16:39:31 +00:00
Guido van Rossum 838cb28290 Put a new, more useful, set of references in the leading comment. 1997-02-10 17:51:56 +00:00
Guido van Rossum d23d9409f3 Move the 'import os' in URLopener.cleanup() to inside the block
guarded by 'if self.tempcache', to reduce the likelihood of this
causing an exception when invoked during __del__...
1997-01-30 15:54:58 +00:00
Guido van Rossum bbf8c2fafd Skip Montanaro's robots.txt parser. 1997-01-30 03:18:23 +00:00
Guido van Rossum fc167c6ba2 Did nobody ever notice that "make test" didn't print the summary line
any more?  This was because the *parent* process in test_socket.py did
an os._exit(0)!  Getting rid of that now...
1997-01-29 16:03:45 +00:00
Guido van Rossum 866016b92d new.code() has grown another foot, eh, another two arguments. 1997-01-27 23:25:37 +00:00
Guido van Rossum 73e122f563 Fix splitext() to go up to the last dot, not the first. 1997-01-22 00:17:26 +00:00
Guido van Rossum 76f587b7f8 Avoid traceback in selection_own_get() when no Tk widget owns the
selection; return None instead.
1997-01-21 23:22:03 +00:00
Guido van Rossum 04f2b453bb Version 1.1. Fix memory leak and expensive comparison with None. 1997-01-18 02:20:37 +00:00
Guido van Rossum e9fd28dae5 Add stacksize argument to new.code(). 1997-01-17 21:12:06 +00:00
Guido van Rossum 00f86e6086 Of course, when the type of the argument to dis() is unsupported, it
should raise TypeError, not ValueError...
1997-01-17 20:08:18 +00:00
Guido van Rossum bd30795192 More user friedly interface:
dis() still disassembles the last frame of the lats stack trace.

dis(x) disassembles x, which may be a code object, function, or method.

disassemble(co, [lasti]) disassembles a code object; the lasti
argument is now optional.

disco(...) is an alias for disassemble(...), for backward compatibility.
1997-01-17 20:05:04 +00:00
Guido van Rossum 1d1394e660 Make as sure as we can that the forked child does not return and
continue the tests.
1997-01-17 16:13:15 +00:00
Roger E. Masse 5c7e711bb1 Test output for the SGI cl C module test script. 1997-01-17 15:59:16 +00:00
Roger E. Masse 69ed964f86 Lame test script for the SGI cl C module. 1997-01-17 15:58:35 +00:00
Roger E. Masse eca63b83ac Output from test script for the bsddb C extension module. 1997-01-16 22:04:35 +00:00
Roger E. Masse 352e186749 Test script for the bsddb C extension module. 1997-01-16 22:04:10 +00:00
Roger E. Masse 3b039faf19 Minor output message change 1997-01-16 18:53:01 +00:00
Guido van Rossum d0bc9cb869 Merge several mods:
- add opcodes BINARY_LSHIFT ... BINARY_OR

- remove RESERVE_FAST

- Skip M's suggestion for displaying which comparison operator is meant
1997-01-16 18:52:24 +00:00
Roger E. Masse 469848a1ea As per GvR recomendations, remove the restriction that binhex only run on
big-endian machines.  This is done by directing the struct module's pack
and unpack methods to treat the data always in bin endian format.
This has been tested on irix (big endian) and solaris x86 (little endian)
but not yet on the mac.
1997-01-16 16:51:57 +00:00
Roger E. Masse 4852d37fdd test output for the binascii C module test script. 1997-01-16 16:44:40 +00:00
Roger E. Masse 2a1c83441d test script for the binascii C module. 1997-01-16 16:44:09 +00:00
Barry Warsaw e4d7821ea4 test is no longer needed 1997-01-16 00:13:11 +00:00
Roger E. Masse 52a6ea7b7d Opps. Added tests for the last two methods that were missing from
the test program: 'grey2rgb' and 'rgb2grey'
1997-01-15 20:58:55 +00:00
Roger E. Masse e17ec8d149 Modified to use 'rgbimg' instead of the SGI specific 'imgfile' for reading
the imagefiles and converting tham to a format suitable for imageop.  Also
added two more tests 'rgb2rgb8' and 'rgb82rgb' which remove the dependence
on the file 'greytest.rgb'.

Note: test_imgfile.py still uses 'greytest.rgb'
1997-01-15 20:07:07 +00:00
Guido van Rossum 1ce7c6fde8 Irix 6 specific files -- thanks Sjoerd! 1997-01-15 19:19:19 +00:00
Barry Warsaw bd8a91198d test(): close the pipe, just to shut up Purify. 1997-01-14 17:49:15 +00:00
Barry Warsaw 7e98bda43b Raise ConversionError instances the new fangled way, e.g.:
raise ConversionError, msg

where `msg' is passed as the argument to the constructor.
1997-01-14 17:11:02 +00:00
Barry Warsaw 7a515b9156 Output for test of the timing module 1997-01-13 23:03:54 +00:00
Barry Warsaw a6aca46fcb Test of the timing module 1997-01-13 23:03:07 +00:00
Barry Warsaw 5b456645fb Use the new regrtest harness 1997-01-13 22:54:27 +00:00
Barry Warsaw 6f332d8f35 updated the hex(-16) test since hex() of a signed literal has changed. 1997-01-13 22:36:29 +00:00
Barry Warsaw 906a5e9c68 updated the oct(-100) test since oct() of a signed literal has changed. 1997-01-13 22:36:03 +00:00
Barry Warsaw 3de721d073 Catch sunaudiodev.error on open() and re-raise TestFailed exception. 1997-01-13 20:53:46 +00:00
Barry Warsaw 59e066e73b Oops, remove debugging statements 1997-01-13 20:50:40 +00:00
Barry Warsaw b241c42192 A slightly better test of sunaudiodev module. Include the audio data
in the distribution.
1997-01-13 20:34:44 +00:00
Barry Warsaw dbfb8d4626 Rewrite the `hostname mismatch' test as per GvR suggestion.
Don't assume gethostbyaddr()'s primary hostname is the same as
gethostname(), or even that gethostname() can be found in the list of
hosts returned by gethostbyaddr().  We do test for at least one FQDN
in gethostbyaddr().
1997-01-13 19:35:39 +00:00
Guido van Rossum 265b5b3f03 Use new struct which supports standardized sizes 1997-01-11 19:22:11 +00:00
Guido van Rossum 88b85d4f63 Add __len__ method 1997-01-11 19:21:33 +00:00
Guido van Rossum afe3ebfa5c Use newer struct, which handles unsigned long right 1997-01-11 19:21:09 +00:00
Fred Drake 4de02d9722 (ftplib.py): Added parse150() function and FTP.ntransfercmd(). This allows
access to the expected size of a transfer when available.
1997-01-10 18:26:09 +00:00
Fred Drake 41dc09d10e (Tkinter.py): Add support for Frame(w, class_="classname") as an alternative
to Frame(w, cnf={"class": "classname"}).  I think this is the only
	widget other than Toplevel that needs to be concerned about setting
	the widget's class (-class must be the first option on the Tcl
	widget creation command).
1997-01-10 15:13:12 +00:00
Barry Warsaw 5bc697dd31 Test of the sunaudiodev module -- it simply plays a sound if it can
find one and doesn't output any data that can be verified.  If it
can't find a sound file by looking in the standard Solaris locations
(which we can extend later), it raises an ImportError.
1997-01-07 21:05:29 +00:00
Barry Warsaw dce1005908 Added an os._exit(0) in the parent so we don't have two test processes
after test_socket.py is run!
1997-01-07 21:02:06 +00:00
Barry Warsaw 95f92dfad4 New output file for strop test 1997-01-06 22:46:45 +00:00
Barry Warsaw da0e520bc0 Added a couple of strop.join() tests for large lists and long items
within the lists (new output file to be checked in shortly).
1997-01-06 22:46:07 +00:00
Guido van Rossum 7fc0bf8247 Fix the following bug:
- When dragging the mouse in either listbox, the *first* entry
clicked on is selected rather than the last (but the last one is
highlighted).

This is done by changing the bindtags so that our binding is executed
after the default binding (which sets the 'active' index to the last
item selected), and using 'active' instead of 'anchor' as the index to
ask for.
1997-01-03 23:39:26 +00:00
Roger E. Masse 32e949d1f2 This is a very inobstrusive test for the existance of the SGI cd module
and all it's attributes.  More comprehensive examples can be found in
Demo/cd and require that you have a CD and a CD ROM drive
1997-01-03 23:00:13 +00:00
Roger E. Masse 5150542b8f Output file for test_cd.py 1997-01-03 22:58:43 +00:00
Guido van Rossum 9d1a02ce33 Some small changes.
Raise ImportError instead of SystemExit when $DISPLAY is not set, so
regrtest.py will do the right thing.

Add a call to gl.clear() to clear the window before drawing in it.

Add some verbose prints for completeness.

Use gl.v2i() for the coordinates of one of the lines, for a little bit
of variety.

Reduce the time the window is displayed from 5 to 2 seconds.
1997-01-03 22:42:08 +00:00
Roger E. Masse 4a9ac0612d Output file for test_al.py 1997-01-03 22:39:31 +00:00
Roger E. Masse 1f983df3bd This is a very inobstrusive test for the existance of the al module and all
it's attributes.  More comprehensive examples can be found in Demo/al
1997-01-03 22:39:03 +00:00
Barry Warsaw 61bc874b19 Output of socket module test. 1997-01-03 20:04:09 +00:00
Barry Warsaw cf3d4b5123 Test of the socket module. The following functions and methods are
not currently tested (or even touched):

#	socket.fromfd()
# 	sktobj.getsockopt()
#	sktobj.recvfrom()
#	sktobj.sendto()
#	sktobj.setblocking()
# 	sktobj.setsockopt()
#	sktobj.shutdown()
1997-01-03 20:03:32 +00:00
Roger E. Masse 7a61f871a7 Updated to include the verbose flag from test_support 1997-01-03 19:20:17 +00:00
Guido van Rossum 04ebf5ca5d Change the ``calcsize*3'' test to be portable to 64-bit machines. 1997-01-03 19:00:37 +00:00
Barry Warsaw 461a1c172f Output for signal module test 1997-01-03 16:01:20 +00:00
Guido van Rossum 420c11c6aa Added f/d tests for specific byte orders. 1997-01-03 00:09:46 +00:00
Guido van Rossum 6083f0e9ce Use the new struct module's ability to pack and unpack standardized
data formats.  The _xdr module is no longer used, since struct
supports the required IEEE floats and doubles.

(I have one doubt about not using _xdr.  The struct module doesn't
handle Inf, NaN and gradual underflow correctly.  If the _xdr module
does these things better, it may still have a (small) competitive
advantage.  On the other hand, since not all platforms support IEEE
floating point, it's not clear that it would be a good idea to ever
transfer Inf or NaNs.  Gradual underflow can be fixed in the struct
module.
1997-01-02 22:52:15 +00:00
Barry Warsaw 5afafad82d <rotorobj>.setkey() now requires exactly one argument 1997-01-02 20:02:44 +00:00
Guido van Rossum b02092a9b2 Added characteristics of shttp, https, and snews. 1997-01-02 18:18:27 +00:00
Guido van Rossum 6757748641 Properly parenthesize a long Boolean combination. Formerly, you could
pass invalid seed values.
1997-01-02 18:13:35 +00:00
Fred Drake 2823168c46 (formatter.py): Add a flush() method to the writer interface. This really
needs to be a standard part of the interface, so we'll have it in
	for the next release.
1996-12-31 20:50:51 +00:00
Guido van Rossum 2a37850273 Exercise the new feature set somewhat.
Use TestFailed exception and verbose flag from test_support module.
1996-12-31 17:25:47 +00:00
Guido van Rossum 36bb181cdf Rewrote _{read,write}_{short,long} to use the newly revamped struct
module.  (Small problem: struct.pack() won't deal with the Python long
ints returned by struct.unpack() for the 'L' format.  Worked around
that for now.)
1996-12-31 05:57:34 +00:00
Guido van Rossum c17a268398 Added support for RFC 850 style dates, as used by some HTTP servers
(such as Netscape-Commerce and CERN).

An example of a RFC 850 date: 'Wednesday, 18-Dec-96 21:00:00 GMT'

From: Chris Lawrence <quango@themall.net>
1996-12-27 15:42:35 +00:00
Guido van Rossum 178ff353e8 Fix bogus implementation of Group.bind().
Added unbind() to CanvasItem and Group classes.
1996-12-27 15:40:31 +00:00
Guido van Rossum 8371013f9a Added config(ure) method to Image class.
(Fred Drake)
1996-12-27 15:33:17 +00:00
Guido van Rossum 0b96b945b8 Change the default values for IntVar and DoubleVar to numbers (they
were strings, accidentally).
1996-12-27 15:30:20 +00:00
Guido van Rossum 671dc20efc Crude but effective hack to clear the parser cache every so often.
(Fred Drake.)
1996-12-27 15:26:15 +00:00
Roger E. Masse cf284cc5db Test output for the gl C extension module. 1996-12-24 19:36:33 +00:00
Roger E. Masse 6da2953f1e gl is a *huge* module. This is a very simple test that insures that
all the modules attributes are present and creates a small criss-cross
window for 5 seconds (example from the documentation :-)  A more
comprehensive test would probably be useful... but maybe overkill.
1996-12-24 19:36:07 +00:00
Barry Warsaw fb817cd4a2 Output files
test_rotor.py: New test of the rotor module.

test_*: converted to the new test harness.  GvR note!  test_signal.py
works interatively (i.e. when verbose=1) but does not work inside the
test harness.  It must be a timing issue, but I haven't figured it out
yet.
1996-12-23 23:40:11 +00:00
Barry Warsaw 5e056bbb76 test_rotor.py: New test of the rotor module.
test_*: converted to the new test harness.  GvR note!  test_signal.py
works interatively (i.e. when verbose=1) but does not work inside the
test harness.  It must be a timing issue, but I haven't figured it out
yet.
1996-12-23 23:39:42 +00:00
Roger E. Masse f85f052035 Very very small comment change. 1996-12-20 22:39:24 +00:00
Roger E. Masse fab8ab8067 Many scripts, but small changes. Update the way the scripts obtain the
'verbose' flag ala GvR updated test harness architecture.

Old way:

	verbose = 0
	if __name__ == '__main__':
		verbose = 1

New way:

	from test_support import verbose

Some other small readablility and functionality updates.
1996-12-20 22:36:52 +00:00
Barry Warsaw 4b722788ae added test of the regex module
[NOTE: testall.py and autotest.py might could go away soon, I've
 played with Guido's new regrtest.py script and it seems to work well.
 I'll wait until Guido gives the word to completely switch over -- and
 change the Makefile too!]
1996-12-20 22:00:21 +00:00
Roger E. Masse 4455cd8e19 More and better comments. 1996-12-20 21:52:29 +00:00
Roger E. Masse 3507f502c9 Minor semantic cleanup. 1996-12-20 21:47:58 +00:00
Roger E. Masse e9e0bd90ae Output for test script for the SGI imgfile module. 1996-12-20 21:42:09 +00:00
Roger E. Masse 033d91b784 Test script for the SGI imgfile module. 1996-12-20 21:41:50 +00:00
Roger E. Masse 470dcbf8e3 8 bit greyscale test file needed for testing imageop and imgfile. 1996-12-20 20:50:10 +00:00
Roger E. Masse 47e98307e0 Test program for the SGI imageop module. 1996-12-20 20:49:06 +00:00
Roger E. Masse cfaac40e31 test output for SGI imageop C module. 1996-12-20 20:47:17 +00:00
Guido van Rossum 0b25a662e0 Two new files (to shut up regrtest). 1996-12-20 03:14:42 +00:00
Guido van Rossum 4f30aff585 Added example DL for SGI IRIX. 1996-12-20 03:13:36 +00:00
Guido van Rossum 4fdb744f53 Added test for minmax. 1996-12-20 03:13:06 +00:00
Guido van Rossum 152494aea2 New regression test harness. See usage message / doc string. 1996-12-20 03:12:20 +00:00
Guido van Rossum 2bde783a97 Import verbose flag from test_support instead of testing __name__. 1996-12-20 03:03:39 +00:00
Guido van Rossum 0a94cc788e Set test_support.verbose to 0, to signal tests only to generate
portable output.
1996-12-20 03:03:01 +00:00
Guido van Rossum 531661c1ae Add verbose flag for regression test to clear. 1996-12-20 02:58:22 +00:00
Barry Warsaw a09ec19a33 Test of the operator module 1996-12-18 19:56:22 +00:00
Roger E. Masse 96bd636ad1 Test script output for the UNIX group file access module (grp) 1996-12-18 19:37:07 +00:00
Roger E. Masse 749cc6b241 Test script for the UNIX group file access module (grp) 1996-12-18 19:36:34 +00:00
Guido van Rossum 5eaf457869 Different operation in verbose mode: show the supported nonstandard
options.  Also added two: %n and %t (newline and tab character).
1996-12-18 18:03:10 +00:00
Barry Warsaw af82a7ef49 In lieu of harness rewrite, fixed problem with test_thread ImportError
triggering a bogus TestFailed exception.
1996-12-18 16:39:31 +00:00
Roger E. Masse d87e0bf651 Test output for the GNU dbm module (gdbm) 1996-12-17 19:54:46 +00:00
Roger E. Masse 62a017c092 Test script for the GNU dbm module (gdbm) 1996-12-17 19:54:27 +00:00
Roger E. Masse 0bff94ffdf Added the test output for fcntl. 1996-12-17 17:41:36 +00:00
Roger E. Masse fb01d4b1a4 Added a test script for the fcntl C module. 1996-12-17 17:41:09 +00:00
Barry Warsaw 8069f43815 Output for _xdr module test 1996-12-17 00:02:45 +00:00
Barry Warsaw 3863fb53b8 A test of the _xdrmodule (not the entire xdr.py module). 1996-12-17 00:00:53 +00:00
Barry Warsaw 237efc5d6f Added _xdrmodule test 1996-12-17 00:00:17 +00:00
Barry Warsaw ac3acc2b48 (test_thread): output from thread test 1996-12-16 23:42:56 +00:00
Barry Warsaw af0a1a6530 (test_thread.py): modifications to quiet it up when not running as a script.
(testall.py): added test_thread to the list of regression tests.
1996-12-16 23:42:35 +00:00
Fred Drake 09bcf8c031 (sgmllib.py): Partial acceptance of patch from David Leonard
<leonard@dstc.edu.au>; allows hyphen and period in the middle
	of attribute names.  Still not allowed as first character;
	as first character these are illegal in the Reference Concrete
	Syntax, and we've not identified any use of these characters as
	the first char in an attribute name in deployment on the web.
1996-12-16 21:56:27 +00:00
Roger E. Masse b6454e58bc Updated test_crypt test to jive with bwarsaw testing style 1996-12-16 20:44:56 +00:00
Roger E. Masse a38ab505b6 Revised output for test_crypt 1996-12-16 20:44:16 +00:00
Roger E. Masse 9c6db35a1e Revised test for errno ala bwarsaw's testing paradigm. 1996-12-16 20:40:20 +00:00
Roger E. Masse 8a51de4cdd Output files for test_dl and test_errno 1996-12-16 20:36:05 +00:00
Roger E. Masse e00d4da7fa Added test_dl to harness 1996-12-16 20:34:43 +00:00
Roger E. Masse 2362b58952 Revised strategy for testing recomended by bwarsaw 1996-12-16 20:25:44 +00:00
Roger E. Masse 8ba76d3cf3 Added test_errno to the test suite 1996-12-16 20:20:33 +00:00
Roger E. Masse 7eee08d04f Test for the dl module. This only works for SunOS and Solaris.
I've attempted to make a test that silently exits if either
module dl is not present, we're not on a Sun OS, or a standard
shared library ('/usr/lib/libresolv.so') is not found...  Otherwise,
It does a simple test of dlmodule on that library.  I *think*
this would be ok to add to testall.py but I'll wait till I hear
some feedback on the liberalness of this approach.
1996-12-13 20:32:26 +00:00
Barry Warsaw 2cc8163e30 nonstandard_expectations is only added when in verbose mode, so we
don't need the if test for verbosity when checking for results of an
unsupported option.
1996-12-13 18:12:34 +00:00
Barry Warsaw 4c23b5fdbc Hmm, now that I think about it, we *can* use time.time() and 'date' if
running verbose.
1996-12-13 18:08:58 +00:00
Barry Warsaw 4eb01cd372 More or less portabilized.
1. If a conversion isn't supported on the current platform, just
   ignore it, unless running as a script (i.e. verbose)

2. Don't use time.time() and os.popen('date') to get the raw values.
   These will always be different!
1996-12-13 18:07:07 +00:00
Barry Warsaw 3c700ed613 Fixed 1996-12-13 18:05:28 +00:00
Guido van Rossum 0564e12367 Added quote_plus() and unquote_plus(), to do space/plus substitutions
for form field values.
1996-12-13 14:47:36 +00:00
Barry Warsaw e3c0170ba0 Output file for module struct test 1996-12-13 00:25:52 +00:00
Guido van Rossum 27eb14d894 Added support for 4-channel on SGI.
Allow specifying the test file on the command line.
1996-12-13 00:19:56 +00:00
Guido van Rossum 25bcdb0e56 Added QUADRO. 1996-12-13 00:19:15 +00:00
Guido van Rossum 0caa7ec206 Fixed conversion between seconds and milliseconds. 1996-12-12 23:42:20 +00:00
Barry Warsaw 07a0eeceaa A test of the struct module 1996-12-12 23:34:06 +00:00
Barry Warsaw cb17a465eb Print final report, either all tests OK, or list of failed and missing
tests.
1996-12-12 22:34:26 +00:00
Barry Warsaw 1c92eba2dd Print a more meaningful message when a test's output file wasn't
found.
1996-12-12 22:21:10 +00:00
Guido van Rossum 32616fbee6 Make sure ok_builtin_modules, ok_dynamic_modules and
builtin_module_names are always tuples.
1996-12-12 21:31:52 +00:00
Guido van Rossum 15d1079dd2 Fixed test_strftime to be silent when called from autotest. 1996-12-12 19:07:19 +00:00
Guido van Rossum 483705c5a9 Added test_strftime (Skip Montanaro). 1996-12-12 19:03:11 +00:00
Guido van Rossum 6cdd7a0433 Add mktime_tz() which turns a date_tz 10-tuple into a standard Unix timestamp. 1996-12-12 18:39:54 +00:00
Guido van Rossum c0967cd4a2 Added a bunch of new winfo options; we should now be up to date with
Tk 4.2.  The new winfo options supported are: mananger, pointerx,
pointerxy, pointery, server, viewable, visualid, visualsavailable.

Also fixed bugs in winfo_colormapfull() and winfo_containing().
1996-12-12 16:43:05 +00:00
Barry Warsaw 792c94a320 A test of the select module that is actually reproduceable! 1996-12-11 23:58:46 +00:00
Barry Warsaw 042a207061 Output of rgbimg module test 1996-12-11 21:42:38 +00:00
Barry Warsaw 8bc74ceb8b Added test of rgbimg module 1996-12-11 21:41:42 +00:00
Barry Warsaw 66e7f3ac43 minor formatting nit 1996-12-11 21:40:04 +00:00
Guido van Rossum dbfed710a1 Be more careful with the shuffling of stdout. 1996-12-11 16:54:54 +00:00
Barry Warsaw d96dfb72ea Output of the nis and pwd module tests 1996-12-11 16:54:15 +00:00
Barry Warsaw 3d070fb391 Test of the pwd module 1996-12-11 16:53:51 +00:00
Barry Warsaw ebfa2c4417 Added test_pwd 1996-12-11 16:52:56 +00:00
Guido van Rossum 2b6c2faa64 Rewrite without using try-except to break out of two loops. 1996-12-11 16:28:30 +00:00
Barry Warsaw 870d5c67ae Just test one key/value pair for one NIS map. I.e. don't test them
all because it can take a really long time.
1996-12-11 16:07:30 +00:00
Barry Warsaw 3236b334ef test of the nis module 1996-12-11 01:01:38 +00:00
Barry Warsaw 7822681992 added test_nis 1996-12-11 01:01:09 +00:00
Barry Warsaw dde5c70c8a Test output files in their new location 1996-12-10 23:20:09 +00:00
Barry Warsaw e4a252ef88 Directory for test output files: Output => output 1996-12-10 23:19:14 +00:00
Barry Warsaw 2e644a0f86 When run as a script, runs each test and sends results to stdout
(i.e. this restores the old functionality).

Note that if a test couldn't be imported, it is just ignored (and no
warning is printed).
1996-12-10 23:10:39 +00:00
Barry Warsaw 272c00b634 New regression testing harness.
(testall.out): obsolete.  see individual test output files in the
Output directory.

(testall.py): now contains only the list of all tests

(autotest.py): The new testing harness.  Supports -g option to
generate output files instead of verifying; -w option to warn about
non-tested optional modules; additional command line arguments to
generate or test individual tests (useful for generating output file
of new tests).
1996-12-10 19:51:10 +00:00
Barry Warsaw 924e5d55b7 A test of the `new' module. The new.code() test is fairly bogus since
I'm really not sure what the proper inputs are.  I do flex the
function call though by passing in arguments of the proper type.  I
don't try to exec the code object that gets returned!
1996-12-10 16:28:53 +00:00
Barry Warsaw 0f150e41be Added test_new. 1996-12-10 16:27:16 +00:00
Guido van Rossum 5de1f8dac8 The usual; added several test modules, too. 1996-12-10 16:02:14 +00:00
Guido van Rossum bd01374da8 Add optional data argument to urlopen() and open_http(), to trigger POST. 1996-12-10 16:00:28 +00:00
Guido van Rossum 8b82baa398 In the HTTP reply header, be more accepting in the HTTP version. 1996-12-10 15:58:22 +00:00
Roger E. Masse 16f9fd2bcf Added a test script for dbmmodule.c and added it to testall.py and
updated testall.out
1996-12-10 00:06:24 +00:00
Barry Warsaw 3ac30af867 Added test_new 1996-12-10 00:02:57 +00:00
Roger E. Masse 75362381b5 new test script for cryptmodule.py 1996-12-09 23:13:45 +00:00
Roger E. Masse b6b85ddc95 Test script/output for cryptmodule.c added to testall.py and testall.out 1996-12-09 23:13:07 +00:00
Roger E. Masse 3daddda165 New test module for complex math module 1996-12-09 22:59:15 +00:00
Roger E. Masse b71035782e Added test_cmath.py to test complex math module 1996-12-09 22:58:42 +00:00
Barry Warsaw 3ab26b9d75 (testall.py): Slightly improved test harness to make it easier to add
simple tests.

(testall.py, testall.out): Added MD5 testsuite
1996-12-09 22:34:15 +00:00
Barry Warsaw 49852831fc Added test_strop 1996-12-09 21:49:55 +00:00
Barry Warsaw ad522facf7 Added tests of all strop module functions, and touching of module
variables
1996-12-09 21:49:10 +00:00
Guido van Rossum 6c832ebfe9 Added test_array output line. 1996-12-09 21:37:33 +00:00
Roger E. Masse 8db1b0764b module to test the arraymodule created and added to testall.py 1996-12-09 20:09:16 +00:00
Barry Warsaw 6ab7f077ff Added test_time 1996-12-06 23:30:49 +00:00
Barry Warsaw 5bebca2ac2 Added 'test_time' 1996-12-06 23:30:33 +00:00
Barry Warsaw b0c2232011 test of time module. not terribly fancy, but it does touch every
function and variable in the module, verifies a few return values and
even tests a couple of known error conditions.
1996-12-06 23:30:07 +00:00
Barry Warsaw 75eccc5bcf Unpacker.get_buffer(): new method to access the internal buffer of data 1996-12-04 22:04:39 +00:00
Guido van Rossum f06ee5fa07 /usr/local/bin/python -> /usr/bin/env python 1996-11-27 19:52:01 +00:00
Guido van Rossum 29e77816f5 Added safeguard against failure in __del__. 1996-11-27 19:39:58 +00:00
Guido van Rossum 40a172c779 Added ALL='all'. 1996-11-20 22:20:21 +00:00
Guido van Rossum 58103d3b11 Turn leading minus sign into underscore for image widget name -- the
hyphen confused Tk into thinking the name was an option.
1996-11-20 22:17:38 +00:00
Guido van Rossum 27cb8a4884 Added support for timezone in date field. getdate_tz() and
parsedate_tz() return a 10-tuple, the last field is the tz offset in
seconds (e.g. -18000 or -5 hours for EST).
1996-11-20 22:12:26 +00:00
Guido van Rossum 3c8484e866 When re-raising an exception raised by a module used internally as
IOError, keep the traceback.
1996-11-20 22:02:24 +00:00
Guido van Rossum 3508d60f99 When removing a messge from all sequences, don't remove from 'cur',
which needs to stay unless explicitly set.
1996-11-12 04:15:47 +00:00
Guido van Rossum e08c04c387 Added 'strict_parsing' option to all parsing functions. This causes a
ValueError exception when the query string contains fields that don't
contain exactly one '=' sign.  (By default, such fields are simply
ignored.)  Added this to the doc string describing parse() and
parse_qs().

Also changed the default for keep_blank_values from None to 0 (the
preferred way to spell 'FALSE').
1996-11-11 19:29:11 +00:00
Guido van Rossum 73eba25f5f Don't require leading '-' on option name to Text.tag_cget 1996-11-11 19:10:58 +00:00
Guido van Rossum c5d7e80739 Fix the way the Authorization header is sent (how could this have worked?). 1996-11-11 19:01:17 +00:00
Guido van Rossum c45289cb81 The usual :-( 1996-10-24 22:27:16 +00:00
Guido van Rossum 40f7a55608 Get rid of bogus binding of <Delete> to a function that deletes the next
character (this is already a built-in binding now).
1996-10-24 18:34:36 +00:00
Guido van Rossum 16d5b113f6 Fix truncated paragraph in doc string.
Bump version to 2.0.
1996-10-24 14:44:32 +00:00
Guido van Rossum 9b67621b66 Cast mtime gotten from stat() to long int -- else it won't work
on the Mac.

Jack!  Please fix this in the Mac distributions!
1996-10-24 13:42:30 +00:00
Guido van Rossum d804bab721 Make self.rfile unbuffered (self.wfile already is). This should fix
CGIHTTPServer.py when used with the POST command.
1996-10-23 14:30:23 +00:00
Guido van Rossum 149574767c Added support for floating point resolution to Scale.get(). 1996-10-23 14:16:28 +00:00
Guido van Rossum 176f10e3d5 Get rid of evil workaround for Python 1.4b2 bug. 1996-10-22 18:59:47 +00:00
Guido van Rossum 5b1b33c7f4 Fix another case where... 1996-10-22 13:28:37 +00:00
Guido van Rossum 9cb018e693 Change the default seeding -- use 8 bits of sub-second precision and
fold in the higest 8 bits of the time as well.
1996-10-21 23:20:03 +00:00