Staging
v0.5.1
https://github.com/python/cpython
Revision 46b3a79459934a09eaf00caf7e36b20717afc09f authored by Neal Norwitz on 28 July 2008, 05:22:45 UTC, committed by Neal Norwitz on 28 July 2008, 05:22:45 UTC
to the signed max value similar to 2.5 and trunk.

Issue #2620: Overflow checking when allocating or reallocating memory
was not always being done properly in some python types and extension
modules.  PyMem_MALLOC, PyMem_REALLOC, PyMem_NEW and PyMem_RESIZE have
all been updated to perform better checks and places in the code that
would previously leak memory on the error path when such an allocation
failed have been fixed.
1 parent 5cdbf77
Raw File
Tip revision: 46b3a79459934a09eaf00caf7e36b20717afc09f authored by Neal Norwitz on 28 July 2008, 05:22:45 UTC
Backport r65182. This change modified from using the unsigned max value
Tip revision: 46b3a79
utf_16_be.py
""" Python 'utf-16-be' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""
import codecs

### Codec APIs

encode = codecs.utf_16_be_encode

def decode(input, errors='strict'):
    return codecs.utf_16_be_decode(input, errors, True)

class StreamWriter(codecs.StreamWriter):
    encode = codecs.utf_16_be_encode

class StreamReader(codecs.StreamReader):
    decode = codecs.utf_16_be_decode

### encodings module API

def getregentry():

    return (encode,decode,StreamReader,StreamWriter)
back to top