MCPcopy Create free account
hub / github.com/twisted/twisted / asTextMode

Method asTextMode

src/twisted/python/filepath.py:891–902  ·  view source on GitHub ↗

Return this L{FilePath} in L{unicode}-mode. @param encoding: The encoding to use if coercing to L{unicode}. If none is given, L{sys.getfilesystemencoding} is used. @return: L{unicode} mode L{FilePath}

(self, encoding: str | None = None)

Source from the content-addressed store, hash-verified

889 return self
890
891 def asTextMode(self, encoding: str | None = None) -> FilePath[str]:
892 """
893 Return this L{FilePath} in L{unicode}-mode.
894
895 @param encoding: The encoding to use if coercing to L{unicode}. If none
896 is given, L{sys.getfilesystemencoding} is used.
897
898 @return: L{unicode} mode L{FilePath}
899 """
900 if isinstance(self.path, bytes):
901 return self.clonePath(self._asTextPath(encoding=encoding))
902 return self
903
904 def _getPathAsSameTypeAs(self, pattern: OtherAnyStr) -> OtherAnyStr:
905 """

Callers 12

loadFileMethod · 0.95
_spawnFunction · 0.80
test_mainMethod · 0.80
_assertOneOpenedMethod · 0.80
toStringMethod · 0.80
_loadCAsFromDirFunction · 0.80

Calls 2

clonePathMethod · 0.95
_asTextPathMethod · 0.95