pygame / docs / reST / filepaths.rst

File Path Function Arguments

A Pygame function or method which takes a file path argument will accept either an Unicode or a byte — 8-bit or ASCII character — string. Unicode strings are translated to Python's default file system encoding, as returned by sys.getfilesystemencoding(). An Unicode code point above U+FFFF — 'uFFFF' — can be coded directly with a 32-bit escape sequences — 'Uxxxxxxxx' — , even for Python interpreters built with an UCS-2 (16-bit character) unicode type. Byte strings are passed to the operating system unchanged.

Null characters — 'x00' — are not permitted in the path, raising an exception. An exception is also raised if an Unicode file path cannot be encoded. How UTF-16 surrogate codes are handled is Python interpreter dependent. Use UTF-32 code points and 32-bit escape sequences instead. The exception types are function dependent.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.