Commit Graph

2858 Commits

Author SHA1 Message Date
Guido van Rossum 8f0c5a7742 Marc-Andre Lemburg: the maxsplit argument for split() and replace()
now defaults to -1, not to 0.  Passing an explicit zero doesn't split
or replace at all.
2000-03-10 23:22:10 +00:00
Guido van Rossum 0612d84155 Module codecs -- Python Codec Registry, API and helpers. Written by
Marc-Andre Lemburg.
2000-03-10 23:20:43 +00:00
Guido van Rossum b5f2f1bb6f Marc-Andre Lemburg: support pickling Unicode objects, both in text
mode ('V') and in binary mode ('X').
2000-03-10 23:20:09 +00:00
Guido van Rossum 85eacecaa0 Marc-Andre Lemburg: add UnicodeType. 2000-03-10 23:18:11 +00:00
Guido van Rossum 0229bf6001 Marc-Andre Lemburg: Unicode encodings. 2000-03-10 23:17:24 +00:00
Guido van Rossum 21288edad0 Marc-Andre Lemburg: Add UnicodeError, derived from ValueError. 2000-03-10 23:16:02 +00:00
Greg Ward 92f3377078 Catch up with change to CCompiler API: call 'create_static_lib()', not
'link_static_lib()'.
2000-03-10 02:02:44 +00:00
Greg Ward 09fc542b27 Renamed 'link_static_lib() to 'create_static_lib()', and rewrote it create
a static library (using lib.exe as found by '__init__()', hopefully through
registry entries pointing to DevStudio).
2000-03-10 01:49:26 +00:00
Greg Ward 036c805958 Renamed 'link_static_lib() to 'create_static_lib()'. 2000-03-10 01:48:32 +00:00
Fred Drake c1ee39a99e There are a few places which can raise DistutilsPlatformError; make
sure it's imported!  ;)

