Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`python`.`win32`.`_ErrorFormatter``

class documentation

`class _ErrorFormatter: (source)`

Constructor: `_ErrorFormatter(WinError, FormatMessage, errorTab)`

View In Hierarchy

Formatter for Windows error messages.

Class Method | `fromEnvironment` | Get as many of the platform-specific error translation objects as possible and return an instance of `cls` created with them.
Method | `__init__` | Undocumented
Method | `formatError` | Returns the string associated with a Windows error message, such as the ones found in socket.error.
Instance Variable | `errorTab` | A mapping from integer error numbers to `str` messages which correspond to those erorrs (like socket.errorTab).
Instance Variable | `formatMessage` | A callable which takes one integer error number argument and returns a `str` giving the message for that error (like win32api.FormatMessage).
Instance Variable | `winError` | A callable which takes one integer error number argument and returns a `WindowsError` instance for that error (like `ctypes.WinError`).

@classmethod
def fromEnvironment(cls): (source)

Get as many of the platform-specific error translation objects as possible and return an instance of `cls` created with them.

def __init__(self, WinError, FormatMessage, errorTab): (source)

Undocumented

def formatError(self, errorcode): (source)

Returns the string associated with a Windows error message, such as the ones found in socket.error.

Attempts direct lookup against the win32 API via ctypes and then pywin32 if available), then in the error table in the socket module, then finally defaulting to `os.strerror`.

Parameters
errorcode:`int` | the Windows error code
Returns
`str` | The error message string

errorTab = (source)

A mapping from integer error numbers to `str` messages which correspond to those erorrs (like socket.errorTab).

formatMessage = (source)

A callable which takes one integer error number argument and returns a `str` giving the message for that error (like win32api.FormatMessage).

winError = (source)

A callable which takes one integer error number argument and returns a `WindowsError` instance for that error (like `ctypes.WinError`).