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

Chrome process launch fails when Windows user name contains 'special' characters. #333

Closed
RyanONeill1970 opened this Issue Jun 18, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@RyanONeill1970
Copy link
Contributor

RyanONeill1970 commented Jun 18, 2018

My name on some Windows installations is embedded into the user directory so that it comes out as

C:\Users\Ryan O'Neill\AppData\....

There are two problems here, the space and the apostrophe. I imagine other characters will cause this issue too. When launching Chrome, the process ignores all of the characters past the space and shows this error (via a popup dialogue, visible when headless is turned off);

Failed to Create Data Directory
Chromium cannot read or write to its data directory:
C:\Users\Ryan

This can be rectified in Launcher.cs by amending;
chromeArguments.Add($"{UserDataDirArgument}={options.UserDataDir}");
to
chromeArguments.Add($"{UserDataDirArgument}=\"{options.UserDataDir}\"");

To reproduce this error, create a Windows user with a space in their name. A lot of the unit tests then fail.

I am happy to provide a pull-request, but thought I would check first.

@kblok

This comment has been minimized.

Copy link
Owner

kblok commented Jun 18, 2018

Pull requests are welcome @RyanONeill1970.

Thanks for taking the time to go through the code!

RyanONeill1970 added a commit to RyanONeill1970/puppeteer-sharp that referenced this issue Jun 18, 2018

@kblok kblok closed this in #335 Jun 18, 2018

kblok added a commit that referenced this issue Jun 18, 2018

user-data-dir improvements (#335)
* Closes issue #333 by handling paths with spaces in them.

* Move 'space in file path' code to extensions.

* Use Cake Code, more cake is always good.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment