Commit Graph

17659 Commits

Author SHA1 Message Date
Fred Drake 76d6139961 Add a new FCNTL.py backward compatibility module that issues a deprecation
warning.  This is similar to the TERMIOS backward compatbility module.
2001-05-09 21:13:23 +00:00
Fred Drake bc7809b529 Update the tests for the fcntl module to check passing in file objects,
and using the constants defined there instead of FCNTL.
2001-05-09 21:11:59 +00:00
Fred Drake d0de57cfbb Update the fcntl module documentation. 2001-05-09 21:09:57 +00:00
Fred Drake 152a25ee1c Modify to allow file objects wherever file descriptors are needed.
This closes SF bug #231328.

Added all constants needed to use the functions defined in this module
that are not defined elsewhere (the O_* symbols are available in the
os module).  No additonal modules are needed to use this now.
2001-05-09 21:02:02 +00:00
Fred Drake c99ff60573 fdconv(): Do not second guess the error condition returned by
PyObject_AsFileDescriptor() -- it does the same thing everywhere, so
    use it the same way everyone else does so that exceptions are
    consistent.  This means we have less code here, and we do not need to
    resort to hackish ways of getting the Python-visible function name to
    fdconv().
2001-05-09 20:14:09 +00:00
Tim Peters 1a97d5f098 SF patch #416247 2.1c1 stringobject: unused vrbl cleanup.
Thanks to Mark Favas.
2001-05-09 20:06:00 +00:00
Fred Drake bda3a59a93 Itamar Shtull-Trauring <python@itamarst.org>:
Updates zipfile.ZipFile docs to mention the fact that you can create a
ZipFile instance from an arbitrary file-like object.

This closes patch #418011.
2001-05-09 19:57:37 +00:00
Fred Drake fd16834ca7 Three uses of makesockaddr() used sockaddr buffers that had not be cleared;
this could cause invalid paths to be returned for AF_UNIX sockets on some
platforms (including FreeBSD 4.2-RELEASE), appearantly because there is
no assurance that the address will be nul-terminated when filled in by the
kernel.

PySocketSock_recvfrom():  Use PyString_AS_STRING() to get the data pointer
    of a string we create ourselves; there is no need for the extra type
    check from PyString_AsString().

This closes SF bug #416573.
2001-05-09 19:11:33 +00:00
Tim Peters 5ac946c697 SF patch #416249, from Mark Favas: 2.1c1 compile: unused vrbl cleanup 2001-05-09 18:53:51 +00:00
Tim Peters d6283b84c8 Minor fiddling related to
SF patch 416251 2.1c1 mmapmodule: unused vrbl cleanup
2001-05-09 18:48:26 +00:00
Fred Drake 8449f6b95e Update build notes for Mac OS X 10.0.
This closes SF bug #416530.
2001-05-09 18:13:47 +00:00
Fred Drake b2877dd122 Only import termio.h on OSF, and add a comment about why it is needed there.
This header does not exist on all Unix flavors; FreeBSD in particular does
not include it.

This closes SF bug #422320.
2001-05-09 17:53:06 +00:00
Fred Drake b8ac0096b2 Fix the operator precedence table: exponentiation binds tighter than
negation.

This closes SF bug #421999.
2001-05-09 16:51:49 +00:00
Fred Drake 251ebe7d30 Remove items that have been done or are being tracked in the SourceForge
bug tracker.
2001-05-09 16:43:47 +00:00
Fred Drake 283b352d48 Update the directory names to match changes at SourceForge. 2001-05-09 16:33:34 +00:00
Jeremy Hylton e3e61049a5 Trivial tests of urllib2 for recent SF bug 2001-05-09 15:50:25 +00:00
Fred Drake c116b82b77 Work around limitations of the module synopsis table generation to avoid
leaking LaTeX2HTML's internal string munging.

This fixes SF bug #420399.
2001-05-09 15:50:17 +00:00
Jeremy Hylton 78cae61ad4 Raise useful exception when called with URL for which request type
cannot be determined.

