Commit graph

43198 commits

Author SHA1 Message Date
Walter Dörwald
f0d1c1f3ec Fix title endtag in HTMLCalender.formatyearpage(). Fix documentation for
HTMLCalender.formatyearpage() (there's no themonth parameter).

This fixes issue1046.
2007-08-28 16:38:26 +00:00
Thomas Wouters
3ccec68a05 Improve extended slicing support in builtin types and classes. Specifically:
- Specialcase extended slices that amount to a shallow copy the same way as
   is done for simple slices, in the tuple, string and unicode case.

 - Specialcase step-1 extended slices to optimize the common case for all
   involved types.

 - For lists, allow extended slice assignment of differing lengths as long
   as the step is 1. (Previously, 'l[:2:1] = []' failed even though
   'l[:2] = []' and 'l[:2:None] = []' do not.)

 - Implement extended slicing for buffer, array, structseq, mmap and
   UserString.UserString.

 - Implement slice-object support (but not non-step-1 slice assignment) for
   UserString.MutableString.

 - Add tests for all new functionality.
2007-08-28 15:28:19 +00:00
Lars Gustäbel
a9bad98e3d TarFile.__init__() no longer fails if no name argument is passed and
the fileobj argument has no usable name attribute (e.g. StringIO).

(backported from r57616)
2007-08-28 12:33:15 +00:00
Lars Gustäbel
0f4a14b56f TarFile.__init__() no longer fails if no name argument is passed and
the fileobj argument has no usable name attribute (e.g. StringIO).

(will backport to 2.5)
2007-08-28 12:31:09 +00:00
Eric Smith
9e7c8da61c Simplified tuple returned by string._formatter_parser to only have
4 elements.  No need for old is_markup element, the same information
is indicated by literal_string being None.

Factored string.Formatter class to make subclasses easier to write.
2007-08-28 11:15:20 +00:00
Gregory P. Smith
3fd22da612 some test suite cleanup, use tempfile.mkdtemp() in setUp and
shutil.rmtree() in tearDown().  add missing tests to the list
in the test_bsddb3 suite.
2007-08-28 08:05:56 +00:00
Lars Gustäbel
a280ca7594 Conform to strict str/bytes distinction. 2007-08-28 07:34:33 +00:00
Neal Norwitz
6665cefb85 Apply this change from 2.6. Hopefully it doesn't cause a conflict.
I really want to test the buildbots.  This change is necessary
to get the test to be more stable and not crash due to previous
processes exitting.
2007-08-28 06:29:09 +00:00
Collin Winter
6d199ef14b Remove unneeded import. 2007-08-28 06:07:49 +00:00
Collin Winter
8ef94e8e88 Remove unneeded imports from bsddb's test_dbshelve. 2007-08-28 06:07:12 +00:00
Collin Winter
115cde3531 Style/idiom cleanup of binhex module. 2007-08-28 06:06:33 +00:00
Guido van Rossum
1b261dff3e Make this work on Mac as well (where Type and Creator are bytes instead of str). 2007-08-28 03:35:35 +00:00
Guido van Rossum
92bab812f7 My wish for TempFile is fulfilled. 2007-08-28 03:32:38 +00:00
Guido van Rossum
f0c7416157 Patch # 1033 by Adam Hupp:
1) tempfile.TemporaryFile, NamedTemporaryFile, and SpooledTemporaryFile
    now pass newline and encoding to the underlying io.open call.
 2) test_tempfile is updated
 3) test_csv is updated to use the new arguments.
2007-08-28 03:29:45 +00:00
Guido van Rossum
a1a68521db Make test_cgi pass. I changed the internal file created by make_file()
to be a text file.  (XXX It should use UTF-8 as the encoding.)
I also removed the unised 'binary' argument from the make_file() signature.

XXX I am under no illusion that this is now working; I're pretty sure
it would be more principled if it always read binary data.  But that's
for someone who actually cares about this module.
2007-08-28 03:11:34 +00:00
Guido van Rossum
7b4beea02e Make dumbdbm use bytes for keys consistently. 2007-08-28 00:09:54 +00:00
Guido van Rossum
bb839ef8ac More str/bytes goodness. 2007-08-27 23:58:21 +00:00
Guido van Rossum
ec42ffd0a3 More str/bytes strictness.
(XXX Though perhaps temp files should be created in text mode by default?!)
2007-08-27 23:40:36 +00:00
Guido van Rossum
199fc75dc1 str/bytes strictness. 2007-08-27 23:38:12 +00:00
Guido van Rossum
b644fb43d6 str/bytes strictness. 2007-08-27 23:36:53 +00:00
Guido van Rossum
7dcb844892 More str/bytes strictness. 2007-08-27 23:26:56 +00:00
Guido van Rossum
26d95c3d07 More str/bytes fixes. 2007-08-27 23:18:54 +00:00
Guido van Rossum
e22905a06c More changes needed to make things work once bytes and str are truly divorced. 2007-08-27 23:09:25 +00:00
Guido van Rossum
25a29a9534 One further change. 2007-08-27 22:31:36 +00:00
Guido van Rossum
54a40cb81f Force test_xmlrpc to pass. I'm not happy with how I did this, but I don't
see a better way; the 'Binary' class is poorly specified so it's unclear
what behavior is relied upon.
2007-08-27 22:27:41 +00:00
Guido van Rossum
98b349f8e6 Fix some tests I broke. (More to follow.) 2007-08-27 21:47:52 +00:00
Guido van Rossum
d51b579c51 Patch # 1739906 by Christian Heimes -- add reduce to functools (importing
it from __builtin__).
2007-08-27 20:51:00 +00:00
Guido van Rossum
1f2ca56e29 Changes in anticipation of stricter str vs. bytes enforcement. 2007-08-27 20:44:15 +00:00
Guido van Rossum
09549f4407 Changes in anticipation of stricter str vs. bytes enforcement. 2007-08-27 20:40:10 +00:00
Eric Smith
739e2ad64b Additional test for formatting code. 2007-08-27 19:07:22 +00:00
Guido van Rossum
9c62772d5e Changes in anticipation of stricter str vs. bytes enforcement. 2007-08-27 18:31:48 +00:00
Guido van Rossum
700bd92677 Fix a few places that broke due to a recent change to io.py. 2007-08-27 18:10:06 +00:00
Guido van Rossum
5abbf750a2 Changes to io.py and socket.py by Christian Heimes.
- Replace all asserts by ValuleErrors or TypeErrors as appropriate.
- Add _checkReadable, _checkWritable methods; these check self.closed too.
- Add a test that everything exported by io.py exists, and is either
  an exception or an IOBase instance (except for the open function).
- Default buffering to 1 if isatty() (I had to tweak this to enforce
  the *default* bit -- GvR).
2007-08-27 17:39:33 +00:00
Guido van Rossum
6dab795351 Changes in anticipation of stricter str vs. bytes enforcement. 2007-08-27 17:25:39 +00:00
Guido van Rossum
39478e8528 Changes in anticipation of stricter str vs. bytes enforcement. 2007-08-27 17:23:59 +00:00
Guido van Rossum
ba8c5653cc > Regardless, building a fixed test certificate and checking it in sounds like
> the better option.  Then the openssl command in the test code can be turned
> into a comment describing how the test data was pregenerated.

Here's a patch that does that.

Bill
2007-08-27 17:19:42 +00:00
Guido van Rossum
85825dc1ff Changes preparing for stricter enforcement of bytes vs. str. 2007-08-27 17:03:28 +00:00
Eric Smith
e226b55963 PEP 3101: Removed _formatter_xxx routines from sysmodule, and made them unicode methods instead (per GvR suggestion). 2007-08-27 11:28:18 +00:00
Skip Montanaro
1ab6a25401 Backport this change to get test_sqlite working on Macs. Same change Thomas
made to the trunk awhile ago I believe.
2007-08-27 03:00:59 +00:00
Facundo Batista
f91ad6a5da Ignore test failures caused by 'resource temporarily unavailable'
exceptions raised in the test server thread, since SimpleXMLRPCServer
does not gracefully handle them.  Changed number of requests handled
by tests server thread to one (was 2) because no tests require more
than one request. [GSoC - Alan McIntyre]
2007-08-27 01:15:34 +00:00
Neal Norwitz
9eb9b10751 If we can't create a certificate, print a warning, but don't fail the test.
Modified patch from what Bill Janssen sent on python-3000.
2007-08-27 01:15:33 +00:00
Neal Norwitz
3e533c2290 Make a utility function for handling (printing) an error 2007-08-27 01:03:18 +00:00
Neal Norwitz
f6f525b7c9 Stop using string.join (from the module) to ease upgrade to py3k 2007-08-27 00:58:33 +00:00
Neal Norwitz
d082b6eaac os.getcwd() now returns a normal string (ie, unicode) 2007-08-26 23:37:53 +00:00
Guido van Rossum
19b4a272ea Cosmetics in error messages. 2007-08-26 23:30:31 +00:00
Eric Smith
7ade6485ab PEP 3101: Completed string.Formatter class. Reimplemented field_name to object transformation. 2007-08-26 22:27:13 +00:00
Neal Norwitz
d6a51e64d7 Another patch from Bill Janssen that:
1)  Fixes the bug that two class names are initial-lower-case.
2)  Replaces the poll waiting for the server to become ready with
    a threading.Event signal.
2007-08-26 22:20:03 +00:00
Neal Norwitz
2bf4d5ba28 Use the correct variable name 2007-08-26 22:16:55 +00:00
Neal Norwitz
1b2f62d139 Catch IOError for when the device file doesn't exist or the user doesn't have
permission to write to the device.
2007-08-26 22:16:23 +00:00
Neal Norwitz
15d4e56c40 Get the test passing by commenting out some writes (should they be removed?) 2007-08-26 21:40:16 +00:00