New submission from Ram Rachum: I have a a PurePath object like so:
path = PurePath('/home/my awesome user/file.txt') I'm SSHing into a server and I want to remove the file. So I have to do this: ssh_client.run(f'/bin/rm {shlex.quote(str(path))}') Which is really long and ugly. (I might have been able to remove the str from there if #28623 wasn't rejected.) I wish I could do this: ssh_client.run(f'/bin/rm {path}') But since my path has a space, that would only be possible if PurePath.__str__ were to use shlex.quote, and put quotes around my path (only if it includes a space). What do you think about that? ---------- components: Library (Lib) messages: 281812 nosy: cool-RR, pitrou priority: normal severity: normal status: open title: Make pathlib.PurePath.__str__ use shlex.quote type: enhancement versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28811> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com