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
257d38ff
Commit
257d38ff
authored
Oct 09, 2010
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #9738: Document PyErr_SetString() and PyErr_SetFromErrnoWithFilename()
encodings
parent
fc8408cb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
Doc/c-api/exceptions.rst
Doc/c-api/exceptions.rst
+3
-1
Include/pyerrors.h
Include/pyerrors.h
+7
-2
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Doc/c-api/exceptions.rst
View file @
257d38ff
...
...
@@ -134,7 +134,7 @@ in various ways. There is a separate error indicator for each thread.
This is the most common way to set the error indicator. The first argument
specifies the exception type; it is normally one of the standard exceptions,
e.g. :c:data:`PyExc_RuntimeError`. You need not increment its reference count.
The second argument is an error message; it is
converted to a string object
.
The second argument is an error message; it is
decoded from ``'utf-8``'
.
.. c:function:: void PyErr_SetObject(PyObject *type, PyObject *value)
...
...
@@ -261,6 +261,8 @@ in various ways. There is a separate error indicator for each thread.
*filename* is not *NULL*, it is passed to the constructor of *type* as a third
parameter. In the case of exceptions such as :exc:`IOError` and :exc:`OSError`,
this is used to define the :attr:`filename` attribute of the exception instance.
*filename* is decoded from the filesystem encoding
(:func:`sys.getfilesystemencoding`).
.. c:function:: PyObject* PyErr_SetFromWindowsErr(int ierr)
...
...
Include/pyerrors.h
View file @
257d38ff
...
...
@@ -60,7 +60,10 @@ typedef struct {
PyAPI_FUNC
(
void
)
PyErr_SetNone
(
PyObject
*
);
PyAPI_FUNC
(
void
)
PyErr_SetObject
(
PyObject
*
,
PyObject
*
);
PyAPI_FUNC
(
void
)
PyErr_SetString
(
PyObject
*
,
const
char
*
);
PyAPI_FUNC
(
void
)
PyErr_SetString
(
PyObject
*
exception
,
const
char
*
string
/* decoded from utf-8 */
);
PyAPI_FUNC
(
PyObject
*
)
PyErr_Occurred
(
void
);
PyAPI_FUNC
(
void
)
PyErr_Clear
(
void
);
PyAPI_FUNC
(
void
)
PyErr_Fetch
(
PyObject
**
,
PyObject
**
,
PyObject
**
);
...
...
@@ -177,7 +180,9 @@ PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
PyAPI_FUNC
(
PyObject
*
)
PyErr_SetFromErrnoWithFilenameObject
(
PyObject
*
,
PyObject
*
);
PyAPI_FUNC
(
PyObject
*
)
PyErr_SetFromErrnoWithFilename
(
PyObject
*
,
const
char
*
);
PyObject
*
exc
,
const
char
*
filename
/* decoded from the filesystem encoding */
);
#ifdef MS_WINDOWS
PyAPI_FUNC
(
PyObject
*
)
PyErr_SetFromErrnoWithUnicodeFilename
(
PyObject
*
,
const
Py_UNICODE
*
);
...
...
Misc/NEWS
View file @
257d38ff
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.2 Alpha 3?
Core and Builtins
-----------------
- Issue #9738: Document PyErr_SetString() and PyErr_SetFromErrnoWithFilename()
encodings
- ast.literal_eval() can now handle negative numbers. It is also a little
more liberal in what it accepts without compromising the safety of the
evaluation. For example, 3j+4 and 3+4+5 are both accepted.
...
...
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