Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
cb428f01
Commit
cb428f01
authored
Dec 27, 2010
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystem
encoding instead of UTF-8.
parent
8e286c47
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
Doc/c-api/exceptions.rst
Doc/c-api/exceptions.rst
+3
-2
Include/warnings.h
Include/warnings.h
+1
-1
Misc/NEWS
Misc/NEWS
+3
-0
Python/_warnings.c
Python/_warnings.c
+1
-1
No files found.
Doc/c-api/exceptions.rst
View file @
cb428f01
...
...
@@ -297,8 +297,9 @@ in various ways. There is a separate error indicator for each thread.
is a straightforward wrapper around the Python function
:func:`warnings.warn_explicit`, see there for more information. The *module*
and *registry* arguments may be set to *NULL* to get the default effect
described there. *message*, *filename* and *module* are UTF-8 encoded
strings.
described there. *message* and *module* are UTF-8 encoded strings,
*filename* is decoded from the filesystem encoding
(:func:`sys.getfilesystemencoding`).
.. c:function:: int PyErr_WarnFormat(PyObject *category, Py_ssize_t stack_level, const char *format, ...)
...
...
Include/warnings.h
View file @
cb428f01
...
...
@@ -20,7 +20,7 @@ PyAPI_FUNC(int) PyErr_WarnFormat(
PyAPI_FUNC
(
int
)
PyErr_WarnExplicit
(
PyObject
*
category
,
const
char
*
message
,
/* UTF-8 encoded string */
const
char
*
filename
,
/*
UTF-8 encoded str
ing */
const
char
*
filename
,
/*
decoded from the filesystem encod
ing */
int
lineno
,
const
char
*
module
,
/* UTF-8 encoded string */
PyObject
*
registry
);
...
...
Misc/NEWS
View file @
cb428f01
...
...
@@ -8,6 +8,9 @@ What's New in Python 3.2 Release Candidate 1
Core and Builtins
-----------------
- Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystem
encoding instead of UTF-8.
Library
-------
...
...
Python/_warnings.c
View file @
cb428f01
...
...
@@ -783,7 +783,7 @@ PyErr_WarnExplicit(PyObject *category, const char *text,
{
PyObject
*
res
;
PyObject
*
message
=
PyUnicode_FromString
(
text
);
PyObject
*
filename
=
PyUnicode_
FromString
(
filename_str
);
PyObject
*
filename
=
PyUnicode_
DecodeFSDefault
(
filename_str
);
PyObject
*
module
=
NULL
;
int
ret
=
-
1
;
...
...
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