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
5c5d70e7
Commit
5c5d70e7
authored
Apr 06, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use CPython provided Py_DecodeLocale() function for embedded CLI argument decoding in Py3.5+.
parent
23a60938
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
Cython/Utility/Embed.c
Cython/Utility/Embed.c
+12
-1
No files found.
Cython/Utility/Embed.c
View file @
5c5d70e7
...
...
@@ -11,6 +11,8 @@ int %(wmain_method)s(int argc, wchar_t **argv) {
#else
static
int
__Pyx_main
(
int
argc
,
wchar_t
**
argv
)
{
#endif
wchar_t
*
program
=
NULL
;
/* 754 requires that FP exceptions run in "no stop" mode by default,
* and until C vendors implement C99's ways to control FP exceptions,
* Python requires non-stop mode. Alas, some platforms enable FP
...
...
@@ -66,6 +68,8 @@ static int __Pyx_main(int argc, wchar_t **argv) {
#if PY_MAJOR_VERSION >= 3 && !defined(WIN32) && !defined(MS_WINDOWS)
#include <locale.h>
#if PY_VERSION_HEX < 0x03050000
static
wchar_t
*
__Pyx_char2wchar
(
char
*
arg
)
{
...
...
@@ -170,6 +174,8 @@ oom:
return
NULL
;
}
#endif
int
%
(
main_method
)
s
(
int
argc
,
char
**
argv
)
{
...
...
@@ -192,7 +198,12 @@ int
res
=
0
;
setlocale
(
LC_ALL
,
""
);
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
argv_copy2
[
i
]
=
argv_copy
[
i
]
=
__Pyx_char2wchar
(
argv
[
i
]);
argv_copy2
[
i
]
=
argv_copy
[
i
]
=
#if PY_VERSION_HEX < 0x03050000
__Pyx_char2wchar
(
argv
[
i
]);
#else
Py_DecodeLocale
(
argv
[
i
],
NULL
);
#endif
if
(
!
argv_copy
[
i
])
res
=
1
;
/* failure, but continue to simplify cleanup */
}
setlocale
(
LC_ALL
,
oldloc
);
...
...
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