Skip to content
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

Make component generator accept whitespace in paths #958

Closed
wants to merge 1 commit into from
Closed

Make component generator accept whitespace in paths #958

wants to merge 1 commit into from

Conversation

miqh
Copy link

@miqh miqh commented Oct 6, 2019

Hello,

I've made some tweaks to the component generator in an attempt to make it more lenient with the paths that Dash boilerplate projects can be set up at. Specifically, paths with whitespace should now be acceptable.

Some remarks concerning the changes:

  • Quoting the path to the extract-meta.js script helps avoid it being interpreted as multiple arguments (i.e. delimited by whitespace) when passed to Node
  • Non-POSIX mode for shlex.split() appears to undesirably interfere with the script path, producing something incorrect on my Windows box, which I thought was odd.
  • Also got rid of the shell=True because according to the subprocess.Popen documentation, "The only time you need to specify shell=True on Windows is when the command you wish to execute is built into the shell (e.g. dir or copy)."

I also tested these changes on an Ubuntu box to see whether paths with whitespace could work, and they did.

Relevant issue reported previously: plotly/dash-component-boilerplate#71

When the Dash boilerplate project is set up at a path involving
whitespaces, the invocation of the `extract-meta.js` script through Node
will trip up.

Quoting the script path should help prevent the latter from being
interpreted as a series of arguments (i.e. whitespace being the
delimiter).

Furthermore, a quirk with non-POSIX mode with `shlex` means the split
call will still try to delimit the script path, even though it is
quoted. So irrespective of OS, this should be turned off.

plotly/dash-component-boilerplate#71
@alexcjohnson
Copy link
Collaborator

This looks good to me, but as I don't have access to a Windows machine and this was recently edited in #915 perhaps @stevej2608 would like to chime in on whether this change is a good idea?

@miqh miqh closed this Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants