/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/_rio_pyx.pyx

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 21:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6859.
  • Revision ID: jelmer@jelmer.uk-20180218214257-jpevutp1wa30tz3v
Update TODO to reference Breezy, not Bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
 
#
17
 
# cython: language_level=3
18
16
 
19
17
"""Pyrex implementation of _read_stanza_*."""
20
18
 
 
19
from __future__ import absolute_import
 
20
 
21
21
 
22
22
cdef extern from "python-compat.h":
23
23
    pass
130
130
def _read_stanza_utf8(line_iter):
131
131
    cdef char *c_line
132
132
    cdef Py_ssize_t c_len
133
 
    cdef char *accum_value
134
 
    cdef char *new_accum_value
 
133
    cdef char *accum_value, *new_accum_value
135
134
    cdef Py_ssize_t accum_len, accum_size
136
135
    pairs = []
137
136
    tag = None
175
174
                    raise ValueError("invalid rio tag %r" % (tag,))
176
175
        if tag is not None: # add last tag-value
177
176
            PyList_Append(pairs,
178
 
                (tag, PyUnicode_DecodeUTF8(accum_value, accum_len-1, "surrogateescape")))
 
177
                (tag, PyUnicode_DecodeUTF8(accum_value, accum_len-1, "strict")))
179
178
            return Stanza.from_pairs(pairs)
180
179
        else:     # didn't see any content
181
180
            return None
186
185
def _read_stanza_unicode(unicode_iter):
187
186
    cdef Py_UNICODE *c_line
188
187
    cdef int c_len
189
 
    cdef Py_UNICODE *accum_value
190
 
    cdef Py_UNICODE *new_accum_value
 
188
    cdef Py_UNICODE *accum_value, *new_accum_value
191
189
    cdef Py_ssize_t accum_len, accum_size
192
190
    pairs = []
193
191
    tag = None