summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* Ignore IOError exceptions when writing the message.Mark Hammond2002-09-111-1/+4
|
* test_both(): I believe this was a typo: m is only defined if noBarry Warsaw2002-09-111-1/+1
| | | | | | | | | | | | exception occurred so it should only be closed in the else clause. Without this change we can an UnboundLocalError on Linux: Traceback (most recent call last): File "Lib/test/test_mmap.py", line 304, in ? test_both() File "Lib/test/test_mmap.py", line 208, in test_both m.close() UnboundLocalError: local variable 'm' referenced before assignment
* test_quote_unquote(): Added a test for the rfc822.unquote() patchBarry Warsaw2002-09-111-0/+6
| | | | (adapted from Quinn Dunkan's mimelib SF patch #573204).
* unquote(): Didn't properly de-backslash-ify. This patch (adapted fromBarry Warsaw2002-09-111-3/+3
| | | | Quinn Dunkan's mimelib SF patch #573204) fixes the problem.
* test_utils_quote_unquote(): Test for unquote() properlyBarry Warsaw2002-09-111-0/+7
| | | | de-backslash-ifying.
* rfc822.unquote() doesn't properly de-backslash-ify in Python prior toBarry Warsaw2002-09-111-1/+12
| | | | | 2.3. This patch (adapted from Quinn Dunkan's SF patch #573204) fixes the problem and should get ported to rfc822.py.
* At Jim Fulton's request, increase the maxstring value of _saferepr toGuido van Rossum2002-09-101-1/+7
| | | | | | a more reasonable value. Backport candidate.
* I left some debugging junk in here; removed it. Also replaced a fewTim Peters2002-09-101-2/+3
| | | | | more instances of the bizarre "del f; del m" ways to spell .close() (del won't do any good here under Jython, etc).
* A few days ago a test was added here to ensure that creating an mmapTim Peters2002-09-101-4/+15
| | | | | | | | | | with a size larger than the underlying file worked on Windows. It does <wink>. However, merely creating an mmap that way has the side effect of growing the file on disk to match the specified size. A *later* test assumed that the file on disk was still exactly as it was before the new "size too big" test was added, but that's no longer true. So added a hack at the end of the "size too big" test to truncate the disk file back to its original size on Windows.
* _parsebody(): Instead of raising a BoundaryError when no startBarry Warsaw2002-09-101-2/+5
| | | | | boundary could be found -- in a lax parser -- the entire body is assigned to the message payload.
* Import _isstring() from the compatibility layer.Barry Warsaw2002-09-101-2/+12
| | | | | | | | | | | _handle_text(): Use _isstring() for stringiness test. _handle_multipart(): Add a test before the ListType test, checking for stringiness of the payload. String payloads for multitypes means a message with broken MIME chrome was parsed by a lax parser. Instead of raising a BoundaryError in those cases, the entire body is assigned to the message payload (but since the content type is still multipart/*, the Generator needs to be updated too).
* _isstring(): Factor out "stringiness" test, e.g. for StringType orBarry Warsaw2002-09-102-2/+10
| | | | UnicodeType, which is different between Python 2.1 and 2.2.
* _ascii_split(): Don't lstrip continuation lines. Closes SF bug #601392.Barry Warsaw2002-09-101-1/+1
|
* test_splitting_first_line_only_is_long(): New test for SF bug #601392,Barry Warsaw2002-09-101-1/+38
| | | | broken wrapping of long ASCII headers.
* A sample message with broken MIME boundaries.Barry Warsaw2002-09-101-0/+15
|
* The .preprocess() method didn't work, because it didn't add the input fileAndrew M. Kuchling2002-09-091-0/+1
| | | | to the command-line arguments. Fix this by adding the source filename.
* Include an empty body when checking for a header fileAndrew M. Kuchling2002-09-091-1/+2
| | | | (Bugfix candidate for 2.2, and likely 2.1 as well)
* Fix escaping of non-ASCII characters.Martin v. Löwis2002-09-091-0/+1
|
* shutil.copyfile(src,dst) was clobbering the file when the src and dst wereRaymond Hettinger2002-09-081-0/+5
| | | | | | | the same. Added check to verify the two names are not the same. Does not check the actual files to see if there is a symbolic link. Closes SF bug 490165 and Tzot's patch 604600.
* A little refactoring.Jeremy Hylton2002-09-081-60/+46
| | | | | | | | | | | | Add read(), write(), and readwrite() helper functions to shorten poll functions. Use get() instead of try/except KeyError for lookup. XXX How could the lookup ever fail? Remove module-level DEBUG flag. Use iteritems() instead of items() when walking the socket map. Reformat the functions I touched so that are consistently Pythonic.
* Try to get test to pass on WindowsNeal Norwitz2002-09-071-1/+2
|
* Change UserDict to IterableUserDictRaymond Hettinger2002-09-071-1/+1
|
* Skip UDP testing for MacPython (for now), it hangs. This may be due toJack Jansen2002-09-061-1/+3
| | | | GUSI/Threading interaction, I'm not sure, but I don't have the time to fix this right now.
* Have os.environ() inherit from the iterable version of UserDict.Raymond Hettinger2002-09-061-1/+1
| | | | Closes SF bug 605731.
* Add a test case that checks that the proper exception is raisesWalter Dörwald2002-09-061-0/+15
| | | | | when the replacement from an encoding error callback is itself unencodable.
* Apply diff3.txt (plus additional documentation)Walter Dörwald2002-09-061-38/+124
| | | | | | | | | from SF patch http://www.python.org/sf/554192 This adds two new functions to mimetypes: guess_all_extensions() which returns a list of all known extensions for a mime type, and add_type() which adds one mapping between a mime type and an extension.
* test_set_param(), test_del_param(): Test RFC 2231 encoding support byBarry Warsaw2002-09-061-1/+68
| | | | Oleg Broytmann in SF patch #600096. Whitespace normalized by Barry.
* _formatparam(), set_param(): RFC 2231 encoding support by OlegBarry Warsaw2002-09-061-3/+11
| | | | | | Broytmann in SF patch #600096. Specifically, the former function now encodes the triplets, while the latter adds optional charset and language arguments.
* test_mondo_message(): "binary" is not a legal content type, so withBarry Warsaw2002-09-061-2/+3
| | | | | the previous RFC 2045, $5.2 repair to get_content_type() this subpart's type will now be text/plain.
* test_replace_header(): New test for Message.replace_header().Barry Warsaw2002-09-061-0/+17
|
* replace_header(): New method given by Skip Montanaro in SF patchBarry Warsaw2002-09-061-1/+15
| | | | | #601959. Modified slightly by Barry (who added the KeyError in case the header is missing.
* SF bug # 585792, Invalid mmap crashes Python interpreterNeal Norwitz2002-09-052-0/+16
| | | | | Raise ValueError if user passes a size to mmap which is larger than the file.
* SF # 555779, import user doesn't work with CGIsNeal Norwitz2002-09-052-2/+6
|
* M PyShell.pyKurt B. Kaiser2002-09-053-57/+55
| | | | | | | | | | | | | | | | | | | | | | | | M RemoteDebugger.py M ScriptBinding.py Restart the execution server with a clean environment and execute the active module from scratch upon activation of Run/F5. Add functionality to PyShell.py to restart the execution server in a new subprocess. The server makes a connection to the Idle client which sends a block of code to be executed. Modify ScriptBinding.py to restart the subprocess upon Run/F5, assuming that an execution is not currently in progress. Remove Import Module functionality, not required now that the code is executed in a clean environment. If the Debugger is active, also restart the subprocess side of the split debugger. Add functionality to RemoteDebugger.py to support this. At this time breakpoints will be lost in the subprocess if Run/F5 is activated. A subsequent checkin of PyShell.py will implement reloading of the breakpoints into the subprocess debugger. I'm keeping this separate as the design may change.
* smptlib did not handle empty addresses.Raymond Hettinger2002-09-051-3/+3
| | | | | | | | The problem was that it expected rfc822.parseaddr() to return None upon a parse failure. The actual, documented return value for a parse failure is (None, None). Closes SF bug 602029.
* Change the unicode.translate docstring to document thatWalter Dörwald2002-09-041-0/+2
| | | | | | | | | | Unicode strings (with arbitrary length) are allowed as entries in the unicode.translate mapping. Add a test case for multicharacter replacements. (Multicharacter replacements were enabled by the PEP 293 patch)
* Delete the %c test from test_date_time() untill Brett Cannon has timeGuido van Rossum2002-09-031-2/+2
| | | | | | to fix it. (It fails when the day of the month is a 1-digit number, because %c produces space+digit there, while strptime seems to expect zero+digit somehow.)
* Move code for reading chunked responses in helper function,Jeremy Hylton2002-09-031-45/+52
| | | | along with some small changes (e.g. use of +=).
* Add a custom __str__ method to KeyError that applies repr() to theGuido van Rossum2002-09-031-1/+1
| | | | | missing key. (Also added a guard to SyntaxError__str__ to prevent calling PyString_Check(NULL).)
* SF bug [ 600488 ] Robustness tweak to httplib.pyJeremy Hylton2002-09-031-3/+1
| | | | | If the transfer-encoding is unknown, ignore it. Suggested by Tom Emerson.
* testConnectTimeout(): set the timeout to a smaller value; 0.02Guido van Rossum2002-09-031-1/+1
| | | | sometimes wasn't short enough.
* Fix for SF bug 601077 by Zack Weinberg.Guido van Rossum2002-09-031-5/+12
| | | | | | | | The new execvpe code would sometimes do the wrong thing when a non-executable file existed earlier in the path and an executable file of the same name existed later in the path. This patch restores the proper behavior (which is to execute the second file). When only a non-executable file exists, the correct error is still reported.
* Check whether a string resize is necessary at the endWalter Dörwald2002-09-031-1/+8
| | | | | | | | | of PyString_DecodeEscape(). This prevents a call to _PyString_Resize() for the empty string, which would result in a PyErr_BadInternalCall(), because the empty string has more than one reference. This closes SF bug http://www.python.org/sf/603937
* (Re)Apply Sourceforge Python patch 520483, Sourceforge Idlefork patchKurt B. Kaiser2002-09-021-1/+1
| | | | | | | | | | | | | | | | 521908 (again) to MAIN The patch applied by Steven was inadvertently reverted during the transition to GRPC. Python 2.3a0 (#3, May 8 2002, 23:37:01) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 Type "copyright", "credits" or "license" for more information. GRPC IDLE Fork 0.8.2 >>> print u'\xbfQu\xe9 pas\xf3?' ¿Qué pasó? Modified Files: OutputWindow.py
* PEP 293 implemention (from SF patch http://www.python.org/sf/432401)Walter Dörwald2002-09-022-1/+495
|
* _structure(): Use .get_content_type()Barry Warsaw2002-09-011-1/+1
|
* Further SET_LINENO reomval fixes. See comments in patch #587933.Michael W. Hudson2002-08-302-1/+110
| | | | | | | | | | Use a slightly different strategy to determine when not to call the line trace function. This removes the need for the RETURN_NONE opcode, so that's gone again. Update docs and comments to match. Thanks to Neal and Armin! Also add a test suite. This should have come with the original patch...
* Many hopefully benign style clean ups. Still passes the test suite ofBarry Warsaw2002-08-291-172/+200
| | | | course.
* strptime(): The code that was adding 12 to PM hours was incorrectBarry Warsaw2002-08-291-5/+12
| | | | | | | | | because it added it to 12 PM too. 12 PM should be hour 12 not hour 24. Also cleaned up a minor style nit. There are more style problems in this file that I'll clean up next (but I didn't want them to overwhelm the substance of this fix).
* The test I saw failing this morning just happened to be run at 8amBarry Warsaw2002-08-291-0/+12
| | | | | | | | localtime, which in -0400 is 12 noon GMT. The bug boiled down to broken conversion of 12 PM to hour 12 for the '%I %p' format string. Added a test for this specific condition: Strptime12AMPMTests. Fix to _strptime.py coming momentarily.