Commit Graph

34519 Commits

Author SHA1 Message Date
Guido van Rossum 5ed317d790 Do the right thing for CYGWIN. 2007-07-18 16:59:11 +00:00
Martin v. Löwis 10a60b3ec0 Change Py_BuildValue to generate Unicode objects for
's' and 'c' codes.
Change pickle to dump bytes objects using the 'S'
code, and to load the 'S' code as byte objects.
Change datetime and array to generate and expect
bytes objects in reduce/unreduce.
2007-07-18 02:28:27 +00:00
Collin Winter 6f2df4d5e1 Run 2to3 over the Demo/ directory to shut up parse errors from 2to3 about lingering print statements. 2007-07-17 20:59:35 +00:00
Guido van Rossum a8c360ee76 SF patch# 1755229 by Amaury Forgeot d'Arc: fix _winreg module and tests.
Untested.
2007-07-17 20:50:43 +00:00
Guido van Rossum 52b8976a03 Minimal changes to make ftplib work. Basically, this opens the stream in
text mode and encodes commands being sent.  The default encoding is ASCII,
there's a class/instance variable 'encoding' you could set to change it.
2007-07-17 20:45:57 +00:00
Guido van Rossum 93adc5dfaf (1) SF patch# 1755214 by Amaury Forgeot d'Arc which makes some tests
pass on Windows.

(2) Fix a typo in makefile() where using a text mode would attempt to set
    self.mode instead of text.mode.
