Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
ecac244d
Commit
ecac244d
authored
Jul 08, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.29.x'
parents
2e21c694
976f5483
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
11 deletions
+31
-11
CHANGES.rst
CHANGES.rst
+23
-4
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-2
tests/run/unicodeliterals.pyx
tests/run/unicodeliterals.pyx
+5
-5
No files found.
CHANGES.rst
View file @
ecac244d
...
...
@@ -456,7 +456,7 @@ Other changes
*
Support
for
Python
2.6
was
removed
.
0.29.21
(
2020
-
0
?-??
)
0.29.21
(
2020
-
0
7
-
09
)
====================
Bugs
fixed
...
...
@@ -465,6 +465,12 @@ Bugs fixed
*
Fix
a
regression
in
0.29.20
where
``
__div__
``
failed
to
be
found
in
extension
types
.
(
Github
issue
#
3688
)
*
Fix
a
regression
in
0.29.20
where
a
call
inside
of
a
finally
clause
could
fail
to
compile
.
Patch
by
David
Woods
.
(
Github
issue
#
3712
)
*
Zero
-
sized
buffers
could
fail
to
validate
as
C
/
Fortran
-
contiguous
.
Patch
by
Clemens
Hofreither
.
(
Github
issue
#
2093
)
*
``
exec
()``
did
not
allow
recent
Python
syntax
features
in
Py3
.8
+
due
to
https
://
bugs
.
python
.
org
/
issue35975
.
(
Github
issue
#
3695
)
...
...
@@ -472,9 +478,22 @@ Bugs fixed
*
Binding
staticmethods
of
Cython
functions
were
not
behaving
like
Python
methods
in
Py3
.
Patch
by
Jeroen
Demeyer
and
Micha
ł
G
ó
rny
.
(
Github
issue
#
3106
)
*
The
deprecated
C
-
API
functions
``
PyUnicode_FromUnicode
()``
and
``
PyUnicode_AS_UNICODE
()``
are
no
longer
used
.
Original
patch
by
Inada
Naoki
.
(
Github
issue
#
3677
)
*
Pythran
calls
to
NumPy
methods
no
longer
generate
useless
method
lookup
code
.
*
The
``
PyUnicode_GET_LENGTH
()``
macro
was
missing
from
the
``
cpython
.*``
declarations
.
Patch
by
Thomas
Caswell
.
(
Github
issue
#
3692
)
*
The
deprecated
``
PyUnicode_
*()``
C
-
API
functions
are
no
longer
used
,
except
for
Unicode
strings
that
contain
lone
surrogates
.
Unicode
strings
that
contain
non
-
BMP
characters
or
surrogate
pairs
now
generate
different
C
code
on
16
-
bit
Python
2.
x
Unicode
deployments
(
such
as
MS
-
Windows
).
Generating
the
C
code
on
Python
3.
x
is
recommended
in
this
case
.
Original
patches
by
Inada
Naoki
and
Victor
Stinner
.
(
Github
issues
#
3677
,
#
3721
,
#
3697
)
*
Some
template
parameters
were
missing
from
the
C
++
``
std
::
unordered_map
``
declaration
.
Patch
by
will
.
(
Github
issue
#
3685
)
*
Several
internal
code
generation
issues
regarding
temporary
variables
were
resolved
.
(
Github
issue
#
3708
)
0.29.20
(
2020
-
06
-
10
)
...
...
Cython/Compiler/ExprNodes.py
View file @
ecac244d
...
...
@@ -1686,13 +1686,14 @@ class UnicodeNode(ConstNode):
# lone (unpaired) surrogates are not really portable and cannot be
# decoded by the UTF-8 codec in Py3.3
self
.
result_code
=
code
.
get_py_const
(
py_object_type
,
'ustring'
)
data_cname
=
code
.
get_pyunicode_ptr_const
(
self
.
value
)
data_cname
=
code
.
get_string_const
(
StringEncoding
.
BytesLiteral
(
self
.
value
.
encode
(
'unicode_escape'
)))
const_code
=
code
.
get_cached_constants_writer
(
self
.
result_code
)
if
const_code
is
None
:
return
# already initialised
const_code
.
mark_pos
(
self
.
pos
)
const_code
.
putln
(
"%s = PyUnicode_
FromUnicode(%s, (sizeof(%s) / sizeof(Py_UNICODE))-1
); %s"
%
(
"%s = PyUnicode_
DecodeUnicodeEscape(%s, sizeof(%s) - 1, NULL
); %s"
%
(
self
.
result_code
,
data_cname
,
data_cname
,
...
...
tests/run/unicodeliterals.pyx
View file @
ecac244d
...
...
@@ -86,15 +86,15 @@ __doc__ = br"""
True
>>> h == u'
\
\
ud800' # unescaped by Python (required by doctest)
True
>>> p ==
u'
\
\
ud800
\
\
udc00'
# unescaped by Python (required by doctest)
>>> p ==
(u'
\
\
ud800
\
\
udc00' if sys.maxunicode == 1114111 else u'
\
\
U00010000') or p
# unescaped by Python (required by doctest)
True
>>> q == u'
\
\
udc00
\
\
ud800' # unescaped by Python (required by doctest)
>>> q == u'
\
\
udc00
\
\
ud800'
or q
# unescaped by Python (required by doctest)
True
>>> k == u'
\
\
N{SNOWMAN}' == u'
\
\
u2603'
>>> k == u'
\
\
N{SNOWMAN}' == u'
\
\
u2603'
or k
True
>>> m == u'abc
\
\
\
\
xf8
\
\
\
\
t
\
\
u00f8
\
\
U000000f8' # unescaped by Python (required by doctest)
>>> m == u'abc
\
\
\
\
xf8
\
\
\
\
t
\
\
u00f8
\
\
U000000f8'
or m
# unescaped by Python (required by doctest)
True
>>> add == u'Søk ik' + u'üÖä' + 'abc'
>>> add == u'Søk ik' + u'üÖä' + 'abc'
or add
True
>>> null == u'
\
\
x00' # unescaped by Python (required by doctest)
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment