Update scrapy/utils/curl.py

Co-authored-by: Adrián Chaves <adrian@chaves.io>
This commit is contained in:
Jalil SA 2023-04-19 01:04:03 -06:00 committed by GitHub
parent 7e1814faf8
commit b7ecec1809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -10,8 +10,9 @@ from w3lib.http import basic_auth_header
class DataAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
value = str(values).encode("utf-8").decode("utf-8")
value = value[1::] if re.match(r"^\$(.+)", value) else value
value = str(values)
if value.startswith("$"):
value = value[1:]
setattr(namespace, self.dest, value)