-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
dash-generate-components crashes on windows #915
Conversation
…nd some of the offending command line arguments. This stops dash-generate-components crashing. The quotes placed around the ignore attribute need to be removed on entry to extract-meta.js These faults have been reported here: plotly/dash-component-boilerplate#74 #913
@@ -58,8 +58,11 @@ def generate_components( | |||
reserved_patterns = "|".join("^{}$".format(p) for p in reserved_words) | |||
|
|||
os.environ["NODE_PATH"] = "node_modules" | |||
|
|||
fmt = "node {} \"{}\" \"{}\" {}" if is_windows else "node {} {} {} {}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @stevej2608 !
Is it necessary that this change is only made on Windows? Can't we just always quote these arguments? Obviously we (Plotly devs) don't build on Windows very often, so I worry it'll just break again if Windows has special code.
I agree that allways quoting is the way to go, I'm not in a position to
test on anything other than Windows so
I went with the least risky solution. If you could give the "always quoted
solution" a go on unix then I'm sure
it will also run OK on Windows.
Cheers.
…On Mon, Sep 9, 2019 at 4:38 PM alexcjohnson ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In dash/development/component_generator.py
<#915 (comment)>:
> @@ -58,8 +58,11 @@ def generate_components(
reserved_patterns = "|".join("^{}$".format(p) for p in reserved_words)
os.environ["NODE_PATH"] = "node_modules"
+
+ fmt = "node {} \"{}\" \"{}\" {}" if is_windows else "node {} {} {} {}"
Thanks @stevej2608 <https://github.com/stevej2608> !
Is it necessary that this change is *only* made on Windows? Can't we just
*always* quote these arguments? Obviously we (Plotly devs) don't build on
Windows very often, so I worry it'll just break again if Windows has
special code.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#915?email_source=notifications&email_token=ABGWJHUCE2M2NKIXVSMK4STQIZUW7A5CNFSM4IU4NDZ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCEC6PVA#pullrequestreview-285599700>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABGWJHXMQXPHSK5IBZEJKD3QIZUW7ANCNFSM4IU4NDZQ>
.
|
Confirmed that we can use these quotes in all contexts - in fact they get stripped out immediately by >>> shlex.split('a "b" c')
['a', 'b', 'c']
>>> shlex.split('a "b" c', posix=False)
['a', '"b"', 'c'] So @stevej2608 if you can update to always add these quotes, I will be happy to merge. |
cmd = shlex.split( | ||
"node {} {} {} {}".format( | ||
"node {} \"{}\" \"{}\" {}".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: a more pythonic way is to use a single quote to avoid the escape
e.g. 'node {} "{}"'.format()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃 LGTM, thanks @stevej2608
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃
dash-generate-components crashes on windows. This fix puts quotes around some of the offending command line arguments. This stops dash-generate-components crashing. The quotes placed around the
ignore
attribute need to be removed on entry toextract-meta.js
These problems have been reported here:
Issue with executing dash-component-boilerplate on Windows
and here:
dash-generate-components ignore not working