Commit Graph

9896 Commits

Author SHA1 Message Date
Walter Dörwald
4d3fec604d Backport checkin (and the appropriate fix to the test):
If the data read from the bytestream in readline() ends in a '\r' read one more
byte, even if the user has passed a size parameter. This extra byte shouldn't
cause a buffer overflow in the tokenizer. The original plan was to return a line
ending in '\r', which might be recognizable as a complete line and skip any '\n'
that was read afterwards. Unfortunately this didn't work, as the tokenizer only
recognizes '\n' as line ends, which in turn lead to joined lines and
SyntaxErrors, so this special treatment of a split '\r\n' has been dropped. (It
can only happen with a temporarily exhausted bytestream now anyway.)
Fixes parts of SF bugs #1163244 and #1175396.
2005-04-21 21:53:43 +00:00
Walter Dörwald
67e4ecd451 Backport checkin:
Fix for SF bug #1175396: readline() will now read one more character, if
the last character read is "\r" (and size is None, i.e. we're allowed to
call read() multiple times), so that we can return the correct line ending
(this additional character might be a "\n").

If the stream is temporarily exhausted, we might return the wrong line ending
(if the last character read is "\r" and the next one (after the byte stream
provides more data) is "\n", but at least the atcr member ensures that we
get the correct number of lines (i.e. this "\n" will not be treated as
another line ending).
2005-04-04 21:56:28 +00:00
Hye-Shik Chang
6ca93ed0c9 Backport from 1.27:
Fix testcase for 64bit BSD systems: long is 8 bytes for those systems
so there's no need to pad after off_t members.  And a small typo fix.
2005-04-04 15:28:18 +00:00
Vinay Sajip
6721a3464a Added optional encoding argument to File based handlers and improved error handling for SysLogHandler 2005-03-31 20:12:55 +00:00
Vinay Sajip
2d6fe25689 Minor changes to imports 2005-03-31 20:11:45 +00:00
Vinay Sajip
d7937f0b43 Misc. changes 2005-03-31 20:10:38 +00:00
Walter Dörwald
9bd2b50cd7 Backport checkin:
Since PyPI only accepts UTF-8 encoded data now, make sure that the data is
properly encoded and include the encoding in the Content-Type header.
2005-03-31 14:16:30 +00:00
Michael W. Hudson
21f898741e Backport:
Fix for rather inaccurately titled bug

[ 1165306 ] Property access with decorator makes interpreter crash

Don't allow the creation of unbound methods with NULL im_class, because
attempting to call such crashes.

Backport candidate.
2005-03-31 10:22:43 +00:00
Raymond Hettinger
4cf27049b6 SF bug #1770766: weakref proxy has incorrect __nonzero__ behavior. 2005-03-31 04:07:55 +00:00
Anthony Baxter
11cc947446 *** empty log message *** 2005-03-30 03:01:43 +00:00
Anthony Baxter
e3357548ca backport of 1.122
SF patch 1167316:  doctest.py fails self-test if run directly.
2005-03-29 12:35:54 +00:00
Anthony Baxter
92da66aad5 2.4.1 preparations. 2005-03-29 12:33:34 +00:00
Raymond Hettinger
680db018be - Fixed decimal operator and comparison methods to return NotImplemented
instead of raising a TypeError when interacting with other types.
  Allows other classes to successfully implement __radd__ style methods.
2005-03-27 10:55:27 +00:00
Anthony Baxter
905e91240d 2.4.1rc2 setup 2005-03-16 14:34:23 +00:00
Raymond Hettinger
3a3f9cc9c1 Decimal special values did not hash properly. 2005-03-15 23:36:19 +00:00
Walter Dörwald
2a20d4bd31 Backport checkin:
Add default value for "whence" argument.
2005-03-14 19:26:47 +00:00
Walter Dörwald
96aeafbfbc Backport checkin:
Reset internal buffers when seek() is called. This fixes SF bug #1156259.
2005-03-14 19:20:19 +00:00
Martin v. Löwis
d84b9d30c3 Backport of change to os.access to encode Unicode file names with
the file system encoding.
2005-03-13 22:18:26 +00:00
Johannes Gijsbers
d4f78f3c63 Patch #1159931: a test case for the buggy cases fixed by the last checkin. 2005-03-12 16:48:50 +00:00
Johannes Gijsbers
d86254bc25 Backport of patch #1159931/bug #1143895: inspect.getsource failed when
functions, etc., had comments after the colon, and some other cases.
This patch take a simpler approach that doesn't rely on looking for a
':'. Test cases are not backported, as test_inspect.py has been
rewritten using unittest on the trunk.

Thanks Simon Percivall!
2005-03-12 16:38:39 +00:00
Brett Cannon
e3fa0611a9 Fix test_socket's test for socket.getfqdn() to also accept the result from
socket.gethostname() as a valid return value.

Also clarified the docs as they were a little hazy on the subject matter.
2005-03-12 06:15:56 +00:00
Tim Peters
c13c04007d Bug #1160802: Can't build Zope on Windows w/ 2.4.1c1.
MSVCCompiler.initialize():  set self.initialized to True, as suggested
by AMK.  Else we keep growing the PATH endlessly, with each new C
extension built, until putenv() complains.

This doesn't appear to be an issue on the HEAD (MSVCCompiler initializes
itself via __init__() on the HEAD).

Also added a "2.4.1c2" section to NEWS.  Not meant to imply that Anthony
will do a 2.4.1c2 release, just needed to a place to put the news about the
MSVCCompiler bugfix.
2005-03-11 17:20:43 +00:00
Anthony Baxter
b3baf322fb pre-release magic 2005-03-09 11:54:29 +00:00
Anthony Baxter
74105f1424 tabstop delenda est 2005-03-09 11:45:49 +00:00
Greg Ward
777374e8db SF #818006: revert addition of 'closed', 'mode', and 'name' attributes
to oss_audio_device objects.
2005-03-09 00:55:19 +00:00