Changeset 381
- Timestamp:
- 05/30/11 00:20:22 (2 years ago)
- Location:
- pyyaml/tags/3.10
- Files:
-
- 6 edited
-
. (modified) (1 prop)
-
CHANGES (modified) (1 diff)
-
announcement.msg (modified) (1 diff)
-
lib/yaml/constructor.py (modified) (2 diffs)
-
lib/yaml/reader.py (modified) (2 diffs)
-
lib/yaml/representer.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pyyaml/tags/3.10
-
Property
svn:mergeinfo
set to
/pyyaml/trunk merged eligible
-
Property
svn:mergeinfo
set to
-
pyyaml/tags/3.10/CHANGES
r379 r381 9 9 * Clear cyclic references in the parser and the emitter 10 10 (Thank to kristjan(at)ccpgames(dot)com). 11 * Dropped support for Python 2.3 and 2.4. 11 12 12 13 3.09 (2009-08-31) -
pyyaml/tags/3.10/announcement.msg
r379 r381 20 20 (Thank to kristjan(at)ccpgames(dot)com). 21 21 * LibYAML bindings are rebuilt with the latest version of Cython. 22 * Dropped support for Python 2.3 and 2.4; currently supported versions 23 are 2.5 to 3.2. 22 24 23 25 -
pyyaml/tags/3.10/lib/yaml/constructor.py
r379 r381 7 7 8 8 import datetime 9 10 try:11 set12 except NameError:13 from sets import Set as set14 9 15 10 import binascii, re, sys, types … … 503 498 "expected non-empty name appended to the tag", mark) 504 499 if u'.' in name: 505 # Python 2.4 only 506 #module_name, object_name = name.rsplit('.', 1) 507 items = name.split('.') 508 object_name = items.pop() 509 module_name = '.'.join(items) 500 module_name, object_name = name.rsplit('.', 1) 510 501 else: 511 502 module_name = '__builtin__' -
pyyaml/tags/3.10/lib/yaml/reader.py
r323 r381 21 21 22 22 import codecs, re 23 24 # Unfortunately, codec functions in Python 2.3 does not support the `finish`25 # arguments, so we have to write our own wrappers.26 27 try:28 codecs.utf_8_decode('', 'strict', False)29 from codecs import utf_8_decode, utf_16_le_decode, utf_16_be_decode30 31 except TypeError:32 33 def utf_16_le_decode(data, errors, finish=False):34 if not finish and len(data) % 2 == 1:35 data = data[:-1]36 return codecs.utf_16_le_decode(data, errors)37 38 def utf_16_be_decode(data, errors, finish=False):39 if not finish and len(data) % 2 == 1:40 data = data[:-1]41 return codecs.utf_16_be_decode(data, errors)42 43 def utf_8_decode(data, errors, finish=False):44 if not finish:45 # We are trying to remove a possible incomplete multibyte character46 # from the suffix of the data.47 # The first byte of a multi-byte sequence is in the range 0xc0 to 0xfd.48 # All further bytes are in the range 0x80 to 0xbf.49 # UTF-8 encoded UCS characters may be up to six bytes long.50 count = 051 while count < 5 and count < len(data) \52 and '\x80' <= data[-count-1] <= '\xBF':53 count -= 154 if count < 5 and count < len(data) \55 and '\xC0' <= data[-count-1] <= '\xFD':56 data = data[:-count-1]57 return codecs.utf_8_decode(data, errors)58 23 59 24 class ReaderError(YAMLError): … … 160 125 if not isinstance(self.raw_buffer, unicode): 161 126 if self.raw_buffer.startswith(codecs.BOM_UTF16_LE): 162 self.raw_decode = utf_16_le_decode127 self.raw_decode = codecs.utf_16_le_decode 163 128 self.encoding = 'utf-16-le' 164 129 elif self.raw_buffer.startswith(codecs.BOM_UTF16_BE): 165 self.raw_decode = utf_16_be_decode130 self.raw_decode = codecs.utf_16_be_decode 166 131 self.encoding = 'utf-16-be' 167 132 else: 168 self.raw_decode = utf_8_decode133 self.raw_decode = codecs.utf_8_decode 169 134 self.encoding = 'utf-8' 170 135 self.update(1) -
pyyaml/tags/3.10/lib/yaml/representer.py
r328 r381 7 7 8 8 import datetime 9 10 try:11 set12 except NameError:13 from sets import Set as set14 9 15 10 import sys, copy_reg, types
Note: See TracChangeset
for help on using the changeset viewer.
