Commit Graph

84 Commits

Author SHA1 Message Date
Brett Cannon 41a08bcb83 Clean up warnings filter use in test_bytes. 2010-03-20 21:45:01 +00:00
Florent Xicluna 9b86b9a086 Merged revisions 79100 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79100 | florent.xicluna | 2010-03-19 19:34:55 +0100 (ven, 19 mar 2010) | 2 lines

  Various tests cleanup: check_warnings/check_py3k_warnings, unittest.assert* and setUp/tearDown.
........
2010-03-19 19:00:44 +00:00
Mark Dickinson bc09964be1 Merged revisions 77821 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77821 | mark.dickinson | 2010-01-29 17:11:39 +0000 (Fri, 29 Jan 2010) | 3 lines

  Issue #7788: Fix a crash produced by deleting a list slice with huge
  step value.  Patch by Marcin Bachry.
........
2010-01-29 17:27:24 +00:00
Ezio Melotti e96159335f Merged revisions 77727 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line

  use assert[Not]IsInstance where appropriate
........
2010-01-24 19:26:24 +00:00
Ezio Melotti b58e0bd8bb use assert[Not]In where appropriate 2010-01-23 15:40:09 +00:00
Benjamin Peterson 577473fe68 use assert[Not]In where appropriate
A patch from Dave Malcolm.
2010-01-19 00:09:57 +00:00
Antoine Pitrou fc8d6f4b73 Merged revisions 77573 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77573 | antoine.pitrou | 2010-01-17 13:26:20 +0100 (dim., 17 janv. 2010) | 6 lines

  Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`)
  could crash in many places because of the PyByteArray_AS_STRING() macro
  returning NULL.  The macro now returns a statically allocated empty
  string instead.
........
2010-01-17 12:38:54 +00:00
Antoine Pitrou cbaa6250b9 Merged revisions 77475 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77475 | antoine.pitrou | 2010-01-13 16:02:13 +0100 (mer., 13 janv. 2010) | 4 lines

  Issue #7625: Add more tests that bytearray methods return new objects,
  even if identical.  Patch by Florent Xicluna (again).
........
2010-01-13 15:03:39 +00:00
Antoine Pitrou f845302d06 Merged revisions 77448 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77448 | antoine.pitrou | 2010-01-12 23:02:10 +0100 (mar., 12 janv. 2010) | 3 lines

  Issue #7654: enable additional bytes/bytearray tests.  Patch by Florent Xicluna.
........
2010-01-12 22:05:42 +00:00
Alexandre Vassalotti 41f58a70ac Issue #7382: Fix bytes.__getnewargs__. 2010-01-12 01:23:09 +00:00
Antoine Pitrou c9e92167ac Fix test skipping in multibyte codec tests 2009-11-01 15:59:11 +00:00
Antoine Pitrou 403ce78872 Issue #7065: Fix a crash in bytes.maketrans and bytearray.maketrans when
using byte values greater than 127.  Patch by egreen.
2009-10-14 17:14:16 +00:00
Benjamin Peterson 308d637c94 Merged revisions 74929 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r74929 | benjamin.peterson | 2009-09-18 16:14:55 -0500 (Fri, 18 Sep 2009) | 1 line

  add keyword arguments support to str/unicode encode and decode #6300
........
2009-09-18 21:42:35 +00:00
Mark Dickinson 54a3db9f41 Merged revisions 74673 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r74673 | mark.dickinson | 2009-09-06 11:03:31 +0100 (Sun, 06 Sep 2009) | 3 lines

  Issue #6846: bytearray.pop was returning ints in the range [-128, 128)
  instead of [0, 256).  Thanks Hagen Fürstenau for the report and fix.
........
2009-09-06 10:19:23 +00:00
Benjamin Peterson c9c0f201fe convert old fail* assertions to assert* 2009-06-30 23:06:06 +00:00
Martin v. Löwis db12d454e6 Issue #3672: Reject surrogates in utf-8 codec; add surrogates error
handler.
2009-05-02 18:52:14 +00:00
Georg Brandl abc387747d Add bytes/bytearray.maketrans() to mirror str.maketrans(), and deprecate
string.maketrans() which actually works on bytes.  (Also closes #5675.)
2009-04-12 15:51:51 +00:00
Georg Brandl ccc47b6eee #4759: allow None as first argument of bytearray.translate(), for consistency with bytes.translate().
Also fix segfault for bytearray.translate(x, None) -- will backport this part to 3.0 and 2.6.
2008-12-28 11:44:14 +00:00
Antoine Pitrou 5504e893f8 Issue #4509: bugs in bytearray with exports (buffer protocol) 2008-12-06 21:27:53 +00:00
Amaury Forgeot d'Arc b0c29161a2 Merged revisions 67295,67301-67302,67318,67330,67342-67343 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r67295 | benjamin.peterson | 2008-11-20 05:05:12 +0100 (jeu., 20 nov. 2008) | 1 line

  move useful sys.settrace information to the function's documentation from the debugger
........
  r67301 | benjamin.peterson | 2008-11-20 22:25:31 +0100 (jeu., 20 nov. 2008) | 1 line

  fix indentation and a sphinx warning
........
  r67302 | benjamin.peterson | 2008-11-20 22:44:23 +0100 (jeu., 20 nov. 2008) | 1 line

  oops! didn't mean to disable that test
........
  r67318 | amaury.forgeotdarc | 2008-11-21 23:05:48 +0100 (ven., 21 nov. 2008) | 4 lines

  #4363: Let uuid.uuid1() and uuid.uuid4() run even if the ctypes module is not present.

  Will backport to 2.6
........
  r67330 | georg.brandl | 2008-11-22 09:34:14 +0100 (sam., 22 nov. 2008) | 2 lines

  #4364: fix attribute name on ctypes object.
........
  r67342 | amaury.forgeotdarc | 2008-11-22 20:39:38 +0100 (sam., 22 nov. 2008) | 3 lines

  yuvconvert.c is a part of the "sv" module, an old IRIX thing
  and certainly not useful for any Windows build.
........
  r67343 | amaury.forgeotdarc | 2008-11-22 21:01:18 +0100 (sam., 22 nov. 2008) | 5 lines

  #3996: On Windows, PyOS_CheckStack is supposed to protect the interpreter from
  stack overflow. But doing this, it always crashes when the stack is nearly full.

  Reviewed by Martin von Loewis. Will backport to 2.6.
........
2008-11-22 22:18:04 +00:00
Benjamin Peterson 0f3641ce88 Merged revisions 67291 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r67291 | benjamin.peterson | 2008-11-19 15:49:09 -0600 (Wed, 19 Nov 2008) | 5 lines

  make sure that bytearray methods return a new bytearray even if there is no change

  Fixes #4348
  Reviewed by Brett
........
2008-11-19 22:05:52 +00:00
Hirokazu Yamamoto d0d0b65885 Issue #4183: Some tests didn't run with pickle.HIGHEST_PROTOCOL.
Reviewed by Benjamin Peterson.
2008-10-23 00:38:15 +00:00
Barry Warsaw 9e9dcd6d42 STINNER Victor (haypo)'s patch for bug 3988, Byte warning mode and b'' != ''
Also, his patch to runtests.sh to pass the -bb option (issue 4125).
2008-10-17 01:50:37 +00:00
Benjamin Peterson c15a07333e make bytes(o) respect __bytes__ #2415
This adds two new C-API functions: PyObject_Bytes and PyBytes_FromObject.

Reviewer: Barry
2008-08-26 16:46:47 +00:00
Antoine Pitrou fd036451bf #2834: Change re module semantics, so that str and bytes mixing is forbidden,
and str (unicode) patterns get full unicode matching by default. The re.ASCII
flag is also introduced to ask for ASCII matching instead.
2008-08-19 17:56:33 +00:00
Antoine Pitrou 47d305d689 Issue #3571: test_bytes mistakingly closed stdin 2008-08-16 23:28:44 +00:00
Antoine Pitrou 2f89aa6785 #2538: bytes objects can only provide read-only buffers 2008-08-02 21:02:48 +00:00
Georg Brandl 9a54d7c350 Merged revisions 65041 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r65041 | georg.brandl | 2008-07-17 00:57:41 +0200 (Thu, 17 Jul 2008) | 3 lines

  #3156: fix consistency in what type bytearray methods accept as items.
  Also rename confusing "item" parameters to "index".
........
2008-07-16 23:15:30 +00:00
Georg Brandl eb2c964aeb Add test case for r63810. 2008-05-30 12:05:02 +00:00
Benjamin Peterson ee8712cda4 #2621 rename test.test_support to test.support 2008-05-20 21:35:26 +00:00
Christian Heimes 4f066126d6 Enabled fromhex('') test for bytes 2008-01-30 15:02:52 +00:00
Christian Heimes 5f63d18657 Removed unused import 2008-01-30 12:01:19 +00:00
Christian Heimes 510711d598 Patch #1972 by Antoine Pitrou: improve bytes and bytearray tests 2008-01-30 11:57:58 +00:00
Christian Heimes 7b876158dc Fixed #1969: split and rsplit in bytearray are inconsistent 2008-01-30 09:51:48 +00:00
Christian Heimes a37d4c693a Removed PyInt_GetMax and sys.maxint
I replaced sys.maxint with sys.maxsize in Lib/*.py. Does anybody see a problem with the change on Win 64bit platforms? Win 64's long is just 32bit but the sys.maxsize is now 2**63-1 on every 64bit platform.
Also added docs for sys.maxsize.
2007-12-04 23:02:19 +00:00
Alexandre Vassalotti 09121e8eb2 Issue #1283: Allow any iterable of integers to be passed to
bytearray.extend().
2007-12-04 05:51:13 +00:00
Christian Heimes b2b6262831 Removed some leftovers from the str8 days 2007-11-22 05:56:35 +00:00
Guido van Rossum 254348e201 Rename buffer -> bytearray. 2007-11-21 19:29:53 +00:00
Guido van Rossum 98297ee781 Merging the py3k-pep3137 branch back into the py3k branch.
No detailed change log; just check out the change log for the py3k-pep3137
branch.  The most obvious changes:

  - str8 renamed to bytes (PyString at the C level);
  - bytes renamed to buffer (PyBytes at the C level);
  - PyString and PyUnicode are no longer compatible.

I.e. we now have an immutable bytes type and a mutable bytes type.

The behavior of PyString was modified quite a bit, to make it more
bytes-like.  Some changes are still on the to-do list.
2007-11-06 21:34:58 +00:00
Guido van Rossum a6c04bed1e Patch 1171 by mfenniak -- allow subclassing of bytes.
I suspect this has some problems when the subclass is evil,
but that's for later.
2007-11-03 00:24:24 +00:00
Guido van Rossum ae404e2e0a Sort the method lists for str8 and bytes so differences are more apparent.
Changed bytes.fromhex to take a str argument, as the docstring promises.
Added str8.fromhex (untested so far).
2007-10-26 21:46:44 +00:00
Georg Brandl bd1c68c94f Patch #1303: Adapt str8 constructor to bytes (now buffer) one. 2007-10-24 18:55:37 +00:00
Guido van Rossum 75a902db78 Patch 1280, by Alexandre Vassalotti.
Make PyString's indexing and iteration return integers.
(I changed a few of Alexandre's decisions -- GvR.)
2007-10-19 22:06:24 +00:00
Gregory P. Smith 60d241f135 For PEP3137: Adds missing methods to the mutable PyBytes object (soon
to be called a buffer).  Shares code with stringobject when possible.
Adds unit tests with common code that should be usable to test the PEPs
mutable buffer() and immutable bytes() types.

 http://bugs.python.org/issue1261
2007-10-16 06:31:30 +00:00
Guido van Rossum 1e35e76532 Patch #1049 by Thomas Lee.
Changes comparisons between PyBytes and PyUnicode to return unequal
instead of raising TypeError.
2007-10-09 17:21:10 +00:00
Guido van Rossum bae07c9baf Breaking ground for PEP 3137 implementation:
Get rid of buffer().  Use memoryview() in its place where possible.
In a few places, do things a bit different, because memoryview()
can't slice (yet).
2007-10-08 02:46:15 +00:00
Guido van Rossum 8f95067915 Bug # 1125 (my code).
Support bytes.split() and bytes.strip() -- these split/strip using ASCII
whitespace (tab, space, CR, LF, FF, VT) like their str counterparts.
Also for rsplit(), lstrip() and rstrip().
And change all these functions to accept arbitrary buffer-API-supporting
arguments.
With unit tests.
2007-09-10 16:53:45 +00:00
Jeremy Hylton 18c3ff887f Make it an error to compare a bytes object and a Unicode object. 2007-08-29 18:47:16 +00:00
Guido van Rossum 09549f4407 Changes in anticipation of stricter str vs. bytes enforcement. 2007-08-27 20:40:10 +00:00
Guido van Rossum 9c62772d5e Changes in anticipation of stricter str vs. bytes enforcement. 2007-08-27 18:31:48 +00:00