Commit Graph

3885 Commits

Author SHA1 Message Date
Martin v. Löwis 46fa39ab1d Add toprettyxml method into minidom, closes patch #103471. 2001-02-06 00:14:08 +00:00
Guido van Rossum 9e1fe1ec67 A couple of changes to make this more conformant. MvL and Uche agree.
This will make it incompatible with the version found in Python 2.0.
Does this need to be done to PyXML too?

Changes that might break existing code are marked with (!) below.

- Formatting nit: no spaces inside parentheses: foo( a ) -> foo(a).

- Break long lines.

- (!) Fix getAttribute() and getAttributeNS() to return "" instead of
  raising KeyError when the attribute is not found.

- (!) Fix getAttributeNodeNS() to return None instead of raising
  KeyError.  (Curiously, getAttributeNode() already did this.)

- Added hasAttributes(), which returns true iff the node has any
  attributes.  )This is DOM level 3.)

- (!) In createDocument(), if the qualified name is not empty,
  actually create and insert the first element with that name (this
  will become doc.documentElement).  MvL believes that it should be an
  error to specify an empty qualified name; I'm not going there today,
  since it would require making a matching change to pulldom.  Maybe
  MvL will do this.

- In Document.writexml(), insert an xml declaration at the top.  (This
  doesn't include the encoding since there's no way to specify the
  encoding.  If that's preferred, all writexml() methods should be
  fixed to support an optional encoding argument that they pass to
  each other -- and they should use it to encode all text they write,
  too.  Later.)
2001-02-05 19:17:50 +00:00
Guido van Rossum 795ad56b31 Don't get fooled by an empty prefix with a valid namespaceURI -- in
this case, the code used to generate invalid tags and attribute names
with a leading colon, e.g. <:tag> or <tag :attr="foo">.
2001-02-05 18:50:15 +00:00
Andrew M. Kuchling 1b26b6a5f1 Patch #103587: Fix typo that broke the install_data command; caught by
Uche Ogbuji
2001-02-05 17:43:11 +00:00
Jeremy Hylton de6024872a Fix test 9 (caught by ?!ng)
Add tests for unbound locals (Nick Mathewson)
2001-02-05 17:35:20 +00:00
Tim Peters d66595fe42 Renamed _testXXX to _testcapiXXX. Jack is my hero -- good call! 2001-02-04 03:09:53 +00:00
Neil Schemenauer 693291ba23 Superseded by $(srcdir)/Makefile.pre.in. 2001-02-03 17:18:21 +00:00
Fred Drake 2523977fb2 Added Node.isSameNode() support. 2001-02-02 19:40:19 +00:00
Fred Drake 0399bd8ce2 Ouch! I need a better test suite for this. ;-( 2001-02-02 19:28:35 +00:00
Jeremy Hylton 5e7cb240af Add minimal interface to symtable: _symtable module. 2001-02-02 18:24:26 +00:00
Fred Drake 312a5dc539 WeakDictionary.items(): Do not allow (key,ref) pairs to leak out for
dead references.
2001-02-02 15:13:24 +00:00
Tim Peters 9ea17ac595 Patch derived from Trent's 101162: a Python/C API testing framework.
STILL NEEDS UNIX BUILD CHANGES.
2001-02-02 05:57:15 +00:00
Fred Drake 0c07b50811 The socket constants have been moved to the socket module for a long time;
the standard library does not use the SOCKET module any more, and it is
not defined for all platforms (Windows, in particular).
2001-02-02 02:51:21 +00:00
Jeremy Hylton 42dd01add5 An ssl-wrapped socket now returns '' on EOF, just like a regular
socket -- as suggested by Clarence Gardner.

Fix httplib to comply with the new ssl-socket interface.
2001-02-01 23:35:20 +00:00
Jeremy Hylton 3faa52ecc4 Allow 'continue' inside 'try' clause
SF patch 102989 by Thomas Wouters
2001-02-01 22:48:12 +00:00
Jeremy Hylton 483638c9a8 Undo recent change that banned using import to bind a global, as per
discussion on python-dev.  'from mod import *' is still banned except
at the module level.

Fix value for special NOOPT entry in symtable.  Initialze to 0 instead
of None, so that later uses of PyInt_AS_LONG() are valid.  (Bug
reported by Donn Cave.)

replace local REPR macros with PyObject_REPR in object.h
2001-02-01 20:20:45 +00:00
Jeremy Hylton 6fe0a82ecb move extra arguments to the back of the new.code() arglist 2001-02-01 19:50:29 +00:00
Fred Drake acfb3f6006 Revise the driver code to be more informative in the final report. 2001-02-01 18:11:29 +00:00
Tim Peters bcd725fc45 Repaired a docstring. 2001-02-01 10:06:53 +00:00
Fred Drake 41deb1efc2 PEP 205, Weak References -- initial checkin. 2001-02-01 05:27:45 +00:00
Tim Peters 0de88fc4b1 Change random.seed() so that it can get at the full range of possible
internal states.  Put the old .seed() (which could only get at about
the square root of the # of possibilities) under the new name .whseed(),
for bit-level compatibility with older versions.  This occurred to me
while reviewing effbot's book (he found himself stumbling over .seed()
more than once there ...).
2001-02-01 04:59:18 +00:00
Barry Warsaw 7e0d9563ca Long ago, Guido suggested that I add this to the standard library.
I'm now checking it in.  I need to write some documentation for it,
but I don't have time right now.  Still, I wanted to get this into
2.1a2.

# Overview:
#
# This file implements the minimal SMTP protocol as defined in RFC 821.  It
# has a hierarchy of classes which implement the backend functionality for the
# smtpd.  A number of classes are provided:
#
#   SMTPServer - the base class for the backend.  Raises an UnimplementedError
#   if you try to use it.
#
#   DebuggingServer - simply prints each message it receives on stdout.
#
#   PureProxy - Proxies all messages to a real smtpd which does final
#   delivery.  One known problem with this class is that it doesn't handle
#   SMTP errors from the backend server at all.  This should be fixed
#   (contributions are welcome!).
#
#   MailmanProxy - An experimental hack to work with GNU Mailman
#   <www.list.org>.  Using this server as your real incoming smtpd, your
#   mailhost will automatically recognize and accept mail destined to Mailman
#   lists when those lists are created.  Every message not destined for a list
#   gets forwarded to a real backend smtpd, as with PureProxy.  Again, errors
#   are not handled correctly yet.
2001-01-31 22:51:35 +00:00
Barry Warsaw 81ad67cdc6 Two changes:
- All constructors grow an optional argument `factory' which is a
  callable used when new message instances are created by the next()
  methods.  Defaults to the rfc822.Message class.

- A new subclass of UnixMailbox is added, called PortableUnixMailbox.
  It's identical to UnixMailbox, but uses a more portable test for
  From_ delimiter lines.  With PortableUnixMailbox, any line that
  starts with "From " is considered a delimiter (this should really
  check for two newlines before the F, but it doesn't.
2001-01-31 22:13:15 +00:00
Jeremy Hylton 2fa699ec60 move "from stat import *" to module level 2001-01-31 20:07:17 +00:00
Moshe Zadka fc3fc337d0 Checking in patch #103478 -- makes popen2 and fork1 tested on BeOS.
Tested for not breaking builds on Linux.
2001-01-30 18:35:32 +00:00
Jeremy Hylton 251ef9666e Fix test for free ref to global. This test should have caught a
recently fixed bug, but it checked for the wrong answer.
2001-01-30 01:26:53 +00:00
Jeremy Hylton ac25a38841 add test for illegal imports 2001-01-30 01:25:56 +00:00
Marc-André Lemburg bf222c9f12 Fixed posixpath.normpath() to respect two leading slashes, but
turn three or more into a single slash. (This is in sync with POSIX
susv2 according to Fredrik.)
2001-01-29 11:29:44 +00:00
Marc-André Lemburg fde66e1bcc Fixed .capitalize() method of Unicode objects to work like the
corresponding string method. Added tests for this too.

Patch written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
2001-01-29 11:14:16 +00:00
Moshe Zadka 497671e094 The one thing I love more then writing code is deleting code.
* Removed func_hash and func_compare, so they can be treated as immutable
  content-less objects (address hash and comparison)
* Added tests to that affect to test_funcattrs (also testing func_code
  is writable)
* Reverse meaning of tests in test_opcodes which checked identical code
  gets identical functions
2001-01-29 06:21:17 +00:00
Skip Montanaro 080c99745f added several more urlencode test cases - part of patch 103391 2001-01-28 21:12:22 +00:00
Skip Montanaro 14f1ad4a94 allow first param urlencode to be a sequence of two-element tuples - in this
case, the order of parameters in the output matches the order of the inputs.
2001-01-28 21:11:12 +00:00
Jack Jansen b4cd5c1a3a Remove single "." components from pathnames, and return os.curdir if
the resulting path is empty.
2001-01-28 12:23:32 +00:00
Jack Jansen a221b2a7a9 Data pathnames were not converted from URL-style to local style. Fixed. 2001-01-28 12:22:14 +00:00
Tim Peters 0149e84af2 SF bug #130306: statcache.py full of thread problems.
Fixed the thread races.  Function forget_dir was also utterly Unix-specific.
2001-01-28 05:07:00 +00:00
Fred Drake 64d42c5bb1 Added tests for new signature of new.instance().
Use test_support.verify() where applicable.
2001-01-28 03:57:39 +00:00
Martin v. Löwis 2bcb32372c Except HierarchyRequestErr instead of TypeError. 2001-01-27 09:17:55 +00:00
Martin v. Löwis 70d39a60a8 Re-indent. 2001-01-27 09:01:20 +00:00
Martin v. Löwis 711a5bdc44 Synchronize with PyXML 1.5. 2001-01-27 08:56:24 +00:00
Martin v. Löwis 0591725bc5 Synchronize with PyXML 1.10
Break cycle involving expat parser in close().
Add lex handler support to SAX2 pyexpat
2001-01-27 08:56:24 +00:00
Martin v. Löwis 52ce0d0837 Re-indent. 2001-01-27 08:47:37 +00:00
Martin v. Löwis d5fb58f1e3 Merge changes of PyXML 1.13:
Use nodeName, not tagName in attributes.
Provide get method for dictionary-like objects.
Use DOM exceptions instead of standard exceptions.
2001-01-27 08:38:34 +00:00
Martin v. Löwis e3fc722628 Synchronize with 1.10 of PyXML: Close parser when done. 2001-01-27 08:34:21 +00:00
Tim Peters 715c4c412b New comment block to Clarify a subtlety. 2001-01-26 22:56:56 +00:00
Martin v. Löwis 04a1a542cb Patch #103052: Restore non-cyclic operation of pulldom.PullDOM 2001-01-26 18:53:42 +00:00
Marc-André Lemburg 49c994239f Added an execution layer to be able to customize per-extension
building.
2001-01-26 18:00:48 +00:00
Jeremy Hylton d30e587e00 unnecessary semicolon 2001-01-26 17:15:18 +00:00
Jeremy Hylton 5b48c45736 unnecessary semicolon 2001-01-26 17:08:32 +00:00
Tim Peters e360d9507a The combo of getstate/setstate/jumpahead is very powerful, but needs
examples to flesh it out for the uninitiated.  Here they are.
2001-01-26 10:00:39 +00:00
Tim Peters 85e2e4742d SF bug 130030: Claim of bad betavariate algorithm. 2001-01-26 06:49:56 +00:00