-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue with docopt #1986
Comments
I found a solution:
|
fixed |
Running into this issue on first install:
Is this related? Tried the troubleshooting steps above to no avail. |
I'm still getting the error. I've tried uninstall mackup & python@3 then reinstalling mackup and letting it pull in python@3... but it's not working |
In Python 3.6, invalid escape sequence were deprecated in string literals. In Python 3.12, they generate
Unfortunately, To resolve the
|
@amine2233 I sugguest reopening this issue. |
Is it as simple as patching docopt to use rawstrings for regexes?
|
@westurner Yes. diff --git a/lib/python3.12/site-packages/docopt.py b/lib/python3.12/site-packages/docoptnew.py
index 7b927e2..2a9590d 100644
--- a/lib/python3.12/site-packages/docopt.py
+++ b/lib/python3.12/site-packages/docoptnew.py
@@ -162,8 +162,8 @@ class Argument(ChildPattern):
@classmethod
def parse(class_, source):
- name = re.findall('(<\S*?>)', source)[0]
- value = re.findall('\[default: (.*)\]', source, flags=re.I)
+ name = re.findall(r'(<\S*?>)', source)[0]
+ value = re.findall(r'\[default: (.*)\]', source, flags=re.I)
return class_(name, value[0] if value else None)
@@ -204,7 +204,7 @@ class Option(ChildPattern):
else:
argcount = 1
if argcount:
- matched = re.findall('\[default: (.*)\]', description, flags=re.I)
+ matched = re.findall(r'\[default: (.*)\]', description, flags=re.I)
value = matched[0] if matched else None
return class_(short, long, argcount, value)
@@ -453,7 +453,7 @@ def parse_argv(tokens, options, options_first=False):
def parse_defaults(doc):
# in python < 2.7 you can't pass flags=re.MULTILINE
- split = re.split('\n *(<\S+?>|-\S+?)', doc)[1:]
+ split = re.split(r'\n *(<\S+?>|-\S+?)', doc)[1:]
split = [s1 + s2 for s1, s2 in zip(split[::2], split[1::2])]
options = [Option.parse(s) for s in split if s.startswith('-')]
#arguments = [Argument.parse(s) for s in split if s.startswith('<')] |
Hello, thank you for your awesome work.
i had an issue with
mackup restore --force
onMac 0S
i installed
mackup
using brew my setup isthe result of the command is
other test
The text was updated successfully, but these errors were encountered: