Commit Graph

8556 Commits

Author SHA1 Message Date
Guido van Rossum 0a13f7f23a # This is a new module I wrote over the weekend. Again, you missed the
# checkin email because my PC doesn't have the "Mail" command.

Add threading (now that it works).  Also some small adaptations to
Unix again.
1998-06-15 14:49:16 +00:00
Guido van Rossum 5e97783c8f # Note: a previous checkin message was lost because I can now use CVS
# from my PC at home, but it can't send email :-(

Add a clarifying comment about the new ENTER_OVERLAP and
LEAVE_OVERLAP_TCL macros; get rid of all the bogus tests for deleted
interpreters (Tcl already tests for this; they were left over from an
earlier misguided attempt to fix the threading).
1998-06-15 14:03:52 +00:00
Guido van Rossum e3bd82117f Primitive GUI for websucker. 1998-06-15 12:35:19 +00:00
Guido van Rossum d328a9b5f4 Fix the way a trailing / is changed to /index.html so that it
doesn't depend on the value of os.sep.  (I.e. ported to Windows :-)
1998-06-15 12:34:41 +00:00
Guido van Rossum 6eb9d32c43 sort the urls in the todo list 1998-06-15 12:33:02 +00:00
Guido van Rossum 62320c9b9b # (My first checkin from Windows NT using remote CVS!)
There were some serious problem with the thread-safety code.
The basic problem was that often the result was gotten out of
the Tcl interpreter object after releasing the Tcl lock.
Of course, another thread might have changed the return value
already, and this was indeed happening.  (Amazing what trying
it on a different thread implementation does!)

The solution is to grab the Python lock without releasing the
Tcl lock, so it's safe to create a string object or set the
exceptions from the Tcl interpreter.  Once that's done, the
Tcl lock is released.

Note that it's now legal to acquire the Python lock while the
the Tcl lock is held; but the reverse is not true: the Python
lock must be released before the Tcl lock is acquired.  This
in order to avoid deadlines.  Fortunately, there don't seem to
be any problems with this.
1998-06-15 04:36:09 +00:00
Guido van Rossum ad4db17552 Fixed the EventHook() code so that it also works on Windows, sort of.
(The "sort of" is because it uses kbhit() to detect that the user
starts typing, and then no events are processed until they hit
return.)

Also fixed a nasty locking bug: EventHook() is called without the Tcl
lock set, so it can't use the ENTER_PYTHON and LEAVE_PYTHON macros,
which manipulate both the Python and the Tcl lock.  I now only acquire
and release the Python lock.

