Commit Graph

9350 Commits

Author SHA1 Message Date
Guido van Rossum 954b9adcd2 Document new urllib features by Eric Raymond. 1998-09-28 14:08:29 +00:00
Guido van Rossum 9ab96d40eb Changes by Eric Raymond:
1. Generate a correct Content-Length header visible through the info() method
   if a request to open an FTP URL gets a length in the response to RETR.

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

3. To avoid spurious errors, I commented out the gopher test.  The target
   document no longer exists.
1998-09-28 14:07:00 +00:00
Jack Jansen d5af7bd489 Truncate messages if they are longer than 255 characters. Note that this is
not really a good solution for default input strings...
1998-09-28 10:37:08 +00:00
Barry Warsaw a5a018fbd4 Fixed unit test 1998-09-25 22:51:36 +00:00
Barry Warsaw 9195f55bbf Updated the docstring and class hierarchy diagram 1998-09-25 22:43:21 +00:00
Barry Warsaw 4f94c73879 (py-comint-output-filter-function): Horrible kludgearound for making
the de-queing of exec files work for NT XEmacs 21.0.
1998-09-25 19:40:10 +00:00
Guido van Rossum 67906af811 In PyFrame_New(), don't set extras to something derived from code
before code has been checked for validity.  Discovered by Vladimir
Marangozov.
1998-09-25 14:11:46 +00:00
Barry Warsaw d35c255e44 (py-guess-indent-offset): Only print message about py-indent-offset
when in an interactive session (suggested by B. Wiener).
1998-09-25 00:08:38 +00:00
Barry Warsaw 02e5f69c90 (py-execute-file, py-execute-import-or-reload): Use a Python `raw'
string in the argument to execfile() so a Windows temp directory
named, e.g. c:\\tmp doesn't get interpreted as a file name with an
embedded tab!  (given by C. Waldman).
1998-09-24 23:48:40 +00:00
Guido van Rossum f7d77009c1 Add two constants (with the same value) to specify the on-board CD input. 1998-09-24 18:09:47 +00:00
Fred Drake f4cbb9c7fa Added realclean and distclean targets to match ../Makefile. 1998-09-23 17:37:14 +00:00
Guido van Rossum 4da55f0560 Add define of HAVE_STDDEF_H (to 1). Suggested by Greg Stein. 1998-09-23 13:35:45 +00:00
Guido van Rossum 5227f0fdcd Reworked it quite a bit. There are now two classes: a base class,
InteractiveInterpreter, which handles parsing and interpreter state
but doesn't know deal with buffering or prompting or input file
naming.  And a derived class, InteractiveConsole, which adds buffering
and prompting and supports setting the filename once.  Also tweak the
algorithm in compile_command() a bit so that input consisting of all
blank lines or comments always succeeds immediately, and note the fact
that apart from SyntaxError it can also raise OverflowError.
1998-09-22 20:38:53 +00:00
Barry Warsaw 218eb75ba7 (py-block-comment-prefix): Remove trailing space. Also explain that
this string should not end with whitespace.

(py-compute-indentation): Append whitespace regexp to
py-block-comment-prefix so that any combination of intervening
whitespace will be recognized.
1998-09-22 19:51:47 +00:00
Guido van Rossum 0238a25b20 Do the check for lacking sys.stdin.fileno() *before* testing for
Windows.  If sys.stdin doesn't appear to be a real file (characterized
by having a working fileno()), don't use any console specific methods
-- go straight to the default.
1998-09-22 02:38:42 +00:00
Guido van Rossum ef0056ae1a When sys.stdin.fileno() doesn't work, fall back to default_getpass()
-- don't just die.
1998-09-21 20:00:35 +00:00
Guido van Rossum 5fb2631ff9 Explicitly document the fact that the search method returns a MatchObject.
(Reported by Gary Herron.)
1998-09-21 19:26:16 +00:00
Guido van Rossum 4ecd85aad7 After the previous changes, func_normalize() turned out to be redundant.
This simplified some other places in the code.
1998-09-21 17:40:47 +00:00
Guido van Rossum b0a94c0549 Changes so that JPython can also use this version of profile.py.
Suggested by Jim Hugunin.
1998-09-21 16:52:44 +00:00
Guido van Rossum f07029e4ba Get rid of the classes RModuleLoader and RModuleImporter -- these were
only there to override reload() in a way that doesn't make a whole lot
of sense and moreover broke since the latest changes in ihooks.
1998-09-21 14:53:26 +00:00
Guido van Rossum e3f8a64906 Comment out 't = t[0] + t[1]' in profiler_simulation() -- this
function is only used when running the calibration code, and it turns
out that recent changes in the timing code caused this statement to
raise an exception.
1998-09-21 14:52:22 +00:00
Guido van Rossum 469067800b Get rid of the test for non-NULL thread state in EventHook; it can be
triggered in situations that are not an error.
1998-09-21 14:47:16 +00:00
Guido van Rossum 1b236768e7 When we have siginterrupt(), use it to disable restarting interrupted
system calls.
1998-09-21 14:46:00 +00:00
Guido van Rossum 0db4c94d09 Enable the 'new' module by default. 1998-09-21 14:45:22 +00:00
Guido van Rossum 6ac06b39b3 Patch by Greg Stein to document the 'P' flag. 1998-09-21 14:44:34 +00:00
Fred Drake 10a7985565 re.findall(): Mark as added in 1.5.2. 1998-09-18 17:11:49 +00:00
Guido van Rossum 78694d970f Patches from Greg Stein to support 'P' format in struct module's
native format, as void* (translated to Python int or long).
Also adds PyLong_FromVoidPtr and PyLong_AsVoidPtr to longobject.c.
1998-09-18 14:14:13 +00:00
Guido van Rossum 43b655c0ab Get rid of 'ppp' that accidentally crept in. 1998-09-17 17:07:15 +00:00
Jack Jansen 91b5bedf1c Added optional mouseregion parameter to WaitNextEvent (which is now
manually generated).
1998-09-17 15:28:58 +00:00
Guido van Rossum 6442116029 Richard Wolff's changes, documenting his changes to pdb.py. 1998-09-17 15:11:51 +00:00
Guido van Rossum fc076d4ce2 Untabified and applied Richard Wolff's changes (plus my own reflowing
of some paragraphs).
1998-09-17 15:01:38 +00:00
Guido van Rossum 3a98e78a6e Richard Wolff's additional changes; some layout nits, and change the
alias delimiter to ';;'.
1998-09-17 15:00:30 +00:00
Guido van Rossum 1d2e9d19fe Duplicate the decls for PySys_WriteStd{out,err} here so the VC++
compiler doesn't grumble.  Greg Stein's suggestion.
1998-09-17 14:00:22 +00:00
Guido van Rossum e0bdf99c0b At Greg Stein's request, add PyLong_*LongLong entry points. 1998-09-17 13:58:37 +00:00
Guido van Rossum b00d252586 Define SIZEOF_LONG_LONG (as 8) at Greg Stein's request. 1998-09-17 13:19:36 +00:00
Guido van Rossum 743d17e3aa In load_inst(), when instantiating an instance the old way (i.e. when
there's an __getinitargs__() method), if a TypeError occurs, catch and
reraise it but add info to the error about the class name being
instantiated.  This makes debugging a lot easier if __getinitargs__()
returns something bogus (e.g. a string instead of a singleton tuple).
1998-09-15 20:25:57 +00:00
Guido van Rossum 0c92000b7a Ignore the TclError exception raised when deleting the registration
for callit, used by the after() command.  This can happen when the
callback deletes the window.
1998-09-14 19:06:39 +00:00
Barry Warsaw 98b6246c0c Several changes that Python carry on in the face of errors in the
initialization of class exceptions.  Specifically:

init_class_exc(): This function now returns an integer status of the
class exception initialization.  No fatal errors in this method now.
Also, use PySys_WriteStderr() when writing error messages.  When an
error occurs in this function, 0 is returned, but the partial creation
of the exception classes is not undone (this happens elsewhere).

Things that could trigger the fallback:

    - exceptions.py fails to be imported (due to syntax error, etc.)

    - one of the exception classes is missing (e.g. due to library
      version mismatch)

    - exception class can't be inserted into __builtin__'s dictionary

    - MemoryError instance can't be pre-allocated

    - some other PyErr_Occurred

newstdexception(): Changed the error message.  This is still a fatal
error because if the string based exceptions can't be created, we
really can't continue.

initerrors(): Be sure to xdecref the .exc field, which might be
non-NULL if class exceptions init was aborted.

_PyBuiltin_Init_2(): If class exception init fails, print a warning
message and reinstate the string based exceptions.
1998-09-14 18:51:11 +00:00
Guido van Rossum d24d3fcd03 Added the mainloop() call. 1998-09-14 17:52:29 +00:00
Guido van Rossum 5fae9e8b86 nannified 1998-09-14 17:51:14 +00:00
Guido van Rossum 8d5bef7fb8 There was a confusion in my checkin of the code to support list() with
and without a message number argument: the argument was called 'msg'
but the code expected it to be called 'which'.  In line with the other
methods, I've renamed the argument to 'which', and adapted the doc
string not to refer to 'msg'.
1998-09-14 17:36:51 +00:00
Guido van Rossum 4117e5428b nannified 1998-09-14 16:44:15 +00:00
Guido van Rossum f9a6d7d494 Print serious errors to stderr instead of stdout. 1998-09-14 16:22:21 +00:00
Barry Warsaw bc3760b09d #Code rearranging to quiet byte-compiler 1998-09-14 16:16:18 +00:00
Guido van Rossum caf9fca35a nannified 1998-09-14 16:03:02 +00:00
Guido van Rossum e7e632ab6b Nannified. 1998-09-14 16:02:28 +00:00
Guido van Rossum a53f30babc nannified 1998-09-14 15:57:09 +00:00
Guido van Rossum 4e96ec6a4e nannified. 1998-09-14 15:56:40 +00:00
Guido van Rossum 7944ea523e Patch by Marc-Andre Lemburg: use re module to compare test results.
This makes it possible to accept that on Linux %w returns "01" instead
of "1", for example.
1998-09-14 15:50:40 +00:00
Guido van Rossum 09eea82005 Utility to replace CRLF with LF in argument files. 1998-09-14 15:46:41 +00:00