pyproject-rpm-macros/pyproject_construct_toxenv.py
Miro Hrončok 996ac31b46 Add a temporary workaround for RPM 4.20 alpha 2 leaking \x1f (unit separators)
Strip them.
This workaround is safe with RPM < 4.20 or when RPM is fixed.
2024-06-04 10:46:50 +02:00

24 lines
555 B
Python

import argparse
import sys
def main(argv):
parser = argparse.ArgumentParser(
description='Parse -e arguments instead of RPM getopt.'
)
parser.add_argument('-e', '--toxenv', action='append')
args, _ = parser.parse_known_args(argv)
return ','.join(args.toxenv)
def strip_x1f(argv):
r"""
Hack workaround for RPM 4.20 alpha 2 leaking \x1f (unit separators).
https://bugzilla.redhat.com/2284187
"""
return [a.strip('\x1f') for a in argv]
if __name__ == '__main__':
print(main(strip_x1f(sys.argv[1:])))