(Haven't tested this on Unix yet...)
1998-06-13 13:56:28 +00:00
Guido van Rossum d458faadc3 In completer(), return None instead of raising an IndexError when
there are no more completions left.  (This for compatibility with
Donald Beaudry's code.)
1998-06-12 19:42:14 +00:00
Guido van Rossum b3f9f4b729 On Windows, make the pipe() call return Unix file descriptors instead
of Windows file handles.  Now it is at least compatible with itself on
Unix!
1998-06-12 15:05:15 +00:00
Guido van Rossum e0fdf6f1a8 Keep Microsoft's compiler happy. 1998-06-12 15:03:58 +00:00
Guido van Rossum c3da02e904 Don't catch interrupts in getpass() -- the finally clause will reset
the tty and the caller can deal with the interrupt.

In the windows version, recognize ^C and raise KeyboardInterrupt (not
sure if this is needed, but can't hurt).
1998-06-12 14:28:38 +00:00
Guido van Rossum e7c4193755 In tcsetattr(), first initialize the mode structure by calling
tcgetattr().  This seems to be the only correct way to cope with
platform-specific structure members...
1998-06-12 14:26:18 +00:00
Guido van Rossum ae9ee7329d Use the getpass module instead of having platform-specific echo on/off
code here.
1998-06-12 14:21:13 +00:00
Guido van Rossum c8f859a487 Jonathan Giddy:
This second problem only shows up if LDLAST is not an empty string (such
as with threads enabled on DEC Alphas).
1998-06-12 14:09:34 +00:00
Guido van Rossum 590fc2c4fa Jonathan Giddy:
The first one only shows up if $prefix != $exec_prefix, and the problem
is caused by the recent change in location for config.h.
1998-06-12 14:09:03 +00:00
Guido van Rossum 69256612d7 With the recent change that makes numbers compare smaller than anything,
the outcome of the test for max has changed.
1998-06-11 22:25:59 +00:00
Guido van Rossum 08636f08ed Now that test_MimeWriter is untabified, do the same here! 1998-06-11 22:22:39 +00:00
Guido van Rossum a3eebe60dc Add warning about use of lowercase/uppercase with maketrans(). 1998-06-11 16:03:30 +00:00
Guido van Rossum 08d6be4871 Add timegm to list of functions tested, for Marc-Andre L. 1998-06-11 15:19:05 +00:00
Guido van Rossum d92fb16d57 Oops, bug in release date! 1998-06-11 15:17:53 +00:00
Guido van Rossum cff311aa37 Be more careful than the previous patch. The default content-type
should only be set to application/x-www-form-urlencoded when the
method is POST.  E.g. for PUT, an empty default (defaulting to
text/plain later) makes more sense.
1998-06-11 14:06:59 +00:00
Guido van Rossum e894fc0ea3 Support new overridable method, isheader() (ESR).
Also implement __setitem__(), more-or-less correctly (GvR).
1998-06-11 13:58:40 +00:00
Guido van Rossum 444d0f87c9 Eric Raymond: added doc for isheader(); improved docs for constructor. 1998-06-11 13:50:02 +00:00
Guido van Rossum 1299100324 Document the changes I just checked in. 1998-06-10 21:34:27 +00:00
Guido van Rossum c7bb8577c7 Some changes suggested/provided by Eric Raymond:
- explain seekable
- when seekable==1, test fp.tell() and set it to 0 if that fails
- support overridable method iscomment(line) to weed out comments
- check for unread() method on file object before trying to seek

And one of my own:

- Add a get() method which behaves like a dictionary's get(); this is
actually implemented by giving getheader() an optional second argument
to specify the default, and aliasing get to getheader.
1998-06-10 21:31:01 +00:00
Guido van Rossum 3e5fe422cc Document several variables that were previously undocumented,
including the new __stdin__, __stdout__ and __stderr__.
Also moved setttrace around to its proper place in the alphabet.
1998-06-10 17:57:44 +00:00
Guido van Rossum 1f40cd6314 Add the __doc__ string from the original module on copy_none(). 1998-06-09 21:33:44 +00:00
Guido van Rossum 929bd0e02e Added notes about epochs, the year 2038, and a small Y2K disclaimer
(all with index entries!).  Also update the list of functions that
take or yield a time represented as a 9-tuple.
1998-06-09 21:25:41 +00:00
Guido van Rossum dd47ec98e2 Default content-type to application/x-www-form-urlencoded at the top
level of a form.  This means that browsers that omit the content-type
header when sending a POST command aren't penalized so heavily.
1998-06-09 19:49:16 +00:00
Guido van Rossum e614fb12a0 Changed runs of 8 spaces to tab -- to satisfy the tab nanny. 1998-06-09 19:20:12 +00:00
Guido van Rossum 068ad97330 Untabified -- to satisfy the tab nanny. 1998-06-09 19:19:40 +00:00
Guido van Rossum 5a43e1a90c Get rid of tabnanny's last complaints. 1998-06-09 19:04:26 +00:00
Guido van Rossum aa2a7a4ae6 From: "Tim Peters" <tim_one@msn.com>
The 1.5.1 tabnanny.py suffers an assert error if fed a script whose last
line is both indented and lacks a newline:

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

The attached version repairs that.
1998-06-09 19:02:21 +00:00
Guido van Rossum cd5a5f627a When comparing objects of different types (which is done by comparing
the type names), make sure that numeric objects are considered smaller
than all other objects, by forcing their name to "".
1998-06-09 18:58:44 +00:00
Guido van Rossum 5d23758be7 Added docs for strptime(). 1998-06-09 16:30:56 +00:00
Guido van Rossum 87ce7bbc39 Added strptime, if it exists. Modified after a patch by Jesse Hallio. 1998-06-09 16:30:31 +00:00
Guido van Rossum 52481484e6 Clarify the type of the signal handler. 1998-06-09 15:42:25 +00:00
Guido van Rossum 4a0144c0de Should check that PyObject_Str() really returned a string! 1998-06-09 15:08:41 +00:00
Guido van Rossum fe02efdbf4 getint() now raises ValueError, not TclError, on errors. 1998-06-09 02:37:45 +00:00
Guido van Rossum 795a4bc666 Added a line to process SGI_ABI. 1998-06-08 21:22:12 +00:00
Guido van Rossum a45cb45965 When unmarshalling, add test for negative lengths on strings, tuples
and lists; if the size is negative, raise an exception.  Also raise an
exception when an undefined type is found -- all this to increase the
chance that garbage input causes an exception instead of a core dump.
1998-06-08 20:27:29 +00:00
Guido van Rossum a63eff6e6a Allow assignments to special class attributes -- with typechecks, and
not in restricted mode.

__dict__ can be set to any dictionary; the cl_getattr, cl_setattr and
cl_delattr slots are refreshed.

__name__ can be set to any string.

__bases__ can be set to to a tuple of classes, provided they are not
subclasses of the class whose attribute is being assigned.

__getattr__, __setattr__ and __delattr__ can be set to anything, or
deleted; the appropriate slot (cl_getattr, cl_setattr, cl_delattr) is
refreshed.

(Note: __name__ really doesn't need to be a special attribute, but
that would be more work.)
1998-05-29 21:37:21 +00:00
Barry Warsaw fe216b7937 A few minor updates on Emacs mode section 1998-05-29 20:56:34 +00:00
Guido van Rossum 5542449875 Remove the doc string -- it doesn't tell the truth. 1998-05-29 20:08:35 +00:00
Guido van Rossum 0da45c4089 New demo -- Perl style regular expression matching.
Slightly more featureful than regexdemo.py.
1998-05-29 19:57:47 +00:00
Guido van Rossum 13c8ef62e6 Say a bit more about .pyc and .pyo files. 1998-05-29 19:12:23 +00:00
Guido van Rossum 3c46234e5e Remove Emacs and #! cruft. 1998-05-29 18:22:53 +00:00
Guido van Rossum d659693b5b Improve the self-test code a bit: read a host from sys.argv[1] if set,
and list the host name when prompting for the password.
1998-05-29 18:08:48 +00:00
Guido van Rossum a119c0dd5e Tim's revision of the previous patch. He also added some sparts to
the median-of-three code to get a few percent back.
1998-05-29 17:56:32 +00:00
Guido van Rossum cc20b76ad0 Add comments explaining thread unsafety of this code. 1998-05-29 17:51:59 +00:00