mirror of https://github.com/scrapy/scrapy.git
fix: regex
This commit is contained in:
parent
3209eac14f
commit
7e1814faf8
|
|
@ -11,8 +11,7 @@ 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")
|
||||
items = re.findall(r"\$(.+)", value)
|
||||
value = items[0] if items else value
|
||||
value = value[1::] if re.match(r"^\$(.+)", value) else value
|
||||
setattr(namespace, self.dest, value)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue