Bug 1826600
| Summary: | scl enable rh-python36 -- python in shebang script cut out argument after special chracter like '$' | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Park Inseo <inseo.park> |
| Component: | scl-utils | Assignee: | Packaging Maintenance Team <packaging-team-maint> |
| Status: | CLOSED DUPLICATE | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.4 | CC: | mdomonko |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-05-18 15:31:38 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
This is caused by the fact that scl(8) does not escape the arguments to be passed to the underlying binary with single quotes (so any variables end up being expanded in the environment's context; in this case, $er is interpreted as such a variable). Unfortunately, while fixing this would be quite easy, now that RHEL-7 is in the Maintenance Support 1 Phase, we can't risk breakage of our customers' scripts that rely on the current behavior, therefore I'm closing this one as a duplicate of another BZ that's also closed (please see the other BZ for more details). Thank you for your understanding! *** This bug has been marked as a duplicate of bug 1248418 *** (In reply to Michal Domonkos from comment #2) > This is caused by the fact that scl(8) does not escape the arguments to be s/scl(8)/scl(1)/ |
Description of problem: When python3 script is used with shebang line to rh-python36, argument which includes special chracter $ disappear after '$' Version-Release number of selected component (if applicable): 20130529-19 How reproducible: call below test script like : ./test1.py --restpwd '2020U$ser' test script: test1.py (with chmod +x test1.py) #!/usr/bin/scl enable rh-python36 -- python3 import argparse import sys class MyParser(argparse.ArgumentParser): def error(self, message): sys.stderr.write('error: %s\n' % message) self.print_help() sys.exit(2) def main(): parser = MyParser() parser.add_argument('--restpwd', required=False, default='rest_passwd', help='provide rest api password') print (sys.argv[1:]) args, unknown = parser.parse_known_args() print ("rest pw: " + args.restpwd) if __name__ == '__main__': main() Steps to Reproduce: 1. run test1.py : ./test1.py --restpwd '2020U$er' 2. check result 3. Actual results: ['--restpwd', '2020U'] rest pw: 2020U Expected results: ['--restpwd', '2020U$er'] rest pw: 2020U$er Additional info: All Redhat linux 7.4 ~ 7.7, 7.8 might be affected.