[Scons-users] escaping brackets () in file path
Plunket, Tom
tom.plunket at aristocrat-inc.com
Fri Feb 26 19:19:54 EST 2016
It's not a direct answer to your query, but can you just quote your file arguments? I have to do that anyway because my users love to put spaces in their filenames but it also covers other shell characters pretty well. The only character I need to handle manually (presumably because I can't figure out how to get env.Literal to work) is the dollar symbol $ but that's because SCons tries to process it before it gets to the shell.
-----Original Message-----
From: Scons-users [mailto:scons-users-bounces at scons.org] On Behalf Of Carnë Draug
Sent: Wednesday, February 24, 2016 4:56 PM
To: SCons users mailing list <scons-users at scons.org>
Subject: [Scons-users] escaping brackets () in file path
On my project I have paths with brackets. It seems to me that SCons tries to escape them incorrectly. In addition, the command that is displayed is different from what's actually executed.
Please consider:
$ cat SConstruct
#!/usr/bin/env python
# -*- coding: utf-8 -*-
Command(target='foo (bar) qux', source=None, action='touch $TARGET')
$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
touch "foo (bar) qux"
scons: done building targets.
$ ls
foo \(bar\) qux SConstruct
Note how the generated file has backslashes on the name. Doesn't look like it's bash playing up. I have checked the actual argv passed to programs:
$ cat SConstruct
#!/usr/bin/env python
# -*- coding: utf-8 -*-
Command(target='foo (bar) qux', source=None, action='python -c "import sys; print sys.argv" $TARGET')
$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
python -c "import sys; print sys.argv" "foo (bar) qux"
['-c', 'foo \\(bar\\) qux']
scons: done building targets.
So is this a bug in SCons or am I missing a detail about how to curate my own paths? Should I be handling these paths in some different way?
Thank you,
Carnë
_______________________________________________
Scons-users mailing list
Scons-users at scons.org
https://pairlist4.pair.net/mailman/listinfo/scons-users
IMPORTANT CONFIDENTIALITY NOTICE:
This E-mail(including any documents referred to in, or attached, to this E-mail) may contain information that is personal, confidential or the subject of copyright or other proprietary rights in favor of Aristocrat, its affiliates or third parties. This E-mail is intended only for the named addressee. Any privacy, confidence, copyright or other proprietary rights in favor of Aristocrat, its affiliates or third parties, is not lost because this E-mail was sent to you by mistake.
If you received this E-mail by mistake you should: (i) not copy, disclose, distribute or otherwise use it, or its contents, without the consent of Aristocrat or the owner of the relevant rights; (ii) let us know of the mistake by reply E-mail or by telephone (US 1-877-274-9661, or AU +61 2 9013 6000); and (iii) delete it from your system and destroy all copies.
Any personal information contained in this E-mail must be handled in accordance with applicable privacy laws.
Electronic and internet communications can be interfered with or affected by viruses and other defects. As a result, such communications may not be successfully received or, if received, may cause interference with the integrity of receiving, processing or related systems (including hardware, software and data or information on, or using, that hardware or software). Aristocrat gives no assurances in relation to these matters.
If you have any doubts about the veracity or integrity of any electronic communication we appear to have sent you, please call (US 1-877-274-9661, or AU +61 2 9013 6000) for clarification.
More information about the Scons-users
mailing list