Re-wrap the docstrings on get_python_inc() and get_python_lib() to be
closer to the "normal" Python style.  See GvR's "style guide" on the
essays page (http://www.python.org/doc/essays/).

There should never be a space between a function name and the '(' that
opens the argument list (see the style guide again).
2000-03-09 15:54:52 +00:00
Greg Ward 7d73b9eb18 Added Joe Van Andel's 'get_python_inc()', adapted by me to supply
the platform-neutral include dir by default and with Mac support.
Added 'get_python_lib()', inspired by 'get_python_inc()'.
Rewrote 'get_config_h_filename()' and 'get_makefile_filename()'
  in terms of 'get_python_inc()' and 'get_python_lib()'.
Changed '_init_nt()' and '_init_mac()' to use 'get_python_inc()' and
  'get_python_lib()' for directory names.
2000-03-09 03:16:05 +00:00
Guido van Rossum da2361ac1d Add tests for char in string -- including required exceptions for
non-char in string.
2000-03-07 15:52:01 +00:00
Guido van Rossum 2663c13c5b Sjoerd Mullender:
The (relatively) new chunk module uses seek, not setpos.  One instance
of the call still needed to be fixed.
2000-03-07 15:19:31 +00:00
Greg Ward 911d86693b Patch from Corran Webster <cwebster@nevada.edu> (tweaked for style by me):
changed 'copy_file()' to use the native Mac file copy routine.
2000-03-07 03:34:16 +00:00
Greg Ward 0eff87a570 Patch from Corran Webster <cwebster@nevada.edu>: add '_init_mac()'. 2000-03-07 03:30:09 +00:00
Greg Ward 5091929c2c Added 'native_path()' for use on pathnames from the setup script: split on
slashes, and put back together again using the local directory separator.
2000-03-07 03:27:08 +00:00
Greg Ward e2b4452d0c Added '_nt_quote_args()' to deal with whitespace in command-line arguments
in a rather half-assed, but probably effective, way.
2000-03-07 03:25:20 +00:00
Guido van Rossum 7344741117 test_contains output 2000-03-06 21:08:08 +00:00
Guido van Rossum 24512e6a35 Test cases for __contains__ code, by Moshe Zadka. 2000-03-06 21:00:29 +00:00
Guido van Rossum e85c93f521 Sjoerd Mullender:
When you set a breakpoint on a function with a multi-line argument
list, the breakpoint is actually set on the second line of the
arguments instead of the first line of the body.  This patch fixes
that.
2000-03-06 20:39:59 +00:00
Jeremy Hylton f728f9a13e import compile function form pycodegen 2000-03-06 19:12:33 +00:00
Jeremy Hylton 7fab23e9cb rename compile.py to pycodegen.py
fix imports
remove parse functions and visitor code
track name change: Classdef to Class

add some comments and tweak order of visitXXX methods

get rid of if __name__ == "__main__ section
2000-03-06 19:10:54 +00:00
Jeremy Hylton 8c78341f45 add a doc string
import some useful functions from contained modules
2000-03-06 19:04:14 +00:00
Jeremy Hylton 9812e7bc6a fix import to refer to compiler package 2000-03-06 18:54:30 +00:00
Jeremy Hylton abd7ebf70b revise arguments for addCode method on lnotab. take several numbers
that are internally converted to chars, rather than taking a string.
2000-03-06 18:53:14 +00:00
Jeremy Hylton fa974a9d06 change node Classdef to Class
add doc string to transformer module
add two helper functions:
    parse(buf) -> AST
    parseFile(path) -> AST
2000-03-06 18:50:48 +00:00
Jeremy Hylton ed9586174d factor out the tree walking/visitor code that was in compile.py 2000-03-06 18:49:31 +00:00
Greg Ward 9552665436 Rewrote 'newer_pairwise(): more natural (and incompatible) interface,
simpler implementation.
2000-03-06 03:44:32 +00:00
Greg Ward 32c4a8a0ee Serious overhaul of the C compiler interface and the two classes that
implement it (so far):
  * moved filename generation methods into CCompiler base class,
    driven by data supplied by implementation classes
  * moved a bunch of common code from UnixCCompiler to convenience
    methods in CCompiler
  * overhauled MSVCCompiler's compile/link methods to look and act
    as much as possible like UnixCCompiler's, in order to regularize
    both interface and behaviour (especially by using those new
    convenience methods)
2000-03-06 03:40:29 +00:00
Greg Ward eb3f75e636 Don't pass 'keep_dir' to 'compile()' method of CCompiler -- no longer used. 2000-03-06 03:37:45 +00:00
Greg Ward 4ba5da418c Don't pass 'keep_dir' to 'compile()' method of CCompiler -- no longer used.
Don't assume that the 'libraries' and 'library_dirs' elements of the
  build info dict are always lists.
2000-03-06 03:36:50 +00:00
Jeremy Hylton 820314ea95 allow comments beginning with ; in key: value as well as key = value 2000-03-03 20:43:57 +00:00
Greg Ward 56359f591b Typo fix. 2000-03-03 03:00:27 +00:00
Greg Ward 96182d7b68 Fixed 'mkpath()' to accept empty string silently (it's just the current dir).
Fixed all DistutilsFileError messages to wrap file/dir names in quotes.
2000-03-03 03:00:02 +00:00
Greg Ward 76ec0d6d76 Renamed 'build_lib' command to 'build_clib':
* replaced build_lib.py with build_clib.py
  * renamed the class in build_clib.py
  * changed all references to 'build_lib' command in other command classes
2000-03-02 01:57:12 +00:00
Greg Ward 3ce77fd05e Changed '__rcsid__' to '__revision__'. 2000-03-02 01:49:45 +00:00
Greg Ward 60f64330d1 If the "build_lib" command built any C libraries, link with them all
when building extensions (uses build_lib's 'get_library_names()' method).
Ensure that the relative structure of source filenames is preserved in
  the temporary build tree, eg. foo/bar.c compiles to
  build/temp.<plat>/foo/bar.o.
2000-03-02 01:32:21 +00:00
Greg Ward 833dfd52e5 Added command description.
Added 'build_clib' and 'build_temp' options (where to put C libraries
  and where to put temporary compiler by-products, ie. object files).
Moved the call to 'check_library_list()' from 'run()' to 'finalize_options()'
  -- that way, if we're going to crash we do so earlier, and we guarantee
  that the library list is valid before we do anything (not just run).
Disallow directory separators in library names -- the compiled library
  always goes right in 'build_clib'.
Added 'get_library_names()', so the "build_ext" command knows what
  libraries to link every extension with.
2000-03-02 01:27:36 +00:00
Greg Ward 49ffce173e In the 'compile()' method: preserve the directory portion of source
filenames when constructing object filenames, even if output_dir given --
eg. "foo/bar.c" will compile to "foo/bar.o" without an output_dir, and to
"temp/foo/bar.o" if output_dir is "temp".
2000-03-02 01:21:54 +00:00
Greg Ward f1146572dd In compile/link methods: ensure that the directory we expect to be writing to
exists before calling the compiler/linker.
2000-03-01 14:43:49 +00:00
Greg Ward 013f0c8636 Added 'mkpath()' method: convenience wrapper around 'util.mkpath()' that adds
the compiler objects 'verbose' and 'dry_run' flags.
2000-03-01 14:43:12 +00:00
Greg Ward 611850bbb3 Added call to 'ensure_ready()' on the command object in
'Distribution.find_command_obj()'.
2000-03-01 14:42:07 +00:00
Greg Ward 585df89f60 Added 'get_platform()' to construct a string that identifies the current
platform, using 'os.uname()' or 'sys.platform'.
2000-03-01 14:40:15 +00:00
Greg Ward e51d69efb0 Build reorg:
* 'build_dir' -> 'build_lib', which by default takes its value
    straight from 'build_lib' in the 'build' command
  * added 'build_temp' and 'inplace' options
  * change 'build_extensions()' to put object files (compiler turds) in
    'build_temp' dir
  * complicated the name-of-extension-file shenanigans in
    'build_extensions()' to support "in-place" extension building, i.e.
    put the extension right into the source tree (handy for developers)
  * added 'get_ext_fullname()', renamed 'extension_filename()' to
    'get_ext_filename()', and tweaked the latter a bit -- all to support
    the new filename shenanigans
2000-03-01 01:43:28 +00:00
Greg Ward 42a3bf564a Build reorg:
* 'build_lib' -> 'build_purelib'
  * new 'build_lib' and 'build_temp' options
  * use 'get_platform()' to initialize 'build_platlib' and 'build_temp'
2000-03-01 01:26:45 +00:00
Greg Ward e691651682 Build reorg: change 'build_dir' option to 'build_lib'. 2000-03-01 01:19:37 +00:00
Guido van Rossum a9b2b4be26 Remove some redundant logic from walk() -- there's no need to check
for "." and "..", since listdir() no longer returns those.
2000-02-29 13:31:16 +00:00
Andrew M. Kuchling 39d3bfc4c2 Fix a typo in a comment 2000-02-29 00:10:24 +00:00
Fred Drake 1ab41fc680 Fix comments relating to the specific regexs used to parse section and
option names; errors noted by Greg Stein <gstein@lyra.org>.
2000-02-28 23:23:55 +00:00
Guido van Rossum 619c33787b Patch by Piers Lauder, who writes:
This patch is re: Lucas.Dejonge@awtpl.com.au: [Python-bugs-list] imaplib -
not complying with RFC (PR#218)

Lucas de Jonge reported that the code in imaplib that detects a read-write
to read-only change doesn't comply with RFC 2060.
2000-02-28 22:37:30 +00:00
Fred Drake c517b9b406 (Finally!) Changes related to the ConfigParser/INI-file topics
discussed on c.l.py last January.  Specifically:
  - more characters allowed in section & option names
  - if '=' is used to separate the option & value, the value can be
    followed by a comment of the form '\s;'
2000-02-28 20:59:03 +00:00
Guido van Rossum 98d9fd3e68 Simple changes by Gerrit Holl - move author acknowledgements out of
docstrings into comments.
2000-02-28 15:12:25 +00:00
Guido van Rossum 84a74595f7 Patch by Gerrit Holl to avoid doing two stat() calls in a row in walk(). 2000-02-28 14:27:07 +00:00
Guido van Rossum 0ba33002e1 Fix a typo in Barry's checkin.
Reported both by Gerrit Holl and Mark Favas.
2000-02-27 15:35:47 +00:00
Guido van Rossum d28de23bda Fixed a multi-arg append() call, discovered by Mark Favas.
Also removed some unnecessary backslases (inside parens).
2000-02-27 15:34:29 +00:00
Greg Ward 7a0620c3a5 Try to deal with pre-1.5.2 IOError exception objects. 2000-02-26 00:49:40 +00:00
Greg Ward 4f08e4facb Unfinished, untested implementation of the lovely baroque installation scheme
cooked up by Fred Drake and me.  Only saved for posterity (whoever posterity
is), as it is about to be ditched in favour of GvR's much simpler design.
2000-02-26 00:49:04 +00:00
Barry Warsaw 7d3f27c090 Changes inspired by Randall Hooper to allow callbacks when an
OptionMenu is modified.  Somewhat rewritten and elaborated by myself.

class _setit: The constructor now takes an optional argument
`callback' and stashes this in a private variable.  If set, the
__call__() method will invoke this callback after the variable's value
has changed.  It will pass the callback the value, followed by any
args passed to __call__().

class OptionMenu: The constructor now takes keyword arguments, the
only one that's legally recognized is `command', which can be set to a
callback.  This callback is invoked when the OptionMenu value is set.
Any other keyword argument throws a TclError.
2000-02-25 21:54:19 +00:00
Guido van Rossum f7221c3a7d Test case for fork1() behavior.
Only the main thread should survive in the child after a fork().
2000-02-25 19:25:05 +00:00
Guido van Rossum e6674e6fc6 Gerrit forgot to remove the "import string". 2000-02-25 16:34:11 +00:00
Fred Drake a395ced424 Gerrit Holl's patch to move attribution from the docstring to a
comment.  <gerrit@nl.linux.org>
2000-02-25 16:14:08 +00:00
Guido van Rossum 2341794667 Fix a couple broken append() calls, spotted by Tim. 2000-02-25 11:48:42 +00:00
Guido van Rossum 3af7b050a3 Fix a broken r.append(name, value) call, spotted by Tim. 2000-02-25 11:44:03 +00:00
Guido van Rossum d5062babed Moshe Zadka:
Added docstrings to tkSimpleDialog.py
2000-02-24 15:01:43 +00:00
Greg Ward 4840112121 Fix from est@hyperreal.org: missing initialize in 'find_defaults()'. 2000-02-24 03:17:43 +00:00
Guido van Rossum 9811861e3c Mark Favas discovered this: getatime() accidentally returned the MTIME!
This fixes PR#211.
2000-02-24 02:26:51 +00:00
Guido van Rossum 19ce91be92 Piers Lauder:
A change in my last patch could, under certain circumstances,
	cause a loop if the connection to the server dropped while
	waiting for a command completion. I've changed the code to
	re-raise the error after possible debugging output.
2000-02-24 02:24:50 +00:00
Andrew M. Kuchling 5ebfa2ae9f Add tests to exercise sequence operations (multiplication, indexing,
slicing) using long integers
2000-02-23 22:23:17 +00:00
Guido van Rossum dc6883365b Added tabnanny.py, by Tim Peters, formerly from Tools/scripts, to the
standard library.  Added some comments:

# XXX Note: this is now a standard library module.
# XXX The API needs to undergo changes however; the current code is too
# XXX script-like.  This will be addressed later.
2000-02-23 15:32:19 +00:00
Jeremy Hylton 772dd417f7 satisfy the tabnanny (thanks to MH for noticing the problem) 2000-02-21 22:46:00 +00:00
Greg Stein 42b9bc7a7d add TODO section 2000-02-19 13:36:23 +00:00
Greg Stein 3bb578c128 reduce fsimp coupling: provide fs_imp param to ImportManager constructor,
add clsFilesystemImporter class attribute, alter handling of suffix list
convert suffix importers to funcs rather than instances
remove backwards compat code: Importer.install and 2-tuple get_code()
  result values
2000-02-18 13:04:10 +00:00
Greg Stein d4f1d2074e shift demo importers to importers.py (destined for Demo/ ?)
switch to isinstance() rather than direct type comparisons
removing chaining concept
update ImportManager.install() to take an optional namespace to install
  itself in. this will be useful for setting up rexec environments.
minor comment nits
2000-02-18 12:03:40 +00:00
Greg Ward 18c05f240e Changed all references to command methods 'set_default_options()' and
'set_final_options()' to 'initialize_options()' and 'finalize_options()'.
2000-02-18 00:36:20 +00:00
Greg Ward e01149cbe8 Renamed 'set_default_options()' to 'initialize_options()', and
'set_final_options()' to 'finalize_options()'.
2000-02-18 00:35:22 +00:00
Greg Ward 4c96db1a65 Changed references to the command class 'options' attribute to 'user_options'.
Related docstring changes.
Unrelated comment changes.
2000-02-18 00:26:23 +00:00
Greg Ward bbeceeaf9a Renamed all 'options' class attributes to 'user_options'. 2000-02-18 00:25:39 +00:00
Greg Ward 592f28272e Command classes are now named identically to their commands, so reflect this
in 'find_command_class()' method.
2000-02-18 00:14:21 +00:00
Greg Ward 1993f9ad0e Renamed all command classes so they're exactly the same as the name of the
command itself: no more of this "FooBar class for foo_bar command"
silliness.
2000-02-18 00:13:53 +00:00
Greg Ward e1b1c94a0c Changed 'dist' to 'sdist'. 2000-02-18 00:11:52 +00:00
Greg Ward a82122b887 The 'sdist' command to create a source distribution. This is derived from the
old 'dist' command, but the code for dealing with manifests is completely
redone -- and renaming the command to 'sdist' is more symmetric with the
soon-to-exist 'bdist' command.
2000-02-17 23:56:15 +00:00
Greg Ward 3d6b023f5c The 'dist' command is dead -- long live the 'sdist' command! 2000-02-17 23:54:55 +00:00
Jeremy Hylton efd0694a2d changes to _lookupName
- removed now (happily) unused second arg
- need to verify results of [].index are correct; for building consts,
  need to have same value and same type, e.g. 2 not the same as 2L
2000-02-17 22:58:54 +00:00
Jeremy Hylton 3ec7e2c4be the previous quick hack to fix def foo((x,y)) failed on some cases
(big surprise).  new solution is a little less hackish.

Code gen adds a TupleArg instance in the argument slot. The tuple arg
includes a copy of the names that it is responsble for binding.  The
PyAssembler uses this information to calculate the correct argcount.

all fix this wacky case: del (a, ((b,), c)), d
which is the same as: del a, b, c, d
(Can't wait for Guido to tell me why.)

solution uses findOp which walks a tree to find out whether it
contains OP_ASSIGN or OP_DELETE or ...
2000-02-17 22:09:35 +00:00
Jeremy Hylton 7708d697ee add varargs and kwargs flags to Lambda nodes 2000-02-17 22:06:20 +00:00
Jeremy Hylton 873bdc18e4 satisfy the tabnanny
fix broken references to filename var in generateXXX methods
2000-02-17 17:56:29 +00:00
Fred Drake ef0b5dd080 Typo in a comment: "wheter" --> "whether" 2000-02-17 17:30:40 +00:00
Guido van Rossum f36b1823c4 Patches by Piers Lauder.
Reasons for patches:

1st patch (15,21):
	version change

2nd patch (66,72):
	This is a patch I found in a Zope product release (quite by accident!).
	It relaxes the conditions for matching a literal. I've looked over the
	logic, and tested it, and it seems sensible.

3rd patch (117,123):
	It appears the quoting matcher was too general, and that the IMAP4
	protocol requires characters like ':' in commands to be unquoted.
	(This is the patch already sent to Guido.)

4th patch (699,705):
	Spelling correction in comment.

5th patch (753,761):
	Another patch from the Zope product. It seems that some IMAP4 servers
	produce unexpected responses in the middle of valid command/response
	sequences. This patch ignores the unexpected responses in this
	situation. (How I wish users would send me bug reports with examples!).

last 2 patches: (1015,1028) (1038,1044):
	Minor improvements to test code.
2000-02-17 17:12:39 +00:00
Guido van Rossum 1efac33755 Added WindowsError, for Mark Hammond's extensions. 2000-02-17 15:12:01 +00:00
Guido van Rossum cba04366a4 Added test for new crc32() function. 2000-02-16 21:13:06 +00:00
Jeremy Hylton ad9a86fb1c support for arglists with implicit tuple unpacks
- added a number of support methods to generate code just before the
  body
- hack protocol for communicating number of args to PyAssembler

fix TryExcept generation for case where exception handler has no body
fix visitAssAttr
add comment about incomplete visitAssName

stop using the ExampleASTVisitor

change script invocation to accept a list of .py files (e.g. Lib/*.py)
2000-02-16 00:55:44 +00:00
Jeremy Hylton 3d9f5e4de2 more robust assignment of lineno for keyword args
get the lineno from the name of the keyword arg

example of case that didn't work--
def foo(x, y, a = None,
	b = None):
2000-02-16 00:51:37 +00:00
Jeremy Hylton 2ce27b223b fix argcount generation for arg lists containing tuple unpacks
this is sort of a hack
2000-02-16 00:50:29 +00:00
Jeremy Hylton 65d4ea05d2 add flatten helper function 2000-02-16 00:49:47 +00:00
Jeremy Hylton 4f6bcd80fc finish first impl of code generator
add support for nodes TryExcept, TryFinally, Sliceobj
fix visitSubscript to properly handle x[a,b,c]
2000-02-15 23:45:26 +00:00
Jeremy Hylton 1ebba96871 fix creation of Ellipsis node 2000-02-15 23:43:19 +00:00
Jeremy Hylton 410e840c85 add a little debugging support when new.code raises SystemError 2000-02-15 21:59:50 +00:00
Jeremy Hylton ae3d79208f no real change -- testing syncmail 2000-02-15 21:57:14 +00:00
Jeremy Hylton d603dee4a3 add line numbers to nodes in the except clause (when possible) 2000-02-15 21:30:48 +00:00
Jeremy Hylton ca1ad182f2 tidy up tryexcept and tryfinally nodes 2000-02-15 21:30:00 +00:00
Jeremy Hylton 9e1cd688b5 edit a doc string
(real intent is to test out rsync install)
2000-02-14 23:57:56 +00:00
Jeremy Hylton a46fb3841b get rid of spurious print 2000-02-14 21:54:57 +00:00
Jeremy Hylton 126960b744 looks like everything is working except for try/except (pystone
compiles correctly)
2000-02-14 21:33:10 +00:00
Jeremy Hylton 17988d2a17 LeftShift & RightShift: fix reprs, change attr names to left and right
(so they are common with other binary ops)
2000-02-14 21:32:42 +00:00
Fred Drake b217687a6c Fix the question marks next to the expansions of some of the
colorspace name abbreviations, based on email from Gerrit Holl
<gerrit.holl@pobox.com>.
2000-02-14 21:30:52 +00:00
Jeremy Hylton bf6267e6f8 rename several of the generic attribute names for nodes. new node attrs are:
Exec: expr, locals, globals
Dict: items
Assert: test, fail
2000-02-14 18:34:11 +00:00
Jeremy Hylton 42907790b6 (), [], and {} should not be represented as constant expressions, they
should be calls to BUILD_ ops for these types with no arguments
2000-02-14 18:32:46 +00:00
Jeremy Hylton a50581228e split compile.py into two files
add StackDepthFinder (and remove push/pop from CodeGen)
add several nodes, including Ellipsis, Bit&|^, Exec
2000-02-14 14:14:29 +00:00
Jeremy Hylton 3050d51571 change MODULE_NAMESPACE/FUNCTION_NAMESPACE stuff to have a single flag
named OPTIMIZED, which matches compile.c and makes more sense for
classes

revamp call signature for PythonVMCode.__init__; doesn't really matter
'cuz this code is going to be refactored out of existence

add generateClassCode and modify Func & Lambda generation

add support for nodes Classdef, Keyword,

fix CallFunc to generate right op arg when calling w/ keywords

add ugly hack to properly compute offsets when the same stack ref is
used multiple times
2000-02-12 00:12:38 +00:00
Jeremy Hylton 76d01b820c add support for Lambda nodes
change resolution of local name ops (LOAD_FAST).  i think it makes
sense now.  if it is an argument or a local var name that it used, it
must be in varnames.  if it is a local var name that is used, it must
also be in names
2000-02-11 20:27:07 +00:00
Greg Ward 5de8cee73f Ditched '_find_SET()', since it was a no-value-added wrapper around
'get_msvc_paths()'.
Renamed '_do_SET()' to 'set_path_env_var()', tweaked docstring, and
  cosmetically tweaked code.
Stylistic changes to MSVCCompiler constructor (variable renaming
  and type consistency).
2000-02-11 02:52:39 +00:00
Greg Ward 699880931e Latest patch from Thomas Heller/Robin Becker:
* tweak my docstrings
  * fix None returns to empty list
  * reshuffle responsibilities between '_find_exe()', '_find_SET()', and
    the MSVCCompiler constructor -- now the constructor worries about
    fetching the version list and determining the most recent one
  * added "/W3" compile option
Also, I added/tweaked some docstrings.
2000-02-11 02:47:15 +00:00
Jeremy Hylton 4eb504c2af add loop handling via
Loop object to handle StackRegs
loops stack attr on CodeGenreeator to hold the current loop object

add support for nodes While, Break, Continue
2000-02-10 20:55:50 +00:00
Jeremy Hylton 95b8614353 add an __len__ to Set and Stack 2000-02-10 20:54:27 +00:00
Barry Warsaw 9dd7872945 Added new exception classes:
NNTPError - derived from Exception, it's the base class for all
    other exceptions in this module

    NNTPReplyError - what used to be error_reply

    NNTPTemporaryError - what used to be error_temp

    NNTPPermanentError - what used to be error_perm

    NNTPProtocolError - what used to be error_proto

    NNTPDataError - what used to be error_data

All the old names are retained for backwards compatibility; they point
to the class that replaces them.  Also, any code in this module that
raises an exception, now does so with the exception class.

NNTP.__init__(): Added a new optional argument `readermode', which is
a flag that defaults to false.  When set to true, the "mode reader"
command is sent to the NNTP server before user authentication.  Reader
mode is sometimes necessary if you are connecting to an NNTP server on
the local machine and intend to call reader-specific comamnds, such as
`group'.  If you get unexpected NNTPPermanentErrors, you might need to
set readermode.  Patch provided by Thomas Wouters (who include the
standard disclaimer on is patches@python.org submission), and inspired
by Jim Tittsler.
2000-02-10 20:25:53 +00:00
Jeremy Hylton 3e0910c10c add namespace attr to CodeGenerator, can be either MODULE_NAMESPACE or
FUNCTION_NAMESPACE.  initialize in __init__ and reset in
generateFunctionCode.

replace direct issue of STORE_FAST, STORE_GLOBAL, etc. with call to
storeName; same for loadName and deleteName

the new {store,load,delete}Name methods use the namespace attr and the
local variable stack to determine the correct bytecode to issue
2000-02-10 17:20:39 +00:00
Fred Drake 13a2c279c5 Untabify to pass the -tt test. 2000-02-10 17:17:14 +00:00
Fred Drake 857c4c36b9 Detabify.
I ran "expand" instead of using Skip's patch, but it's all the same.
2000-02-10 16:21:11 +00:00
Fred Drake ad892dc80d Make this pass the -tt test. 2000-02-10 15:31:07 +00:00
Greg Ward 62e3393e4d Stylistic changes to the registry-grovelling code: code formatting, changed
function names, dbetter (hopefully) ocstrings, and comments.
2000-02-10 02:52:42 +00:00
Greg Ward 10ca82b57c Typecheck 'output_dir' argument to compile/link methods. 2000-02-10 02:51:32 +00:00
Greg Ward 968d883be5 Path from Thomas Heller: resurrect the .def file kludge while preserving the
/export option mini-kludge.
2000-02-10 02:17:06 +00:00
Greg Ward 4ba9b2e3b6 Patch from Thomas heller:
* don't need to mention python<ver>.lib -- it's done by a pragma
  * add debug flags for compile and link, and use them
  * fix 'link_shared_library()' to pass everything to 'link_shared_object()'
  * change filename when shared object with debug info (ugh)
2000-02-10 02:15:52 +00:00
Jeremy Hylton 5e0ce53e0e add ExampleASTVisitor:
* prints out examples of nodes that are handled by visitor.  simply a
  development convenience

remove NestedCodeGenerator -- it was bogus after all
replace with generateFunctionCode, a method to call to generate code
  for a function instead of a top-level module

fix impl of visitDiscard (most pop stack)
emit lineno for pass

handle the following new node types: Import, From, Getattr, Subscript,
Slice, AssAttr, AssTuple, Mod, Not, And, Or, List

LocalNameFinder: remove names declared as globals for locals

PythonVMCode: pass arg names to constructor, force varnames to contain
them all (even if they aren't referenced)

add -q option on command line to disable stdout
2000-02-10 00:47:08 +00:00
Jeremy Hylton 69926eaee0 add remove method to set 2000-02-10 00:43:22 +00:00
Greg Ward e8c6ce4684 Added 'debug' option, and changed compile/link calls to use it. 2000-02-09 02:20:14 +00:00
Greg Ward 324620015d Added 'debug' option (just there for 'build_ext' and 'build_lib' commands
to fallback to if the user doesn't set it for those commands.
2000-02-09 02:19:49 +00:00
Greg Ward 386b84439f Added 'debug' flags to compile and link methods, and added dummy code for
someone who knows Windows/MSVC++ to come along and add the right flags.
Comment noting that 'link_static_lib()' signature is inconsistent with
  the other compiler classes (uh-oh!)
2000-02-09 02:18:39 +00:00
Greg Ward ba233fbe92 Added 'debug' flags to compile and link methods, and modified code to add
'-g' flag to compiler/linker command lines when it's true.
2000-02-09 02:17:00 +00:00
Greg Ward 3c045a5766 Added 'debug' flag to compile and link method signatures.
Doc fix: several paragraphs under 'link_static_lib()' moved to
  'link_shared_lib()', where they belong.
2000-02-09 02:16:14 +00:00
Jeremy Hylton 402456020b add optional verbose arg to walk function. it overrides the global
VERBOSE setting for the ASTVisitor

add getopt handling for one or more -v args

rename ForwardRef to StackRef, because it isn't necessarily directional

CodeGenerator:
* add assertStackEmpty method.  prints warning if stack is not empty
  when it should be
* define methods for AssName, UNARY_*, For

PythonVMCode:
* fix mix up between hasjrel and hasjabs for address calculation
2000-02-08 21:15:48 +00:00
Jeremy Hylton 156a975476 make all unary operators have a single child node called expr 2000-02-08 21:06:19 +00:00
Jeremy Hylton 1851901a05 add spaces to comparison names is not and not in to match dis 2000-02-08 19:58:33 +00:00
Jeremy Hylton 53187f32eb now produces valid pyc files for a least a trivial subset of the
language.

CodeGenerator:
* modify to track stack depth
* add emit method that call's PythonVMCode's makeCodeObject
* thread filenames through in hackish way
* set flags for code objects for modules and functions
  XXX the docs for the flags seem out of date and/or incomplete

PythonVMCode:
* add doc string describing the elements of a real code object

LineAddrTable:
* creates an lnotab (no quite correctly though)
2000-02-08 19:01:29 +00:00
Jeremy Hylton aa9d2d6123 constants from transformer 2000-02-08 18:57:51 +00:00
Jeremy Hylton 9605c11c4c move constants out of transformer so that they can be shared with ast
add varargs and kwargs attributes to Function nodes
2000-02-08 18:57:32 +00:00
Fred Drake 69e2c6efbb get_config_h_filename(): Support NT as well as Posix systems.
_init_nt():  Use get_config_h_filename() instead of figuring out the
             name directly.

             g['SO'] should be set to '.pyd'.

             Adjust some minor coding nits.
2000-02-08 15:55:42 +00:00
Greg Ward 1b9c6f7788 Revised version (thank to Thomas Heller and Robin Becker) that tries a lot
harder to find the MSVC compiler (mainly by using the registry).
2000-02-08 02:39:44 +00:00
Greg Ward f0219ba290 Ditch .def file kludge for (much smaller) /export option kludge. 2000-02-08 02:37:15 +00:00
Fred Drake a710d6e20c Added test case for accessing gsbm database by key after it's closed;
it should raise gdbm.error.
2000-02-07 17:15:48 +00:00
Greg Ward 1bea7ab7bd Added 'libraries' option for use by the 'build_lib' command.
Typo fix.
2000-02-05 02:24:52 +00:00
Greg Ward 5f7c18e816 Run the 'build_lib' command before building extensions, if necessary. 2000-02-05 02:24:16 +00:00
Greg Ward aaf27ee07b New command to build C (and C++, hopefully) libraries needed by extensions
in the current distribution: motivated by PIL's libImaging.
2000-02-05 02:23:59 +00:00
Greg Ward c1854673e2 Tweaked various comments, docstrings, and error messages. 2000-02-05 02:23:16 +00:00
Jeremy Hylton 0fdffcf916 rapid evolution towards producing real .pyc files (even though I don't
handle most of the language syntax yet)

create NestedCodeGenerator used to generator the separate code object
that needs to be passed as an argument to MAKE_FUNCTION when a def
stmt is found (probably useful for class too)

change CodeGenerator.visitFunction to use the NestedCG

add CompiledModule class to handle creation of .pyc (pretty minimal
for now)

add makeCodeObject method to PythonVMCode that replaces symbolic names
with indexes into slots of the code code.  the design of this
class will probably need to be revised.
2000-02-04 19:37:35 +00:00
Guido van Rossum 1fdae12c93 Added a simple test program to disassemble a file, invoked as __main__. 2000-02-04 17:47:55 +00:00
Guido van Rossum 4b8c6eaf8b Actually, the previous batch's comment should have been different;
*this* set of patches is Ka-Ping's final sweep:

The attached patches update the standard library so that all modules
have docstrings beginning with one-line summaries.

A new docstring was added to formatter.  The docstring for os.py
was updated to mention nt, os2, ce in addition to posix, dos, mac.
2000-02-04 15:39:30 +00:00
Guido van Rossum e7b146fb3b The third and final doc-string sweep by Ka-Ping Yee.
The attached patches update the standard library so that all modules
have docstrings beginning with one-line summaries.

A new docstring was added to formatter.  The docstring for os.py
was updated to mention nt, os2, ce in addition to posix, dos, mac.
2000-02-04 15:28:42 +00:00
Guido van Rossum 54f22ed30b More trivial comment -> docstring transformations by Ka-Ping Yee,
who writes:

Here is batch 2, as a big collection of CVS context diffs.
Along with moving comments into docstrings, i've added a
couple of missing docstrings and attempted to make sure more
module docstrings begin with a one-line summary.

I did not add docstrings to the methods in profile.py for
fear of upsetting any careful optimizations there, though
i did move class documentation into class docstrings.

The convention i'm using is to leave credits/version/copyright
type of stuff in # comments, and move the rest of the descriptive
stuff about module usage into module docstrings.  Hope this is
okay.
2000-02-04 15:10:34 +00:00
Jeremy Hylton 8b6323d3ef checking in initial weekend's work
compile.py: ASTVisitor framework plus bits of a code generator that
    should be bug-for-buf compatible with compile.c

misc.py: Set and Stack helpers

test.py: a bit of simple sample code that compile.py will work on
2000-02-04 00:28:21 +00:00
Jeremy Hylton 106a02da94 make p2c a package 2000-02-04 00:25:34 +00:00
Jeremy Hylton f968e8545d three files from the p2c cvs tree. the message here indicates the
revision number the p2c cvs tree.

COPYRIGHT: 1.1
ast.py: 1.3
transformer.py: 1.11
2000-02-04 00:25:23 +00:00
Greg Ward 7f0fb0b01e Improved an error message.
Announce when we start building each extension (better feedback).
2000-02-03 23:07:54 +00:00
Greg Ward ef6f515d49 Changed 'compile()' method to compile files one-at-a-time -- gives better
feedback and, theoretically, the opportunity to set compiler flags
on a per-file basis.
2000-02-03 23:07:19 +00:00
Fred Drake d89ffebd85 These modules are now declared obsolete. 2000-02-03 15:26:16 +00:00
Guido van Rossum 43265beff9 # module filecmp
# combo of old cmp, cmpcache and dircmp with redundancies removed
#
# bugs fixed:
#   dircmp.dircmp was not ignoring IGNORES
#   old stuff could falsely report files as "identical" when contents actually differed
#
# enhancements:
#   dircmp has a more straightforward interface
#cmp enhanced by Moshe Zadca
#dircmp enhanced byGordon McMillan

[some layout changes by GvR]
2000-02-03 00:41:22 +00:00
Guido van Rossum 75a7959335 In _fileobject, optimize read() a bit (it could be really slow), and
remove "import string" -- use string methods instead!
2000-02-02 16:57:32 +00:00
Guido van Rossum 823e91c767 Optimize abspath() slightly for the case that win32api can't be
imported; in that case, abspath is replaced by a fallback version.
2000-02-02 16:54:39 +00:00
Guido van Rossum 5606801b64 Make read() and readlines() conform more to the file object interface:
the default arg for read() is -1, not None, and readlines() has an
optional argument (which for now is ignored).
2000-02-02 16:51:06 +00:00
Guido van Rossum 4acc25bd39 Mass patch by Ka-Ping Yee:
1. Comments at the beginning of the module, before
       functions, and before classes have been turned
       into docstrings.

    2. Tabs are normalized to four spaces.

Also, removed the "remove" function from dircmp.py, which reimplements
list.remove() (it must have been very old).
2000-02-02 15:10:15 +00:00
Greg Ward 113e70efa2 Patch from Joe Van Andel: fix arg to % operator in warning. 2000-02-02 00:07:14 +00:00
Greg Ward a0ca3f24f9 Comment fix.
Always use normalized (with os.path.normpath()) versions of prefix and
  exec_prefix.
2000-02-02 00:05:14 +00:00
Guido van Rossum 3c8baedaf8 Sjoerd Mullender writes:
Fixed a TypeError: not enough arguments; expected 4, got 3.
When authentication is needed, the default http_error_401 method calls
retry_http_basic_auth.  The default version of that method expected a
data argument which wasn't provided, so now we provide the argument if
it was given and we also made the data argument optional.

Also changed other calls where data was optional to not pass data if
it was not passed to the calling method (in line with other similar
occurances).
2000-02-01 23:36:55 +00:00
Greg Ward d1466b968f Allow either README or README.txt as a "standard file". 2000-01-30 20:22:27 +00:00
Greg Ward a002edc85b Fixed broken list extend in 'copy_tree()'. 2000-01-30 19:57:48 +00:00
Greg Ward 37bc815053 Added 'description' class attribute to every command class (to help the
'--help-commands' option).
Shuffled imports around in a few command modules to avoid expensive
  up-front import of sysconfig (and resulting delays in generating list
  of all commands).
2000-01-30 18:34:15 +00:00
Greg Ward 4c67936e4e Added 'dist' command. 2000-01-30 18:31:34 +00:00
Greg Ward f0fd6175b3 Improvements to the help system:
* "--help" can now come either before or after particular commands
    to get help on and can give help on multiple commands, eg.
    "--help install dist" gives help on those two commands
  * added "--help-commands" option, implemented by the 'print_commands()'
    and 'print_command_list()' methods
2000-01-30 18:30:32 +00:00
Greg Ward 7478a4832a Added missing run of corresponding 'build' command. 2000-01-30 15:07:56 +00:00
Jeremy Hylton 6d7e47b8ea EXPERIMENTAL
An extensible library for opening URLs using a variety protocols.
Intended as a replacement for urllib.
2000-01-20 18:19:08 +00:00
Guido van Rossum 331f19e894 Change two occurrences of type(x) <> types.CodeType into
isinstance(x, types.CodeType).

Suggested by Finn Bock.
2000-01-19 21:57:30 +00:00
Greg Ward 9f200cbaa6 Fix indentation bug. 2000-01-17 21:58:07 +00:00
Greg Ward 3b49c9babd Catch OSError from 'spawnv()' in '_spawn_nt()'.
Tweaked error messages in '_spawn_posix()'.
2000-01-17 21:57:55 +00:00
Greg Ward 01f5215828 Removed /GD switch -- currently ignored by MSVC. 2000-01-17 21:57:17 +00:00
Greg Ward 8dbf681a97 Added compiler flags suggested by Thomas Heller: optimize, use multi-threaded
RT library.
2000-01-17 20:40:48 +00:00
Greg Ward 1b3a9af5cf Added missing import.
Fixed 'make_release_tree()' to copy files if 'os.link()' doesn't exist.
2000-01-17 20:23:34 +00:00
Greg Ward cbeca7b408 Added code to use Jim Ahlstrom's zipfile.py module if the external zip
command wasn't found or failed.  (Code supplied by Thomas Heller
<thomas.heller@ion-tof.com>.)
2000-01-17 18:04:04 +00:00
Greg Ward c8a95c8d5e Fix library filename methods -- there is no 'lib' prefix under DOS/Windows. 2000-01-17 18:00:04 +00:00
Greg Ward c27d800251 Always run sys.prefix and sys.exec_prefix through 'os.path.normpath()'
before storing or using.
2000-01-17 16:25:59 +00:00
Greg Ward 7c463ef362 Ditch unneeded imports. 2000-01-17 16:25:17 +00:00
Guido van Rossum 1d2b23ef22 Fix by Nick Russo in processing of timezone in test program; the
ParsedDate didn't have the correct day of week.
2000-01-17 14:11:04 +00:00
Greg Ward 7b7679eb79 'newer_group()' can now deal with missing files, in a way specified by
the 'missing' parameter.
2000-01-09 22:48:59 +00:00
Greg Ward c9f3187be2 Abstracted '_fix_link_args()' out of 'link_shared_object()'.
Added 'link_static_lib()' method, and 'archiver' and 'archiver_options'
  class attributes to support it.
Added 'link_executable()' method, and 'ld_exec' instance attribute
  to support it.
'newer_group()' is now able to handle missing files, so we don't have
  to kludge it by catching OSError when calling it.
'object_filenames()' and 'shared_object_filename()' now take 'keep_dir'
  flag parameters.
'library_filename()' and 'shared_library_filename()' now respect
  a directory component in the library name.
Various comment updates/deletions.
2000-01-09 22:47:53 +00:00
Greg Ward 5baf1c2111 Removed a bunch of irrelevant parameters from 'link_static_lib()' signature.
Added 'link_executable()' signature.
2000-01-09 22:41:02 +00:00
Greg Ward e9436da686 Typo fix: 'file.warn' should have been 'manifest.warn' in a couple of places. 2000-01-09 22:39:32 +00:00
Guido van Rossum d2783da63e The correct RFC to reference is RFC-1521 (MIME part one), not 1421 (PEM). 2000-01-03 15:44:40 +00:00
Greg Stein f23aa1ee9f redesign/rebuild around the ImportManager concept. 2000-01-03 02:38:29 +00:00
Fred Drake db1bd5c230 Revise tests to support str(<long int object>) not appending "L". 1999-12-23 15:36:42 +00:00
Fred Drake fbff97a73b Don't call len() if the value is already cached! Caught by Gerrit
Holl <gerrit.holl@pobox.com>.
1999-12-22 21:52:32 +00:00
Guido van Rossum 80c33e562d Contribution from Gerrit Holl:
This patch changes the string-based exceptions to class-based
exceptions, so that you can fetch the unknown option as an
attribute.  As far as I know, it is backward compatible.

[The new exception class is called GetoptError; the name error is an
alias for compatibility.]
1999-12-21 22:38:40 +00:00
Greg Ward 9d46b9ce97 When emitting a command-line error message, *say* it's an error. 1999-12-16 01:19:05 +00:00
Greg Ward ad83f04086 Catch errors from 'rmtree' and emit a warning. 1999-12-16 01:14:15 +00:00
Guido van Rossum cd97576184 Only set msg.fp to None when there are no extra arguments; if there
are, we must keep the file around so we can print the body.
1999-12-14 22:18:37 +00:00
Guido van Rossum 8c0622114b V 2.16 from Piers:
I've changed the login command to force proper
	quoting of the password argument. I've also added
	some extra debugging code, which is removed when
	__debug__ is false.
1999-12-13 23:27:45 +00:00
Greg Ward 97798b1d47 Use 'search', not 'match', on filename pattern regexes. 1999-12-13 21:38:57 +00:00
Greg Ward 0bdd90a7e7 Catch up with terminology change in UnixCCompiler: 'includes' -> 'include_dirs'. 1999-12-12 17:19:58 +00:00
Greg Ward 1d0495e05c Catch missing MANIFEST file and warn rather than blowing up.
Added 'nuke_release_tree()' method to blow away the directory from
  which the archive file(s) are created, and call it (conditionally)
  from 'make_distribution()'.
Added 'keep_tree' option (false by default) to disable the call to
  'nuke_release_tree()'.
1999-12-12 17:07:22 +00:00
Greg Ward 9b45443c1b Fixed 'find_package_modules()' to ensure that we never build (and thus
install) the setup script itself.
Fixed 'build_module()' so we do *not* preserve file mode (which means
  we can install read-only files, which makes the next installation
  of this distribution fail -- at least under Unix); added a comment
  explaining this.
1999-12-12 17:03:59 +00:00
Greg Ward 48697d931b Changed 'build_extensions()' so 'sources' can be a list or tuple; and
call CCompiler method 'compile()' with 'include_dirs' not 'includes'.
Fixed stupid typo in 'get_source_files()'.
1999-12-12 17:01:01 +00:00
Greg Ward 04d78328f3 In 'compile()' method, renamed 'includes' parameter to 'include_dirs' for
consistency with 'build_ext' command option.
Changed 'compile()' and 'link_shared_object()' so 'include_dirs',
  'libraries', and 'library_dirs' can be lists or tuples.
1999-12-12 16:57:47 +00:00
Greg Ward 44f8e4ea08 Added support for printing out help text from option table: 'print_help()',
'generate_help()', 'wrap_text()' functions, and a little tiny test
  of 'wrap_text()'.
Changed how caller states that one option is the boolean opposite of
  another: added 'negative_opt' parameter to 'fancy_getopt()', and changed
  to use it instead of parsing long option name.
1999-12-12 16:54:55 +00:00
Greg Ward c9c37b1c6e Made "verbose" mode the default; now you have to supply --quiet if you
want no output.  Still no option for a happy medium though.
Added "--help" global option.
Changed 'parse_command_line()' to recognize help options (both for the
  whole distribution and per-command), and to distinguish "regular run"
  and "user asked for help" by returning false in the latter case.
Also in 'parse_command_line()', detect invalid command name on command
  line by catching DistutilsModuleError.
  a 'negative_opt' class attribute right after 'global_options'; changed
  how we call 'fancy_getopt()' accordingly.
Initialize 'maintainer' and 'maintainer_email' attributes to Distribution
  to avoid AttributeError when 'author' and 'author_email' not defined.
Initialize 'help' attribute in Command constructor (to avoid
  AttributeError when user *doesn't* ask for help).
In 'setup()':
  * show usage message before dying when we catch DistutilsArgError
  * only run commands if 'parse_command_line()' returned true (that
    way, we exit immediately when a help option is found)
  * catch KeyboardInterrupt and IOError from running commands
Bulked up usage message to show --help options.
Comment, docstring, and error message tweaks.
1999-12-12 16:51:44 +00:00
Guido van Rossum 09c8b6c3e4 OpenSSL support. This is based on patches for a version of SSLeay by
Brian E Gallew, which were improved and adapted to OpenSSL 0.9.4 by
Laszlo Kovacs of HP.  Both have kindly given permission to include
the patches in the Python distribution.  Final formatting by GvR.
1999-12-07 21:37:17 +00:00
Guido van Rossum 5274c336f5 According to Craig H Rowland, openbsd2 is yet another BSD variant that
uses the BSD version of the lock structure.  Sigh, @!%$.
1999-12-06 14:51:05 +00:00
Greg Ward 631e6a0c07 [from 1999-11-04]
Bunch of little bug fixes that appeared in building non-packagized
distributions.  Mainly:
  - brain-slip typo in 'get_package_dir()'
  - don't try to os.path.join() an empty path tuple -- it doesn't like it
  - more type-safety in 'build_module()'
1999-12-03 16:18:56 +00:00
Guido van Rossum 6dfc792fea In abspath(), always use normpath(), even when win32api is available
(and even when it fails).  This avoids the problem where a trailing
separator is not removed when win32api.GetFullPathName() is used.
1999-11-30 15:00:00 +00:00
Barry Warsaw d25c1b73d2 A bunch of docstring fixes. 1999-11-28 17:11:06 +00:00
Greg Stein 32efef33ae look for builtins before stuff on the path. 1999-11-24 02:38:37 +00:00
Greg Stein 2b23413ce2 add loading of dynamic library modules. 1999-11-24 02:37:05 +00:00
Greg Stein 7ec28d298d turn SysPathImporter into PathImporter. 1999-11-20 12:31:07 +00:00
Greg Stein 72ee43527d remove the __version__ global. 1999-11-20 11:39:56 +00:00
Greg Stein 6d3165a5a1 only put __path__ into package modules. 1999-11-20 11:39:00 +00:00
Greg Stein 63faa01538 shift code from DirectoryImporter out to a common area.
remove use of "os" module (bootstrap issues) and go to the underlying
  platform-specific modules
fix problem in _compile() (trapped wrong error on permission issues)
add SysPathImporter and BuiltinImporter
put __file__ into modules imported from the filesystem. [backwards compat]
put __path__ into modules [backwards compat]
  oops: it is doing this for all modules, not just packages.
comment and tweak to the PackageArchiveImporter
1999-11-20 11:22:37 +00:00
Guido van Rossum d7b147b040 Moshe Zadka writes: When deploying SimpleHTTPServer, I noticed a
problem: it does not encode/decode the urls, which is wrong.
1999-11-16 19:04:32 +00:00
Guido van Rossum 77980a731c Correct typo in module doc string doscovered by Jonathan Giddy. 1999-11-15 14:19:15 +00:00
Guido van Rossum 768d2271a8 Oops. Remove some garbage from the doc string that was accidentally
checked in due to a patching mishap.  Reported by Detlef Lannert;
thanks!
1999-11-09 16:36:45 +00:00
Greg Stein d4c64ba0f9 Add some header comments to all the files. 1999-11-07 13:14:58 +00:00
Greg Stein 281b8d82f7 initial checkin for my Python stuff. 1999-11-07 12:54:45 +00:00
Fred Drake e4f13660f8 split() docstring: Made signature and description for the first
parameter match.  Error pointed out by François
                    Pinard <pinard@iro.umontreal.ca> on c.l.py.
1999-11-04 19:19:48 +00:00
Guido van Rossum 19878f58fe Sjoerd Mullender writes:
I regularly find that pdb sets the breakpoint on the wrong line when I
try to set a breakpoint on a function.  This fixes the problem
somewhat.
The real problem is that pdb tries to parse the Python source code to
find the first executable line.  A better way might be to inspect the
code object, or even have a variable in the code object
co_firstexecutablelineno, but that's too much work.

The patch fixes the problem when the first code line after the def
statement contains the start *and* end of a triple-quoted string.  The
code assumed that the end of a triple-quoted string is not on the same
line as the start, and so it would skip to the end of the *next*
triple-quoted string.
1999-11-03 13:10:07 +00:00
Guido van Rossum dd7cbbf4d3 Oops. spawnl() and spawnle() should be implemented on Windows too.
Also added a comment that the 'p' variants (spawnvp() etc.) are *not*
supported on Windows.  (They could be by adding them to posixmodule.c)
1999-11-02 20:44:07 +00:00
Guido van Rossum f618a48d11 Correct typo in walk.__doc__ reported by Francois Pinard. 1999-11-02 13:29:08 +00:00
Guido van Rossum 5a2ca9328d Checking in a bunch of spawn functions. These are only defined if we
have fork and execv (and friends) but not spawnv.  They operate
exactly like the spawn functions on Windows.  A limited set of needed
constants is also defined (P_WAIT, P_NOWAIT etc.).

Also add getenv() as a familiar alias for environ.get().
1999-11-02 13:27:32 +00:00
Guido van Rossum 2d72687006 New module by Moshe Zadka (submitted on Sept. 25). This unifies the
functionality of cmp.py and cmpcache.py, which are hereby declared
obsolescent.
1999-10-26 14:02:01 +00:00
Guido van Rossum 4e20de59dd Patch by Michael Hudson: when the object of attribute expansion is a
class instance, include the class attributes in the list of possible
expansions.
1999-10-26 13:09:08 +00:00
Guido van Rossum d65b53923e Fix by Moshe Zadka (cleaned up and documented by GvR) to break out the
request handling into separate parse_request() and handle_request()
methods.
1999-10-26 13:01:36 +00:00
Greg Ward e1ada50559 Don't assume GNU tar -- generate tar file and compress in separate steps.
Now supports the full range of intended formats (tar, ztar, gztar, zip).
"-f" no longer a short option for "--formats" -- conflicts with new
  global option "--force"!
1999-10-23 19:25:05 +00:00
Greg Ward d6c30f66c7 Removed massive comment speculating about needlessly complex variations
on the manifest file syntax.
1999-10-23 19:10:59 +00:00
Greg Ward 346e320c6e Qualified use of 'newer_group' function. 1999-10-23 19:06:56 +00:00
Greg Ward 6bad86462b Fix how we run 'zip' -- give explicit .zip extension. 1999-10-23 19:06:20 +00:00
Guido van Rossum bda10c81d0 In helo() and ehlo(), Don't fail when gethostbyaddr() fails -- just
keep whatever gethostname() returns.  After a suggestion by Doug Wyatt.
1999-10-22 13:09:20 +00:00
Guido van Rossum 8fa42af978 Fix PR#107: wm_colormapwindows() did the wrong thing when presented
more than one window argument.
1999-10-20 12:29:56 +00:00
Guido van Rossum 910d9a0634 Test output.
(XXX perhaps a bit too verbose; in particular it is sensitive to
all the doc strings.)
1999-10-19 19:09:00 +00:00
Guido van Rossum fdecda0123 Rewritten -- this now tests the binascii *except* for the binhex
module, which is tested by test_binhex.py.
1999-10-19 19:08:13 +00:00
Guido van Rossum a0e85b241d Test output for test_binhex.py. 1999-10-19 19:07:33 +00:00
Guido van Rossum 7b8f1abfca This test really only tests the binhex module.
Renamed it and adapted a comment and an error message.
1999-10-19 17:48:54 +00:00
Jeremy Hylton 88d23309e9 print a warning if the password will be echoed.
At import time, getpass will be bound to the appropriate
platform-specific function.  If the platform's echo-disabler is not
available, default_getpass, which prints the warning, will be used
1999-10-18 22:25:22 +00:00
Guido van Rossum f8d8e07601 Fixed PR#106: winfo_visualsavailable() with the includeids=1 option
didn't properly handle the hex numbers returned.
1999-10-18 22:06:38 +00:00
Guido van Rossum dcb8583c18 Fix for PR#111: when using the inplace option, give the new file the
same permissions as the old file, plugging a security hole.
(Not using exactly the suggested bugfix.)
1999-10-18 21:41:43 +00:00
Fred Drake 14bb71d553 os.fork raises AttributeError, not NameError, if fork() isn't
supported.  Pointed out by Moshe Zadka <moshez@math.huji.ac.il>.
1999-10-18 13:43:44 +00:00
Fred Drake 40e84db0f4 Based on comments from Paul Prescod:
If os.fork() doesn't exist, raise SystemError with an explanation at
the top of the module.  Added a note to the module docstring.
1999-10-16 02:07:50 +00:00
Barry Warsaw 226ae6ca12 Mainlining the string_methods branch. See branch revision log
messages for specific changes.
1999-10-12 19:54:53 +00:00
Jeremy Hylton 75260275fe update to use threading module instead of thread. 1999-10-12 16:20:13 +00:00
Barry Warsaw 2539451fb9 fixed a typo in a docstring, and slightly expanded the module
docstring info for readfp().
1999-10-12 16:12:48 +00:00
Guido van Rossum 1b7aec35c4 Fix PR#31 -- zfill() mishandles empty string. 1999-10-11 22:15:41 +00:00
Guido van Rossum 08a92cb568 Jeremy writes:
I found the following patch helpful in tracking down a bug in some
code.  I had appended time, the module, instead of time.time().  Not
sure if it is generally true that printing the repr of the object is
good, but I expect that most unpicklable things will have fairly
information and concise reprs (like files or sockets or modules).
1999-10-10 21:14:25 +00:00
Guido van Rossum d8957d6802 Fix PR#3, submitted by Skip Montanaro: if no space appears after the
colon, the first character of the value is lost.
1999-10-06 15:19:19 +00:00
Guido van Rossum a5a24b76f4 Added has_option(); fix bug in get() which botched interpolation if
'%(' was found in first position (found by Fred Drake).
1999-10-04 19:58:22 +00:00
Guido van Rossum 6a8d84b0c1 Urmpfh!
Withdraw the change that Fred just checked in -- it was a poorly
documented feature, not a bug, to ignore I/O errors in read().

The new docstring explains the reason for the feature:
"""
this is designed so that you can specifiy a list of potential
configuration file locations (e.g. current directory, user's home
directory, systemwide directory), and all existing configuration files
in the list will be read.
"""

Also add a lower-level function, readfp(), which takes an open file
object (and optionally a filename).

XXX There are some other problems with this module, but I don't have
time to dig into these; in particular, there are complaints that the
%(name)s substitution from the [DEFAULTS] section doesn't work
correctly.
1999-10-04 18:57:27 +00:00
Fred Drake 2438a485c8 ConfigParser.read(): Don't mask IOError exceptions. 1999-10-04 18:11:56 +00:00
Greg Ward ef93095adb Filter 'glob()' results so we only look at regular files. 1999-10-03 21:09:14 +00:00
Greg Ward 3c6204a87f Pass 'force' flag to 'new_compiler()'. 1999-10-03 21:08:42 +00:00
Greg Ward 455eb61648 Don't import what we don't use. 1999-10-03 21:07:21 +00:00
Greg Ward ef9ad6df01 Tweaked verbosity messages for byte-compilation. 1999-10-03 21:03:26 +00:00
Greg Ward 0c35ac62d8 Added 'force' and 'quiet' (negative alias for 'verbose') to the
global options table.
Every Command instance now has its own copies of the global options,
  which automatically fallback to the Distribution instance.  Changes:
  - initialize them in constructor
  - added '__getattr__()' to handle the fallback logic
  - changed every 'self.distribution.{verbose,dry_run}' in Command to
    'self.{verbose,dry_run}'.
  - filesystem utility methods ('copy_file()' et al) don't take 'update'
    parameter anymore -- instead we pass 'not force' to the underlying
    function as 'update'
Changed parsing of command line so that global options apply to all
  commands as well -- that's how (eg.) Command.verbose will be initialized.
Simplified 'make_file()' to use 'newer_group()' (from util module).
Deleted some cruft.
Some docstring tweaks.
1999-10-03 21:02:48 +00:00
Greg Ward f3b997a7f0 Fixed 'mkpath()' to normalize the path right off the bat -- cleans up
the code a bit and should make it work under Windows even with trailing
  backslash.
Fixed a couple of docstrings.
Added comment about 'make_file()' possibly being redundant and unnecessary.
1999-10-03 20:50:41 +00:00
Greg Ward a564cc315b Hacked to support the notion of "negative alias" options, to handle
-q/--quiet reasonably elegantly.
1999-10-03 20:48:53 +00:00
Greg Ward c74138d941 Catch up with changes in 'gen_lib_options()':
- change how we call it
  - added methods 'library_dir_option()', 'library_option()', and
    'find_library_file()' that it calls
Added 'force' flag; it's automatically "respected", because this class
  always rebuilds everything!  (Which it to say, "force=0" is not respected.)
1999-10-03 20:47:52 +00:00
Greg Ward 4fecfce4d0 Fixed order of link options: object files now precede library stuff.
Catch up with changes in 'gen_lib_options()':
  - change how we call it
  - added methods 'library_dir_option()', 'library_option()', and
    'find_library_file()' that it calls
Added 'force' flag and changed compile/link methods to respect it.
1999-10-03 20:45:33 +00:00
Greg Ward 3febd60682 Slight change to the meaning of the 'libraries' list: if a library name
has a directory component, then we only search for the library in
  that one directory, ie. ignore the 'library_dirs' lists for that
  one library.
Changed calling convention to 'gen_lib_options()' again: now, it takes
  a CCompiler instance and calls methods on it instead of taking
  format strings.  Also implemented the new "library name" semantics
  using the 'find_library_file()' method in the CCompiler instance.
Added 'force' flag to CCompiler; added to constructor and 'new_compiler()'.
Added 'warn()' method.
1999-10-03 20:41:02 +00:00
Guido van Rossum 8e7eaa8ac8 Duncan Grisby noted a typo in _DummyThread. 1999-09-29 15:26:52 +00:00
Greg Ward b24afe19db Added 'list_only' option (and modified 'run()' to respect it). 1999-09-29 13:14:27 +00:00
Greg Ward 274ad9dc81 Added all documentation.
Slightly improved the code for dealing with newline on a comment line,
  and for stripping whitespace.
1999-09-29 13:03:32 +00:00
Greg Ward ef4490f501 New command to generate source distribution based on a manifest file. 1999-09-29 12:50:13 +00:00
Greg Ward a6cb8ae7bc Added 'package' option.
Catch up with renamed 'platdir' -> 'build_platlib' option in 'build'.
Don't call 'set_final_options()' in 'run()' anymore -- that's now
  guaranteed to be taken care of for us by the Distribution instance.
If 'include_dirs' is a string, split it on os.pathsep (this is half-
  hearted -- support for setting compile/link options on the command
  line is totally lame and probably won't work at all).
Added 'get_source_files()' for use by 'dist' command.
Added code to 'build_extensions()' to figure out the "def file" to use
  with MSVC++ and add it to the linker command line as an "extra_postarg".
1999-09-29 12:49:35 +00:00
Greg Ward 2a612067e6 Renamed 'dir' option to be consistent with other commands.
Don't call 'set_final_options()' in 'run()' anymore -- that's now
  guaranteed to be taken care of for us by the Distribution instance.
Rearranged to bit to allow outsiders (specifically, the 'dist' command)
  to find out what modules we would build:
  - 'find_modules()' renamed to 'find_package_modules()'
  - most of 'build_modules()' abstracted out to 'find_modules()'
  - added 'get_source_files()' (for the 'dist' command to use)
  - drastically simplified 'build_modules()' -- now just a wrapper around
    'find_modules()' and 'build_module()'
1999-09-29 12:44:57 +00:00
Greg Ward e6ac2fcc12 Renamed many options to be consistent across commands.
Tweaked some help strings to be consistent with documentation.
Don't call 'set_final_options()' in 'run()' anymore -- that's now
  guaranteed to be taken care of for us by the Distribution instance.
1999-09-29 12:38:18 +00:00
Greg Ward df178f97de Catch up with latest changes in CCompiler:
- add 'extra_preargs' and 'extra_postargs' parameters (and use them!)
  - got rid of 'build_info' kludge parameter
  - added 'compiler_type' class attribute
  - respect reordered arguments to 'gen_lib_options()'
Also added 'output_dir' parameter (catching up with older change in
  CCompiler) -- BUT this is presently ignored by all methods!
Deleted some more docstrings redundant with CCompiler.
Dropped generated of "/DEF:" argument --- that's now done by
  the 'build_ext' command.
1999-09-29 12:29:10 +00:00
Greg Ward 0e3530ba28 Catch up with latest changes in CCompiler:
- add 'extra_preargs' and 'extra_postargs' parameters (and use them!)
  - added 'compiler_type' class attribute
  - respect reordered arguments to 'gen_lib_options()'
1999-09-29 12:22:50 +00:00
Greg Ward 802d6b7b4c Added 'extra_preargs' and 'extra_postargs' parameters to most methods,
which allowed us to get rid of the 'build_info' used in some places
  (a temporary kludge to support MSVC++ "def" files).
Deleted big comment whining about that kludge.
Added 'compiler_type' class attribute.
Overhauled 'new_compiler()': now takes 'compiler' argument along with
  'plat' (both optional with sensible defaults), and looks them both up
  in the new 'default_compiler' and 'compiler_class' dictionaries to
  figure out where to get the concrete compiler class from.
Reordered arguments to 'gen_lib_options()' to match the order in
  which the arguments are generated (ie. -L before -l).
1999-09-29 12:20:55 +00:00
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