Commit Graph

9670 Commits

Author SHA1 Message Date
Guido van Rossum b55f9ff68c 100 bottles of beer on the wall example.
After a version by Fredrik Lundh that I found on the web somewhere.
(I like mine better, but of course that may have to do with my alcohol
consumption. :-)
1998-12-21 18:30:20 +00:00
Guido van Rossum 275ea67e6b Add macro version of PyThreadState_GET(). This uses
_PyThreadState_Current, defined in pystate.c.
1998-12-21 18:28:10 +00:00
Guido van Rossum 18bc7c2276 Make current_tstate a global, _PyThreadState_Current. This is to
support a macro in pystate.h.
1998-12-21 18:27:28 +00:00
Guido van Rossum dfaac4df9e Add XXX comment about the need to add a dump() method to the Text
widget -- no time to do this right now.
1998-12-21 18:25:03 +00:00
Guido van Rossum c08cc50e00 Add XXX comment about a test that doesn't seem right -- no time to
explore this now.
1998-12-21 18:24:09 +00:00
Guido van Rossum 0b56a3e9a7 A mod whose author I forget. (I must've mislaid the email. If it's
yours, please let me know for propoer acknowledgement.)

This avoids recompiling files that haven't changed; it adds a -f
option to force recompilation.
1998-12-21 18:23:38 +00:00
Guido van Rossum 91c8f5901b Sjoerd Mullender:
- Fixed a bug where a syntax error was reported when a document
  started with white space.  (White space at the start of a document
  is valid if there is no XML declaration.)
- Improved the speed quite a bit for documents that don't make use of
  namespaces.
1998-12-21 18:15:28 +00:00
Jeremy Hylton 5bc4abe006 replace missing zalloc initialization (test_zlib now runs
successfully)
1998-12-21 17:15:00 +00:00
Jeremy Hylton 36252022ec remove debugging fprintf (should have checked this before previous
checkin)
1998-12-21 16:40:21 +00:00
Guido van Rossum c6769c54f4 Typo discovered by Just. 1998-12-21 16:26:31 +00:00
Guido van Rossum 1f05708f69 Use __stdin__ instead of stdin to derive FileType -- safer against
assignments.
1998-12-19 23:53:33 +00:00
Greg Ward 1190ee3d03 Fred's sysconfig module. 1998-12-18 23:46:33 +00:00
Jeremy Hylton a37e244536 patches from Andrew
NOTE: There is still a bug of some sort in the behavior of zlib.  In
at least one case, inflate returns Z_OK (which is typically
interpreted to mean that more output space is needed) when it has
finished inflating a buffer.  This has been reported as a bug to the
zlib maintainers; we may need to change the Python interface.
1998-12-18 22:13:11 +00:00
Guido van Rossum 1924a0677d Chris H. writes:
If we're going to put the PyOS_strtol() proto in intobject.h we should
include it here or the symbol isn't exported on PowerPC.
1998-12-18 22:02:37 +00:00
Guido van Rossum eb452321af Improved instructions by Chris H. 1998-12-18 22:00:58 +00:00
Greg Ward ee789b9601 Initial checkin of distutils source files. 1998-12-18 22:00:30 +00:00
Guido van Rossum b083a9fb54 Sjoerd Mullender writes:
Here is my current version of xmllib.py and the documentation.  This
version has some API changes with respect to the version currently in
Python (also the one in 1.5.2a).
This version supports XML namespaces.
1998-12-18 20:17:13 +00:00
Fred Drake 6de7d0c338 When _PyString_Resize() reports failure, the variable referring to the
string we wanted to resize is set to NULL.  Don't Py_DECREF() those
variables!  (5 places)
1998-12-18 19:46:59 +00:00
Guido van Rossum 654387efbd Fix the class browser to work even when the file is not on sys.path. 1998-12-18 15:52:54 +00:00
Guido van Rossum 060f24ce97 Forgot to check this in for Chris Herborth 1998-12-18 15:37:14 +00:00
Guido van Rossum 33add0a95a Sjoerd Mullender:
File names with "funny" characters get translated wrong by
pathname2url (any variety).  E.g. the (Unix) file "/ufs/sjoerd/#tmp"
gets translated into "/ufs/sjoerd/#tmp" which, when interpreted as a
URL is file "/ufs/sjoerd/" with fragment ID "tmp".

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

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

In addition, this patch fixes some uses of unquote:
- the host part of URLs should be unquoted
- the file path in the FTP URL should be unquoted before it is split
  into components.
- because of the latter, I removed all unquoting from ftpwrapper,
  and moved it to the caller, but that is not essential
1998-12-18 15:25:22 +00:00
Andrew M. Kuchling dc86a4e5bb Added a -q ('quiet') option to tabnanny, which causes only the names of
offending files to be printed.  Good for emacs `tabnanny.py *.py`
1998-12-18 13:56:58 +00:00
Guido van Rossum ea5163261e The usual 1998-12-17 18:08:55 +00:00
Guido van Rossum 2666a15576 Several tiny changes:
- remove PowerPC specific compiler switch for BeOS (Chris Herborth)
- FreeBSD/3 support
- check for pthread_detach in libc instead of _create
1998-12-17 18:07:35 +00:00
Guido van Rossum 0e1d0e95ea Patch by Chris Herborth:
have to use a const-correct prototype on BeOS or the compiler gets uppity.
1998-12-17 18:03:10 +00:00
Guido van Rossum 5cd975c678 Patch by Chris Herborth:
BeOS headers live in various non-standard places;
luckily, there's an environment variable that lists them all.
1998-12-17 18:02:15 +00:00
Guido van Rossum fc4966b7af Changes for new BeOS port by Chris Herborth 1998-12-17 18:00:33 +00:00
Guido van Rossum 476e49f055 Jim Fulton writes:
This fixes a bug that can cause core dumps when doing seeks in input
StringIO objects. This has a number of other clean-ups.
1998-12-15 21:43:15 +00:00
Guido van Rossum 2edcf0d71c Move the prototype for dump_counts() to before where it is used.
(This only applies when COUNT_ALLOCS is defined.)
1998-12-15 16:12:00 +00:00
Guido van Rossum 38b92eb56a Sjoerd Mullender:
When printing missing modules, also print the module they were
imported from.
1998-12-15 15:35:23 +00:00
Barry Warsaw 9c1696cff5 (py-goto-beginning-of-tqs): Finds the beginning of the triple quoted
string we find ourselves in, based on the passed in delimiter.

