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
Thomas Heller
1f498ef63d
Fix a ctypes test.
2007-07-12 11:59:52 +00:00
Thomas Heller
b0f48abd87
Skip testing the special file "/dev/tty" on Windows. This test does
...
weird things if someone has a "\dev" directory on the current drive.
2007-07-12 11:29:02 +00:00
Thomas Heller
fdeee3a6cd
Second part of sf# 1752225: On windows, emulate ftruncate with Win32
...
api functions. Code from fileobject.c, patch by Amaury Forgeot d'Arc.
This patch also changes:
The return value of the native ftruncate function is checked for '!=
0' instead of '< 0' as before.
fileio_seekable returns bool now instead of an int.
2007-07-12 11:21:36 +00:00
Thomas Heller
af2be262af
First part of sf# 1752225: Support for wide filenames on Windows.
...
Patch by Amaury Forgeot d'Arc.
2007-07-12 11:03:13 +00:00
Thomas Heller
5fa3f0517b
Py_USING_UNICODE is no longer defined on Windows (on posix it is still
...
in pyconfig.h). Remove the workaround for the broken (in Python 2.3)
PyUnicode_(From|As)WideChar functions.
2007-07-12 11:00:22 +00:00
Guido van Rossum
e409b97950
Make this a pure-ASCII file. This used to have a Latin-1 coding and
...
contain several string literals using non-ASCII characters. Because
of the pain of displaying those characters, it's better to use \xXX
escapes for these instead of typing the accented characters.
Apologies if I missed something; it didn't look like there was anything
that depended on this file being encoded in Latin-1 or containing non-ASCII
characters.
2007-07-12 09:25:21 +00:00
Guido van Rossum
fc0ffb7243
Merged revisions 56265-56300 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/python/branches/p3yk
........
r56274 | georg.brandl | 2007-07-11 08:10:46 -0700 (Wed, 11 Jul 2007) | 2 lines
Fix #1751965 , typo in isinstance.
........
2007-07-12 08:55:44 +00:00
Guido van Rossum
a5d0c260ac
Fix for tet_bigmem.py (the failure was caused by a spurious reference
...
to 'file', which no longer exists).
Fix inspired by Christian Heimes, SF# 1752195.
2007-07-12 08:11:23 +00:00
Guido van Rossum
652f446d42
Fixes for str/uni/bytes for gettext.py. test_gettext.py passes.
...
Fix by Christian Heimes, SF# 1751958, who writes:
I tested the fixes with the Zope3 zope.app.locales packages.
The mo files are loaded and parsed w/o any problem.
The translation with gettext.gettext is working as expected.
2007-07-12 08:04:06 +00:00
Guido van Rossum
076da0957b
Fix asynchat to use bytes instead of strings.
...
Fix by Alexandre Vassalotti, SF# 1752173.
2007-07-12 07:58:54 +00:00
Guido van Rossum
e7a0d39978
Fixed a refcount leak in _PyUnicode_AsDefaultEncodedString().
...
Found by Amaury Forgeot d'Arc, SF# 1752317.
(Also removed a redundant check for !errors.)
2007-07-12 07:53:00 +00:00
Guido van Rossum
dc09715d0b
Use unicode instead of 8-bit strings.
...
Patch by Alexandre Vassalotti, SF# 1752229.
2007-07-12 07:44:15 +00:00
Guido van Rossum
c3e7ffc670
obcheckin.
2007-07-11 20:56:15 +00:00
Guido van Rossum
bdab7d3cb6
Fix test_poll.py. By Christian Heimes.
2007-07-11 20:43:16 +00:00
Thomas Heller
3ed0acceee
Must create heaptypes with unicode names.
2007-07-11 20:02:35 +00:00
Thomas Heller
ace8ba8d4b
Revert a wrong commit.
2007-07-11 20:01:43 +00:00
Thomas Heller
f630dac178
Must create heaptypes with unicode names.
2007-07-11 19:57:40 +00:00
Thomas Heller
acb470c05f
Fix the test; solution found by Christian Heimes. Thanks!
2007-07-11 19:34:54 +00:00
Thomas Heller
f5af466d3a
Fix one more ctypes test, and disable the tests that were segfaulting.
...
Thanks to Christian Heimes for finding these tests.
2007-07-11 14:51:58 +00:00
Thomas Heller
c92159aaea
dict.keys() returns an iterable, convert it into a list.
2007-07-11 14:49:26 +00:00
Thomas Heller
3b645802f5
Remove unused local variable.
2007-07-11 13:57:16 +00:00