2007-07-17 20:41:19 +00:00
Collin Winter dc40ae6b24 Fix two bugs from the map->itertools.imap switch. 2007-07-17 00:39:32 +00:00
Collin Winter 2c8fef07f6 Fix a bug in distutils.core's error handling. 2007-07-17 00:38:21 +00:00
Guido van Rossum e63bae6b09 Make the test of chr() overflow pass.
(Sigh. There are so many redundant tests.)
2007-07-17 00:34:25 +00:00
Collin Winter 72e110c1cd Fix a bug from the map->itertools.imap conversion. 2007-07-17 00:27:30 +00:00
Guido van Rossum 2698631d57 Make test_pickletools.py pass. 2007-07-17 00:19:46 +00:00
Guido van Rossum 1c5a98a360 Fix for cProfile.
SF patch# 1755176 by Amaury Forgeot d'Arc.
2007-07-16 23:36:05 +00:00
Guido van Rossum d77d6992a5 Change a bunch of file encodings from Latin-1 to UTF-8.
Remove the encoding from Tix.py (it doesn't seem to need one).
Note: we still have to keep the "coding: utf-8" declaration
for files that aren't pure ASCII, as the default per PEP 3120
hasn't been implemented yet.
2007-07-16 23:10:57 +00:00
Guido van Rossum 6a2ccd0273 Fix for one particular test (test_file). There are still four errors.
(This is not the fix suggested by Hasan Diwan in SF patch# 1753889.)
2007-07-16 20:51:57 +00:00
Guido van Rossum 307fa8cc82 Three patches by Amaury Forgeot d'Arc; SF patch# 1754484. 2007-07-16 20:46:27 +00:00
Guido van Rossum 27ae52362c Fix test_uu.py by inserting an explicit conversion from bytes to str
into uu.py.  (This is *not* SF patch 1754339, which I rejected.)
2007-07-16 19:50:03 +00:00
Guido van Rossum 456fe5d3ca Fix a weird use of try/finally to close a file.
(There are more places that don't close 'f' at all if an error occurs,
but none have a bogus try/finally pattern.)
2007-07-16 19:42:05 +00:00
Guido van Rossum b358a2c423 SF patch# 1752647 by Joe Gregorio.
Fixes to make test_mmap.py pass unit tests.
Moves the interface from being string based to being bytes based.
2007-07-16 19:29:02 +00:00
Guido van Rossum 88079f472e Use the encoding specification when reading the source file. 2007-07-15 14:02:52 +00:00
Guido van Rossum 827bfd0742 Don't stop installing if compileall fails -- ever. 2007-07-15 13:12:42 +00:00
Guido van Rossum b7d3e65b3b Improve error handling; don't die from unicode errors or syntax errors. 2007-07-15 13:01:48 +00:00
Guido van Rossum 8ac004e698 Make chr() and ord() return/accept surrogate pairs in narrow builds.
The domain of chr() and the range of ord() are now always [0 ... 0x10FFFF].
2007-07-15 13:00:05 +00:00
Thomas Heller 49c12ac04e Fix ctypes tests on OS X. 2007-07-14 18:51:36 +00:00
Thomas Heller 3e6cbf178b For easier merging, revert ths change; it will be brought back in when
the trunk is merged.
2007-07-13 19:48:40 +00:00
Thomas Heller 7f16288134 atexit is a builtin module now, provide that on Windows. 2007-07-13 13:13:40 +00:00
Thomas Heller 19b52545df c_char, c_char_p objects and c_char array structure fields return
their value now as str, no longer str8.
2007-07-13 12:52:51 +00:00
Thomas Heller 27384da6e8 Do not accept str8 type in function calls any longer.
Accept bytes instead of str8 in the (unexposed in ctypes) BSTR type.
2007-07-13 12:07:59 +00:00
Thomas Heller ace05054d3 Remove all the Python 2.3 compatibility markers (the Python 3 ctypes
version is not compatible with Python 2.x anymore).
Remove backwards compatibility code.
2007-07-13 11:53:39 +00:00
Thomas Heller 84d66a0843 Remove all the Python 2.3 compatibility markers (the Python 3 ctypes
version is not compatible with Python 2.x anymore).
Remove backwards compatibility code.
2007-07-13 11:49:15 +00:00
Thomas Heller e5095e187b Structure fields of type c_char array or c_wchar array accept bytes or
(unicode) string.
2007-07-13 11:19:35 +00:00
Thomas Heller 745f5e2de7 No crashes on Linux in the ctypes test suite any longer, so we can
remove the 'crash-protection'.
2007-07-12 20:10:18 +00:00
Thomas Heller f4f771fe0f Fix segfault on Linux. 2007-07-12 20:06:41 +00:00
Thomas Heller 8750384dbc More easy fixes. The ctypes unittests pass now (on Windows). 2007-07-12 19:58:41 +00:00
Thomas Heller d660fabd24 binascii.hexlify returns a bytes object; we must convert it to str
before we can pass it to re.sub.
2007-07-12 19:56:28 +00:00
Thomas Heller 0d8a1fd78d Simple fixes. 2007-07-12 19:54:27 +00:00
Thomas Heller d68d131d29 Simple fixes. 2007-07-12 19:45:20 +00:00
Thomas Heller f0d8b6eee9 Simple fixes. 2007-07-12 19:42:59 +00:00
Thomas Heller 3821e31d19 c_void_p.from_param accepts bytes. Fix test_prototypes. 2007-07-12 19:38:33 +00:00
Thomas Heller 3d79dd9edf c_char_p.from_param accepts bytes. Fix test_parameters. 2007-07-12 19:33:24 +00:00
Thomas Heller 7a76e8f67c Fix another test. 2007-07-12 19:24:59 +00:00
Thomas Heller 9ccf468323 test_slicing does not segfault under linux anymore, so we can run this
test by default.
2007-07-12 19:22:10 +00:00
Thomas Heller 7775c716fc Accept bytes as parameter to foreign functions without prototype.
These are passed as byte strings (unicode strings are passed as wide
character strings).
2007-07-12 19:19:43 +00:00
Thomas Heller 60831316df Accept bytes for c_wchar_p instances and c_wchar array instances.
ctypes.create_unicode_buffer also accepts bytes now.

Revert some tests in test_unicode: Since string literals are unicode
now, conversion takes place when byte literals are passed as unicode
parameters.
2007-07-12 19:06:25 +00:00
Thomas Heller d076228202 Change the StgDictObject's proto member to a PyUnicode_Object (was a
PyStringObject before).
2007-07-12 18:53:22 +00:00
Thomas Heller 2c5e96465f Accept bytes in c_char_p and c_wchar_p types. 2007-07-12 15:41:51 +00:00
Thomas Heller 3af4266d07 ctypes.c_char and ctypes.c_wchar now accept initialization from byte objects. 2007-07-12 14:58:32 +00:00
Thomas Heller f7c6d86832 Use a unicode string as unique_key instead of 8-bit string. 2007-07-12 13:55:37 +00:00
Walter Dörwald a1884664eb Fix typo in docstring. 2007-07-12 12:16:02 +00:00
Walter Dörwald 6720d91ee7 Rename PyTclObject_unicode to PyTclObject_str and use this
for the tp_str slot. Drop __unicode__ method.
2007-07-12 12:12:25 +00:00
Thomas Heller 7c1ebe33b8 Fix a ctypes test. 2007-07-12 12:05:40 +00:00