Guido van Rossum
cef4c844df
Turns out that 'winfo id' returns the id as a hex string, with 0x prefix.
...
The int() function (aliased to getint()) doesn't handle that, so we must
use self.tk.getint() again...
1998-06-19 04:35:45 +00:00
Guido van Rossum
268824e089
Different trick to get the _test() window to pop up.
1998-06-19 04:34:19 +00:00
Guido van Rossum
eda960a1dd
Piers' latest version -- authentication added by Donn Cave.
1998-06-18 14:24:28 +00:00
Guido van Rossum
e50b0a44cb
In class _Subfile, make sure read(n) can't read beyond EOF. Also
...
allow negative numbers to specify read until EOF (like for a regular
file's read() method).
1998-06-17 18:34:40 +00:00
Guido van Rossum
81d10b479e
Add __getitem__ to AddressList object, to make it a sequence.
1998-06-16 22:29:03 +00:00
Guido van Rossum
4d4ab9245f
Some extra comments and docstrings, and a new class (AddressList), all by ESR.
1998-06-16 22:27:09 +00:00
Guido van Rossum
32490824b6
Fixed the UDP server -- this never worked. Ray Loyzaga deserves
...
credit for complaining about this and for testing these changes.
1998-06-16 02:27:33 +00:00
Guido van Rossum
d458faadc3
In completer(), return None instead of raising an IndexError when
...
there are no more completions left. (This for compatibility with
Donald Beaudry's code.)
1998-06-12 19:42:14 +00:00
Guido van Rossum
c3da02e904
Don't catch interrupts in getpass() -- the finally clause will reset
...
the tty and the caller can deal with the interrupt.
In the windows version, recognize ^C and raise KeyboardInterrupt (not
sure if this is needed, but can't hurt).
1998-06-12 14:28:38 +00:00
Guido van Rossum
ae9ee7329d
Use the getpass module instead of having platform-specific echo on/off
...
code here.
1998-06-12 14:21:13 +00:00
Guido van Rossum
69256612d7
With the recent change that makes numbers compare smaller than anything,
...
the outcome of the test for max has changed.
1998-06-11 22:25:59 +00:00
Guido van Rossum
08636f08ed
Now that test_MimeWriter is untabified, do the same here!
1998-06-11 22:22:39 +00:00
Guido van Rossum
cff311aa37
Be more careful than the previous patch. The default content-type
...
should only be set to application/x-www-form-urlencoded when the
method is POST. E.g. for PUT, an empty default (defaulting to
text/plain later) makes more sense.
1998-06-11 14:06:59 +00:00
Guido van Rossum
e894fc0ea3
Support new overridable method, isheader() (ESR).
...
Also implement __setitem__(), more-or-less correctly (GvR).
1998-06-11 13:58:40 +00:00
Guido van Rossum
c7bb8577c7
Some changes suggested/provided by Eric Raymond:
...
- explain seekable
- when seekable==1, test fp.tell() and set it to 0 if that fails
- support overridable method iscomment(line) to weed out comments
- check for unread() method on file object before trying to seek
And one of my own:
- Add a get() method which behaves like a dictionary's get(); this is
actually implemented by giving getheader() an optional second argument
to specify the default, and aliasing get to getheader.
1998-06-10 21:31:01 +00:00
Guido van Rossum
1f40cd6314
Add the __doc__ string from the original module on copy_none().
1998-06-09 21:33:44 +00:00
Guido van Rossum
dd47ec98e2
Default content-type to application/x-www-form-urlencoded at the top
...
level of a form. This means that browsers that omit the content-type
header when sending a POST command aren't penalized so heavily.
1998-06-09 19:49:16 +00:00
Guido van Rossum
e614fb12a0
Changed runs of 8 spaces to tab -- to satisfy the tab nanny.
1998-06-09 19:20:12 +00:00
Guido van Rossum
068ad97330
Untabified -- to satisfy the tab nanny.
1998-06-09 19:19:40 +00:00
Guido van Rossum
5a43e1a90c
Get rid of tabnanny's last complaints.
1998-06-09 19:04:26 +00:00
Guido van Rossum
aa2a7a4ae6
From: "Tim Peters" <tim_one@msn.com>
...
The 1.5.1 tabnanny.py suffers an assert error if fed a script whose last
line is both indented and lacks a newline:
if 1:
print 'oh fudge' # no newline here:
The attached version repairs that.
1998-06-09 19:02:21 +00:00
Guido van Rossum
fe02efdbf4
getint() now raises ValueError, not TclError, on errors.
1998-06-09 02:37:45 +00:00
Guido van Rossum
3c46234e5e
Remove Emacs and #! cruft.
1998-05-29 18:22:53 +00:00
Guido van Rossum
d659693b5b
Improve the self-test code a bit: read a host from sys.argv[1] if set,
...
and list the host name when prompting for the password.
1998-05-29 18:08:48 +00:00
Guido van Rossum
cc20b76ad0
Add comments explaining thread unsafety of this code.
1998-05-29 17:51:59 +00:00
Guido van Rossum
d03e1197cb
Make gauss() semi-thread-safe. It can still give duplicate results,
...
but it can no longer raise an exception when called by several threads
simultaneously.
1998-05-29 17:51:31 +00:00
Guido van Rossum
b39e461b89
Two places where _time() should be used said time.time(), which
...
doesn't work of course.
1998-05-29 17:47:10 +00:00
Guido van Rossum
6884af706b
Piers Lauders' latest version, with some of my own changes reapplied.
...
Also replaced random()*32000 with randint(0, 31999).
1998-05-29 13:34:03 +00:00
Guido van Rossum
1ad00717fb
Patch by Lars Marius Garshol:
...
- Handle <? processing instructions >.
- Allow . and - in entity names.
Also fixed an oversight in the previous fix (in one place, [ \t\r\n]
was used instead of string.whitespace).
1998-05-28 22:48:53 +00:00
Jeremy Hylton
2b9d029308
add handler for JPython's org.python.core.PyStringMap object, which
...
walks and quacks like a dictionary.
1998-05-27 22:38:22 +00:00
Guido van Rossum
16653cb273
Add Tim's worst case scenario.
...
Revert to using whrandom so it will work with older versions of Python.
1998-05-26 15:05:12 +00:00
Guido van Rossum
7462942b69
Added some tests to make sure that long->int conversions near
...
sys.maxint and near -sys.maxint-1 work correctly.
1998-05-26 14:51:55 +00:00
Fred Drake
5b34ec1b14
Fixed spelling in comment: "RFC", not "RFX".
1998-05-22 18:18:08 +00:00
Guido van Rossum
e9387ea773
introduce a new platform-specific variable: os.linesep is the
...
platform's line separator. \n on Unix, \r\n on DOS, OS/2 and Windows,
\r on Macs.
1998-05-22 15:26:04 +00:00
Guido van Rossum
26fd98201f
Change the last 4-space indent into a 1-tab indent.
1998-05-22 15:05:36 +00:00
Guido van Rossum
7ef2a1de9b
Shouldn't use newdir.dir(), which no longer exists!
1998-05-22 14:11:57 +00:00
Fred Drake
c9132066e7
knownfiles: Add the default installation dirs for Apache
...
versions <= 1.2, >= 1.3.
1998-05-21 13:15:45 +00:00
Guido van Rossum
b26a1b4e2b
Use random instead of whrandom.
1998-05-20 17:05:52 +00:00
Guido van Rossum
33d7f1a76c
Add Interfaces to replace remaining needs for importing whrandom.
...
# XXX TO DO: make the distribution functions below into methods.
1998-05-20 16:28:24 +00:00
Guido van Rossum
0bd5433cf8
Get rid of nearly all clals to self._do -- turns out self.tk.call can
...
be used just as well, so this saves one Python call in many cases!
1998-05-19 21:18:13 +00:00
Fred Drake
4941341858
guess_extension(): Revise documentation string to be more clear. If not
...
inited, call init().
1998-05-19 15:15:59 +00:00
Guido van Rossum
5f4fb913a2
Test that "import sys.imp" fails as it should.
1998-05-19 15:09:42 +00:00
Fred Drake
5109ffd607
guess_extension(): New function. Performs a reverse mapping from MIME type
...
to filename extension.
1998-05-18 16:27:20 +00:00
Guido van Rossum
67133e25a2
Neatify the _timezones table and remove a misleading comment about
...
inaccuracies in mktime_tz().
1998-05-18 16:09:10 +00:00
Fred Drake
3130b7a2a9
Fixed typo in docstring: suffixes_map --> suffix_map.
1998-05-18 16:05:24 +00:00
Guido van Rossum
4658682205
Subject: bug fixes for imaplib.py
...
From: Piers Lauder <piers@staff.cs.usyd.edu.au>
To: Python List <python-list@cwi.nl>
Date: Mon, 18 May 1998 09:51:53 +1000
Following is a context diff for imaplib.py in the Python1.5.1 distribution.
It fixes 2 bugs. One to do with argument quoting, and the other to do with
caching of un-tagged responses. Apologies for its size.
1998-05-18 14:39:42 +00:00
Guido van Rossum
7beaad4e75
Add file extension .xml, mapping it to text/xml.
1998-05-18 14:25:08 +00:00
Jeremy Hylton
ee918cb487
Fix bug reported by Harri Pasanen: gzip + cPickle doesn't work. The
...
problem was a couple of bugs in the readline implementation.
1. Include the '\n' in the string returned by readline
2. Bug calculating new buffer size in _unread
Also remove unncessary import of StringIO
1998-05-13 21:49:58 +00:00
Guido van Rossum
01fc65d92f
From: conrad@cgl.ucsf.edu (Conrad Huang %CGL)
...
To: python-list@cwi.nl
Date: 13 May 98 18:33:11 GMT
I think I found a bug in CGIHTTPServer.py. (Does anyone care? :-)
I was trying to use it as the web server for uploading files.
Python CGI scripts (using the CGI module) that worked for other
servers (e.g., Netscape Enterprise server) hang when run from
CGIHTTPServer. The problem is that the content type parameters,
in particular the boundary parameter, were not passed through to
the CGI scripts, thus making the MIME parsing code choke.
My simple-minded fix is:
% diff CGIHTTPServer.py /usr/local/lib/python1.5/CGIHTTPServer.py
137,140c136
< if self.headers.typeheader is None:
< env['CONTENT_TYPE'] = self.headers.type
< else:
< env['CONTENT_TYPE'] = self.headers.typeheader
---
> env['CONTENT_TYPE'] = self.headers.type
Conrad
1998-05-13 20:13:24 +00:00
Guido van Rossum
b298a300dd
Reduce memory requirements.
1998-05-12 13:21:31 +00:00
Guido van Rossum
03e35c548f
Add a few doc strings.
1998-05-10 18:27:29 +00:00
Guido van Rossum
ea176b663e
benchmark for list.sort()
1998-05-10 18:20:05 +00:00
Guido van Rossum
b1b4f94527
Make Tim O'Malley's requested change: in FieldStorage.__init__(), when
...
method='GET', always get the query string from environ['QUERY_STRING']
or sys.argv[1] -- ignore an explicitly passed in fp.
1998-05-08 19:55:51 +00:00
Fred Drake
073b829021
When a file name is selected ("OK" button, <Return> in the filename entry),
...
and the "key" keyword parameter was used to invoke .go(), use the directory
of the selected file as the stored directory to return to when the same key
is used again. This is useful since the user may well entry at least part
of the path in the filename box instead of doing a lot of clicking around in
the listboxes.
1998-05-06 17:28:23 +00:00
Guido van Rossum
e7b6e396fc
New files from Thomas Gellekum
1998-05-06 15:14:36 +00:00
Guido van Rossum
d618c91f14
Added table of WSA error codes.
1998-05-06 13:48:04 +00:00
Guido van Rossum
e0c0da98d8
Patches to make the proxy code work again. (Why does that always break
...
as soon as I change things even just a little bit? :-) Even works
when accessing a password-protected page through the proxy. Prompted
by complaints from, and correct operation verified by, Nigel O'Brian.
1998-05-05 13:58:13 +00:00
Guido van Rossum
a986bb7e5c
Take out the check for AUTH-LOGIN or AUTH=LOGIN in login() -- some
...
servers support LOGIN but don't advertise it. If it's not supported
the protocol will respond NO. Approved by Piers Lauder.
1998-05-05 03:08:46 +00:00
Guido van Rossum
b485224d82
REMOVE samefile(), sameopenfile(), samestat() -- these cannot be made
...
to work reliably (at least I wouldn't know how).
1998-05-02 00:47:09 +00:00
Guido van Rossum
e365a590d4
Change the names of all methods in the Wm class: they are now
...
wm_title(), etc. The old names (title() etc.) are still defined as
aliases.
This brings all methods up to use the same naming convention: whether
the Tcl syntax is
.window.path.name command subcommand [options]
or
command subcommand .window.path.name [optins]
the Python equivalent is always
windowobject.command_subcommand(options)
1998-05-01 19:48:20 +00:00
Guido van Rossum
0132f69c2e
Another optimization, probably of negligeable effect: instead of
...
calling self.tk.getint() and self.tk.getdouble(), call the globals
getint() and getdouble(), which in turn are just names for the Python
builtins int() and double(). (Making them globals actually save a
dict lookup compared to using the built-in.) The corresponding
methods of class Misc have been changed similarly. (Note that
getboolean() hasn't been changed because there's no Python
equivalent.)
The use of int() and float() has another advantage: if/when Tcl calls
can actually return Tcl objects with other types than string, use of
int() and float() is essential.
1998-04-30 17:50:36 +00:00
Guido van Rossum
dc59340646
In _bind(), found a way to test for break without a temp variable.
1998-04-29 22:16:57 +00:00
Guido van Rossum
f975699c07
Save a tiny bit of time: self.tk.call takes a tuple argument so it's
...
not needed to say apply(self.tk.call, t); self.tk.call(t) has the same
effect. This cuts down tremendously on the number of apply() calls
made. No measurable effect, but at the very least it saves the lookup
of apply() in the globals!
1998-04-29 21:57:08 +00:00
Guido van Rossum
f0c891a2b2
Import MacOS at the top instead of insize Tk.__init__() -- the latter
...
repeats the I/O for the failed import on each interpreter creation.
1998-04-29 21:43:36 +00:00
Guido van Rossum
7e6d18c1c0
Replace all calls to acquire_lock() and release_lock() with acquire()
...
and release() instead.
1998-04-29 14:29:32 +00:00
Guido van Rossum
57a0661cb8
On the Mac, create the Temporary Items folder if it does not exist yet.
...
(Jack)
1998-04-28 16:03:34 +00:00
Guido van Rossum
9c93a69335
Put quotes around the filename, so spaces in filenames work.
...
(Jack)
1998-04-28 16:03:03 +00:00
Guido van Rossum
53117ae82a
typo in error message (fname vs. file).
...
(Jack)
1998-04-28 16:01:13 +00:00
Guido van Rossum
b86ba124ea
Support byte-swapped dbhash (bsddb) files. Found by Ben Sayer.
1998-04-28 15:41:03 +00:00
Guido van Rossum
fc1f64d90d
Oops, I had 'n' and 'c' mixed up in my mind. Get rid of the comment
...
that wonders what the difference is and explain them properly.
1998-04-28 15:23:09 +00:00
Guido van Rossum
a5c0998242
Inspired by Ben Sayer, rewritten the code and some of the comments to
...
be more intelligent when the database already exists (use the module
for the existing file, according to whichdb). Noted in the doc
strings that there doesn't seem to be a different between 'c' and 'n'.
1998-04-28 15:19:34 +00:00
Guido van Rossum
e86271af72
When setting the event structure fields, don't die when the widget
...
name is not registered; simply use the string. This happens for
tear-off widgets (e.g. if you've registered enter/leave events for the
menu).
1998-04-27 19:32:59 +00:00
Guido van Rossum
0eae8fba81
Feeble attempt at making urlopen more robust -- don't call splituser()
...
when splithost() returned no useable host, to avoid calling
splituser() on None.
1998-04-27 15:19:17 +00:00
Fred Drake
9291d271fb
parse150(): Simplify RE used to parse the message a little, taking advantage
...
of using re instead of regex.
1998-04-27 14:39:44 +00:00
Guido van Rossum
446898ff4a
Use hex() when outputting the various checksums so the test output is the
...
same on 32 and 64 bit machines.
1998-04-24 18:31:28 +00:00
Guido van Rossum
bb189dbcb0
Small corrections to comments that were cloned from aifc; moreover
...
the description of setparams() was wrong.
wave.py: Include the tag of an unknown format in the exception.
1998-04-23 21:40:02 +00:00
Guido van Rossum
1740b8d2f7
New test sample -- "Nobody expects the Spanish Inquisition!"
1998-04-23 21:37:22 +00:00
Guido van Rossum
e26132cf5e
Move unified findfile() into test_support.py
1998-04-23 20:13:30 +00:00
Guido van Rossum
5fd90684a9
Run the self-test (test.test_MimeWriter) when invoked as a script.
1998-04-23 13:34:57 +00:00
Guido van Rossum
2ad816f47e
Add test for MimeWriter module
1998-04-23 13:33:56 +00:00
Guido van Rossum
e87ed5f6d4
Add writelines() method to Compare class.
1998-04-23 13:33:21 +00:00
Guido van Rossum
9a34523e19
As Tim Peters points out, ``from string import *'' should not set re to None.
...
Also rename safe_env to _safe_env.
1998-04-20 14:01:00 +00:00
Fred Drake
de2f708299
Fix regexp for attrfind; bug reported by Lars Marius Garshol
...
<larsga@ifi.uio.no>.
1998-04-16 21:04:26 +00:00
Fred Drake
ac36c6403f
Open wave files in binary mode.
...
Accept 'rb' and 'wb' as well as 'r' and 'w' as the mode parameter to open().
1998-04-16 16:44:33 +00:00
Guido van Rossum
64d036c8fe
Add connect_ex to list of methods.
1998-04-14 01:30:45 +00:00
Guido van Rossum
fb9b7fd5ee
Be nicer to systems that have neither termios nor msvcrt.
1998-04-13 20:22:21 +00:00
Guido van Rossum
b19e2a383c
Whoops! Add a missing 'instantiated = 1' to load_inst(); otherwise it
...
would still try to call the class...
1998-04-13 18:08:45 +00:00
Guido van Rossum
be14e69742
New revision -- sometimes it's AUTH-LOGIN, sometimes AUTH=LOGIN!
1998-04-11 03:11:51 +00:00
Guido van Rossum
5c7e8cd267
Avoid using the obsolete rand module; and improve the randomness
...
of the boundary chosen by choose_boudary() by using milliseconds
of the timestamp.
1998-04-11 03:06:02 +00:00
Guido van Rossum
38d8f4e1c2
New version doesn't require REV1 capability.
1998-04-11 01:22:34 +00:00
Guido van Rossum
c74521acc4
Oops -- remove some debug print statements!
1998-04-11 01:18:35 +00:00
Guido van Rossum
c296651e10
Add image_types() and image_names() as methods to Misc class.
1998-04-10 19:16:10 +00:00
Guido van Rossum
ce73acf5e6
Tim's version 4, with my mods
1998-04-10 19:14:59 +00:00
Guido van Rossum
4cee3c49c2
Another easter present.
1998-04-10 16:14:34 +00:00
Guido van Rossum
7f5013a9a9
New Java-style threading module. The doc strings are in a separate module.
1998-04-09 22:01:42 +00:00
Guido van Rossum
bb08066053
The usual
1998-04-09 21:47:39 +00:00
Guido van Rossum
b5903ac9fb
Another new utility: getpass() prompts for a password, with echo off.
...
Also contains getuser(), which returns the username (not prompting though).
These work on Unix and Windows!
1998-04-09 20:37:16 +00:00
Guido van Rossum
29e5f5d81f
When getcwd() doesn't exist or raises an exception, don't fail but
...
fall back to using os.curdir instead; if it is fine, don't use
os.curdir at all.
1998-04-09 14:27:57 +00:00
Guido van Rossum
c09e6b1c0a
Clarify that put *blocks* when the queue is full. Add some blank
...
lines to doc strings.
1998-04-09 14:25:32 +00:00
Guido van Rossum
eeec0af307
Piers' new version (but I unfolded a few doc strings).
1998-04-09 14:20:31 +00:00