This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cool-RR
Recipients cool-RR, pitrou
Date 2016-11-27.09:33:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1480239193.34.0.752695388399.issue28811@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2016-11-27 09:33:13cool-RRsetrecipients: + cool-RR, pitrou
2016-11-27 09:33:13cool-RRsetmessageid: <1480239193.34.0.752695388399.issue28811@psf.upfronthosting.co.za>
2016-11-27 09:33:13cool-RRlinkissue28811 messages
2016-11-27 09:33:12cool-RRcreate