Pseudo-fix for SF bug #420724
2001-05-09 15:49:24 +00:00
Fred Drake caa79a9ee4 Minor adjustments to HTML for the module synopsis tables. 2001-05-09 15:32:14 +00:00
Tim Peters 4862ab7bf4 Sheesh -- repair the dodge around "cast isn't an lvalue" complaints to
restore correct semantics.
2001-05-09 08:43:21 +00:00
Tim Peters 9e897f41db Mark Favas reported that gcc caught me using casts as lvalues. Dodge it. 2001-05-09 07:37:07 +00:00
Fred Drake af922187ae Job.build_html(): Be more robust in ensuring about.html exists; copying
the right HTML file to the name about.html is needed even if the
    --numeric option was not given -- some other name may have been
    assigned due to some non-determinism in the algorithm use to perform
    name allocation.  ;-(

This closes the "About..." portion of SF bug #420216.
2001-05-09 04:03:16 +00:00
Fred Drake a7c9ac6544 There is no IMAP class in the imaplib module; the class is IMAP4.
There is no imap module; refer to imaplib instead, since it exists.
Move the "See Also:" section in front of the sub-sections, for
consistency with other portions of the library reference.

This closes the library reference portion of SF bug #420216.
2001-05-09 03:49:48 +00:00
Fred Drake 1ef24e1b30 Note that when inplace=1 existing backup files will be removed silently.
Closes SF bug #420230.
2001-05-09 03:24:55 +00:00
Mark Hammond fb1f68ed7c Always pass a full path name to LoadLibraryEx(). Fixes some Windows 9x problems. As discussed on python-dev 2001-05-09 00:50:59 +00:00
Tim Peters b4bbcd76ea Ack! Restore the COUNT_ALLOCS one_strings code. 2001-05-09 00:31:40 +00:00
Tim Peters cf5ad5d6f6 My change to string_item() left an extra reference to each 1-character
interned string created by "string"[i].  Since they're immortal anyway,
this was hard to notice, but it was still wrong <wink>.
2001-05-09 00:24:55 +00:00
Tim Peters 5b4d477568 Intern 1-character strings as soon as they're created. As-is, they aren't
interned when created, so the cached versions generally aren't ever
interned.  With the patch, the
		Py_INCREF(t);
		*p = t;
		Py_DECREF(s);
		return;
indirection block in PyString_InternInPlace() is never executed during a
full run of the test suite, but was executed very many times before.  So
I'm trading more work when creating one-character strings for doing less
work later.  Note that the "more work" here can happen at most 256 times
per program run, so it's trivial.  The same reasoning accounts for the
patch's simplification of string_item (the new version can call
PyString_FromStringAndSize() no more than 256 times per run, so there's
no point to inlining that stuff -- if we were serious about saving time
here, we'd pre-initialize the characters vector so that no runtime testing
at all was needed!).
2001-05-08 22:33:50 +00:00
Tim Peters 61dff2b285 Blurb about the increased precision of float literals in .pyc/.pyo files. 2001-05-08 15:43:37 +00:00
Tim Peters 72f98e9b83 SF bug #422177: Results from .pyc differs from .py
Store floats and doubles to full precision in marshal.
Test that floats read from .pyc/.pyo closely match those read from .py.
Declare PyFloat_AsString() in floatobject header file.
Add new PyFloat_AsReprString() API function.
Document the functions declared in floatobject.h.
2001-05-08 15:19:57 +00:00
Jack Jansen 569c09c013 Removed some confusing sentences that are no longer relevant now that
calldll is part of the standard macPython distribution.
2001-05-08 14:20:11 +00:00
Fred Drake a6140be7b3 Michael Hudson <mwh21@cam.ac.uk>:
Documentation update to reflect changes to the termios module (noting
that the termios functions can take a file object as well as a file
descriptor).

This closes the documentation portion of SF patch #417081.
2001-05-08 05:37:52 +00:00
Tim Peters e63415ead8 SF patch #421922: Implement rich comparison for dicts.
d1 == d2 and d1 != d2 now work even if the keys and values in d1 and d2
don't support comparisons other than ==, and testing dicts for equality
is faster now (especially when inequality obtains).
2001-05-08 04:38:29 +00:00
Jeremy Hylton 66a7e57c7e Fix several bugs and add two features.
Assertion error message had typos in arguments to string format.

.cover files for modules in packages are now put in the right place.

The code that generate .cover files seemed to prepend a "./" to many
absolute paths, causing them to fail.  The code now checks explicitly
for absolute paths and leaves them alone.

In trace/coverage code, recover from case where module has no __name__
attribute, when e.g. it is executed by PyRun_String().  In this case,
assign modulename to None and hope for the best.  There isn't anywhere
to write out coverage data for this code anyway.

Also, replace several sys.stderr.writes with print >> sys.stderr.

New features:

-C/--coverdir dir: Generate .cover files in specified directory
instead of in the directory where the .py file is.

-s: Print a short summary of files coverred (# lines, % coverage,
name)
2001-05-08 04:20:52 +00:00
Jeremy Hylton 9c90105cb0 Several small changes. Mostly reformatting, adding parens.
Check for free in class and method only if nested scopes are enabled.

Add assertion to verify that no free variables occur when nested
scopes are disabled.

