def makeSourceFile(self, sourceLines): """ Write the given list of lines to a text file and return the absolute path to it. """ script = _asFilesystemBytes(self.mktemp()) with open(script, 'wt') as scriptFile: scriptFile.write(os.linesep.join(sourceLines) + os.linesep) return os.path.abspath(script)
def name(self, name): """ On UNIX, paths are always bytes. However, as paths are L{unicode} on Python 3, and L{UNIXAddress} technically takes a file path, we convert it to bytes to maintain compatibility with C{os.path} on Python 3. """ if name is not None: self._name = _asFilesystemBytes(name) else: self._name = None