Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(89827)

Delta Between Two Patch Sets: Doc/c-api/exceptions.rst

Issue 11619: On Windows, don't encode filenames in the import machinery
Left Patch Set: Created 8 years, 5 months ago
Right Patch Set: Created 5 years, 12 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | Include/ast.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 .. highlightlang:: c 1 .. highlightlang:: c
2 2
3 3
4 .. _exceptionhandling: 4 .. _exceptionhandling:
5 5
6 ****************** 6 ******************
7 Exception Handling 7 Exception Handling
8 ****************** 8 ******************
9 9
10 The functions described in this chapter will let you handle and raise Python 10 The functions described in this chapter will let you handle and raise Python
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 .. c:function:: PyObject* PyErr_SetImportError(PyObject *msg, PyObject *name, Py Object *path) 286 .. c:function:: PyObject* PyErr_SetImportError(PyObject *msg, PyObject *name, Py Object *path)
287 287
288 This is a convenience function to raise :exc:`ImportError`. *msg* will be 288 This is a convenience function to raise :exc:`ImportError`. *msg* will be
289 set as the exception's message string. *name* and *path*, both of which can 289 set as the exception's message string. *name* and *path*, both of which can
290 be ``NULL``, will be set as the :exc:`ImportError`'s respective ``name`` 290 be ``NULL``, will be set as the :exc:`ImportError`'s respective ``name``
291 and ``path`` attributes. 291 and ``path`` attributes.
292 292
293 .. versionadded:: 3.3 293 .. versionadded:: 3.3
294 294
295 295
296 .. c:function:: void PyErr_SyntaxLocationEx(char *filename, int lineno, int col_ offset) 296 .. c:function:: void PyErr_SyntaxLocationObject(PyObject *filename, int lineno, int col_offset)
297 297
298 Set file, line, and offset information for the current exception. If the 298 Set file, line, and offset information for the current exception. If the
299 current exception is not a :exc:`SyntaxError`, then it sets additional 299 current exception is not a :exc:`SyntaxError`, then it sets additional
300 attributes, which make the exception printing subsystem think the exception 300 attributes, which make the exception printing subsystem think the exception
301 is a :exc:`SyntaxError`. *filename* is decoded from the filesystem encoding 301 is a :exc:`SyntaxError`.
302 (:func:`sys.getfilesystemencoding`). 302
303 303 .. versionadded:: 3.3
304 .. versionadded:: 3.2 304
305
306 .. c:function:: void PyErr_SyntaxLocationEx(char *filename, int lineno, int col_ offset)
307
308 Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string
309 decoded from the filesystem encoding (:func:`sys.getfilesystemencoding`).
310
311 .. versionadded:: 3.2
305 312
306 313
307 .. c:function:: void PyErr_SyntaxLocation(char *filename, int lineno) 314 .. c:function:: void PyErr_SyntaxLocation(char *filename, int lineno)
308 315
309 Like :c:func:`PyErr_SyntaxLocationExc`, but the col_offset parameter is 316 Like :c:func:`PyErr_SyntaxLocationEx`, but the col_offset parameter is
310 omitted. 317 omitted.
311 318
312 319
313 .. c:function:: void PyErr_BadInternalCall() 320 .. c:function:: void PyErr_BadInternalCall()
314 321
315 This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, 322 This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``,
316 where *message* indicates that an internal operation (e.g. a Python/C API 323 where *message* indicates that an internal operation (e.g. a Python/C API
317 function) was invoked with an illegal argument. It is mostly for internal 324 function) was invoked with an illegal argument. It is mostly for internal
318 use. 325 use.
319 326
(...skipping 28 matching lines...) Expand all
348 :c:data:`PyExc_SyntaxWarning`, :c:data:`PyExc_RuntimeWarning`, and 355 :c:data:`PyExc_SyntaxWarning`, :c:data:`PyExc_RuntimeWarning`, and
349 :c:data:`PyExc_FutureWarning`. :c:data:`PyExc_Warning` is a subclass of 356 :c:data:`PyExc_FutureWarning`. :c:data:`PyExc_Warning` is a subclass of
350 :c:data:`PyExc_Exception`; the other warning categories are subclasses of 357 :c:data:`PyExc_Exception`; the other warning categories are subclasses of
351 :c:data:`PyExc_Warning`. 358 :c:data:`PyExc_Warning`.
352 359
353 For information about warning control, see the documentation for the 360 For information about warning control, see the documentation for the
354 :mod:`warnings` module and the :option:`-W` option in the command line 361 :mod:`warnings` module and the :option:`-W` option in the command line
355 documentation. There is no C API for warning control. 362 documentation. There is no C API for warning control.
356 363
357 364
358 .. c:function:: int PyErr_WarnExplicit(PyObject *category, const char *message, const char *filename, int lineno, const char *module, PyObject *registry) 365 .. c:function:: int PyErr_WarnExplicitObject(PyObject *category, PyObject *messa ge, PyObject *filename, int lineno, PyObject *module, PyObject *registry)
359 366
360 Issue a warning message with explicit control over all warning attributes. T his 367 Issue a warning message with explicit control over all warning attributes. T his
361 is a straightforward wrapper around the Python function 368 is a straightforward wrapper around the Python function
362 :func:`warnings.warn_explicit`, see there for more information. The *module* 369 :func:`warnings.warn_explicit`, see there for more information. The *module*
363 and *registry* arguments may be set to *NULL* to get the default effect 370 and *registry* arguments may be set to *NULL* to get the default effect
364 described there. *message* and *module* are UTF-8 encoded strings, 371 described there. *message* and *module* are UTF-8 encoded strings,
365 *filename* is decoded from the filesystem encoding 372 *filename* is decoded from the filesystem encoding
366 (:func:`sys.getfilesystemencoding`). 373 (:func:`sys.getfilesystemencoding`).
374
375 .. versionadded:: 3.3
376
377
378 .. c:function:: int PyErr_WarnExplicit(PyObject *category, const char *message, const char *filename, int lineno, const char *module, PyObject *registry)
379
380 Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and
381 *module* are UTF-8 encoded strings, and *filename* is decoded from the
382 filesystem encoding (:func:`sys.getfilesystemencoding`).
367 383
368 384
369 .. c:function:: int PyErr_WarnFormat(PyObject *category, Py_ssize_t stack_level, const char *format, ...) 385 .. c:function:: int PyErr_WarnFormat(PyObject *category, Py_ssize_t stack_level, const char *format, ...)
370 386
371 Function similar to :c:func:`PyErr_WarnEx`, but use 387 Function similar to :c:func:`PyErr_WarnEx`, but use
372 :c:func:`PyUnicode_FromFormat` to format the warning message. *format* is 388 :c:func:`PyUnicode_FromFormat` to format the warning message. *format* is
373 an ASCII-encoded string. 389 an ASCII-encoded string.
374 390
375 .. versionadded:: 3.2 391 .. versionadded:: 3.2
376 392
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 822
807 (1) 823 (1)
808 This is a base class for other standard exceptions. 824 This is a base class for other standard exceptions.
809 825
810 (2) 826 (2)
811 This is the same as :exc:`weakref.ReferenceError`. 827 This is the same as :exc:`weakref.ReferenceError`.
812 828
813 (3) 829 (3)
814 Only defined on Windows; protect code that uses this by testing that the 830 Only defined on Windows; protect code that uses this by testing that the
815 preprocessor macro ``MS_WINDOWS`` is defined. 831 preprocessor macro ``MS_WINDOWS`` is defined.
LEFTRIGHT
« no previous file | Include/ast.h » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+