XXX When should nested scopes by made non-optional on the trunk?
2001-05-08 04:12:34 +00:00
Jeremy Hylton 4c889011db SF patch 419176 from MvL; fixed bug 418977
Two errors in dict_to_map() helper used by PyFrame_LocalsToFast().
2001-05-08 04:08:59 +00:00
Jeremy Hylton d37292bb8d Remove unused variable 2001-05-08 04:00:45 +00:00
Tim Peters 7ae2229afb This is a test showing SF bug 422177. It won't trigger until I check in
another change (to test_import.py, which simply imports the new file).  I'm
checking this piece in now, though, to make it easier to distribute a patch
for x-platform checking.
2001-05-08 03:58:01 +00:00
Tim Peters 6d60b2e762 SF bug #422108 - Error in rich comparisons.
2.1.1 bugfix candidate too.
Fix a bad (albeit unlikely) return value in try_rich_to_3way_compare().
Also document do_cmp()'s return values.
2001-05-07 20:53:51 +00:00
Fred Drake b638aafef2 Michael Hudson <mwh21@cam.ac.uk>:
This patch does several things to termios:

(1) changes all functions to be METH_VARARGS
(2) changes all functions to be able to take a file object as the
    first parameter, as per

http://mail.python.org/pipermail/python-dev/2001-February/012701.html

(3) give better error messages
(4) removes a bunch of comments that just repeat the docstrings
(5) #includes <termio.h> before #including <sys/ioctl.h> so more
    #constants are actually #defined.
(6) a couple of docstring tweaks

I have tested this minimally (i.e. it builds, and
doesn't blow up too embarassingly) on OSF1/alpha and
on one of the sf compile farm's solaris boxes, and
rather more comprehansively on my linux/x86 box.

It still needs to be tested on all the other platforms
we build termios on.


This closes the code portion of SF patch #417081.
2001-05-07 17:55:35 +00:00
Fred Drake a8e0827614 Hmm... better add a version annotation for the Iterator Protocol section. 2001-05-07 17:47:07 +00:00
Fred Drake dbcaeda79a Added documentation for PyIter_Check() and PyIter_Next().
Wrapped a long line.
2001-05-07 17:42:18 +00:00
Tim Peters 8572b4fedf Generalize zip() to work with iterators.
NEEDS DOC CHANGES.
More AttributeErrors transmuted into TypeErrors, in test_b2.py, and,
again, this strikes me as a good thing.
This checkin completes the iterator generalization work that obviously
needed to be done.  Can anyone think of others that should be changed?
2001-05-06 01:05:02 +00:00
Tim Peters ef0c42d4e5 Get rid of silly 5am "del" stmts. 2001-05-05 21:36:52 +00:00
Tim Peters cb8d368b82 Reimplement PySequence_Contains() and instance_contains(), so they work
safely together and don't duplicate logic (the common logic was factored
out into new private API function _PySequence_IterContains()).
Visible change:
    some_complex_number  in  some_instance
no longer blows up if some_instance has __getitem__ but neither
__contains__ nor __iter__.  test_iter changed to ensure that remains true.
2001-05-05 21:05:01 +00:00
Andrew M. Kuchling a8defaae04 Skeletal version; I'm checking this in now so I can keep a list of changes,
but don't plan on actually writing any text until, ooh, say, July or
   thereabouts.
2001-05-05 16:37:29 +00:00
Tim Peters 75f8e35ef4 Generalize PySequence_Count() (operator.countOf) to work with iterators. 2001-05-05 11:33:43 +00:00
Tim Peters 1434299a99 Remove redundant line. 2001-05-05 10:14:34 +00:00
Tim Peters de9725f135 Make 'x in y' and 'x not in y' (PySequence_Contains) play nice w/ iterators.
NEEDS DOC CHANGES
A few more AttributeErrors turned into TypeErrors, but in test_contains
this time.
The full story for instance objects is pretty much unexplainable, because
instance_contains() tries its own flavor of iteration-based containment
testing first, and PySequence_Contains doesn't get a chance at it unless
instance_contains() blows up.  A consequence is that
    some_complex_number in some_instance
dies with a TypeError unless some_instance.__class__ defines __iter__ but
does not define __getitem__.
2001-05-05 10:06:17 +00:00
Tim Peters 2cfe368283 Make unicode.join() work nice with iterators. This also required a change
to string.join(), so that when the latter figures out in midstream that
it really needs unicode.join() instead, unicode.join() can actually get
all the sequence elements (i.e., there's no guarantee that the sequence
passed to string.join() can be iterated over *again* by unicode.join(),
so string.join() must not pass on the original sequence object anymore).
2001-05-05 05:36:48 +00:00