(py-compute-indentation): Fixes for indentation errors when we land
inside a triple quoted string.  For example:

def foo():
   if os.path.isfile(o_pri_mbox_file) and os.path.isfile(o_pub_mbox_file):
       print """\
I found both a private and a public mbox archive file
    private: %s
    public : %s

I won't move either file, but you should choose one and move it to

    %s

You may want to merge them manually, but be careful about exposing private
correspondences to the public.""" % (
    o_pri_mbox_file, o_pub_mbox_file, mbox_file)
*----indentation would be wrong on this line.
1998-12-15 04:36:22 +00:00
Barry Warsaw ef30092207 Added most of the mechanism to change the strips from color variations
to color constants (i.e. red constant, green constant, blue
constant).  But I haven't hooked this up yet because the UI gets more
crowded and the arrows don't reflect the correct values.

Added "Go to Black" and "Go to White" buttons.
1998-12-15 01:04:38 +00:00
Barry Warsaw 6403991a9d A start on the TestModExp applet
"Author" => "Contact"
1998-12-15 01:02:51 +00:00
Barry Warsaw 107e623ef0 grid_bbox(): support new Tk API: grid bbox ?column row? ?column2 row2? 1998-12-15 00:44:15 +00:00
Barry Warsaw 88604056c5 "Author" -> "Contact" 1998-12-14 21:36:40 +00:00
Andrew M. Kuchling 4c07f81d60 Fixed bug reported to Gregor Hoffleit:
> mpz.mpz('\xff') should return mpz(255).  Instead it returns
> mpz(4294967295L). Looks like the constructor doesn't work with strings
> containing characters above chr(128).
Caused by using just 'char' where 'unsigned char' should have been used.
1998-12-14 19:36:14 +00:00
Guido van Rossum cada2938f7 As noted by Per Cederqvist, new_buffersize() sometimes returns the
buffer increment, and sometimes the new buffer size.  Make it do what
its name says, and fix the one place where this matters to the caller.

Also add a comment explaining why we call lseek() and then ftell().
1998-12-11 20:44:56 +00:00
Guido van Rossum 68055ce6fe When tracing references, reset the type and size of tuples allocated
from the fast free list -- the type (at least) is reset by
_Py_Dealloc().
1998-12-11 14:56:38 +00:00
Guido van Rossum 21ef088265 Need to initialize self->safe_constructors early on to prevent crash
in early dealloc.  Patch by Andrew Dalke.
1998-12-11 03:20:00 +00:00
Guido van Rossum 732aa2f987 Gregor Hoffleit writes:
But IMHO, this problem really reveals an annoyance in Python's
makesetup. makesetup puts the global include directories "$(INCLUDEPY)
$(EXECINCLUDEPY)" in front of the directories defined by the module in
Setup. Therefore global (potentially older) header files are preferred
over the ones set by the module, which makes it hard to compile new
versions of modules when the old versions are installed. AFAIK, the
other way around is common practice for most other software.

This patch to makesetup would be an potential fix for this problem,
though I don't know if it breaks anything else.
1998-12-11 01:10:29 +00:00
Fred Drake aaed9710e9 create_module_info(): New function: Modify a <section> to create a
<moduleinfo> element based on various meta information, and
	strip some cruftiness.  This is more usable for information
	extraction, and organizes the information more clearly.

cleanup_synopses():  Rewrite to use create_module_info(), so this
	will work with multi-rooted "documents".
1998-12-10 20:25:30 +00:00
Fred Drake fee6abea90 Remove another {\rm ...} construct.
Sheesh, where do these things come from?
1998-12-10 19:57:52 +00:00
Fred Drake 4abcffb233 Don't pass around a list of known empty elements, since the ESIS
contains "e" events for them.  This wasn't used anyway.
1998-12-10 18:31:37 +00:00
Guido van Rossum 46e9705eca Remove prototypes for PyOS_strto[u]l -- Chris Herborth. 1998-12-10 16:57:44 +00:00
Guido van Rossum ca90605678 Add more SET_LINENO instructions in long argument lists 1998-12-10 16:56:22 +00:00
Guido van Rossum f5046d1aea Remove prototype for PyOS_strtol -- Chris Herborth. 1998-12-10 16:54:48 +00:00
Guido van Rossum cc34faaf14 Add prototypes for PyOS_strto[u]l -- Chris Herborth. 1998-12-10 16:54:17 +00:00
Guido van Rossum 9df827f3ba Need to define DL_EXPORT, of course! 1998-12-10 16:50:49 +00:00
Guido van Rossum e18f8878aa No longer needed. 1998-12-10 16:50:14 +00:00
Guido van Rossum 5de54208a5 Needed to add DL_EXPORT to (redundant?) extern decl of module init function. 1998-12-10 16:49:28 +00:00