DOC: Handle whitespace in pathnames
State: closed

Fixed make.py - Now should be able to run make.py in paths with whitespaces (#20862)


Labels:
name: Docs

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20880?src=pr&el=h1) Report
> Merging [#20880](https://codecov.io/gh/pandas-dev/pandas/pull/20880?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/a393675b992c8b6f9acd8d0d586c008c111d4177?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/20880/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/20880?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #20880      +/-   ##
==========================================
+ Coverage   92.19%   92.19%   +<.01%     
==========================================
  Files         169      169              
  Lines       50821    50825       +4     
==========================================
+ Hits        46852    46857       +5     
+ Misses       3969     3968       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.6% <ø> (ø)` | :arrow_up: |
| #single | `42.37% <ø> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/20880?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/window.py](https://codecov.io/gh/pandas-dev/pandas/pull/20880/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvd2luZG93LnB5) | `96.4% <0%> (+0.11%)` | :arrow_up: |
| [pandas/core/groupby/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/20880/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9iYXNlLnB5) | `91.83% <0%> (+0.72%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20880?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20880?src=pr&el=footer). Last update [a393675...a919eff](https://codecov.io/gh/pandas-dev/pandas/pull/20880?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

@datapythonista @jorisvandenbossche 

how does this look?
I was taking a look at it yesterday, as I'm not sure in windows the single quotes will handle backslashes well. But unrelated to the ticket I'm getting a segmentation fault when running sphinx-built. Will comment on the ticket with feedback when I manage to test it.
Can't test on Windows at the moment, but for linux this patch works nicely and fixes the problem for me.
@ThiviyanThanapalasingam seems like in Windows the paths need to be escaped with double quotes (the backlash is interpreted as an escape character like in `\n`).

Besides that, I personally find it's not very readable to use backslashes to escape the quotes. Meaning that instead of `'\'{}\''` I think it'd be more clear to use `"'{}'"`. Or now that we need to change to double quotes, the opposite: `'"{}"'`.

Also, I see that there are several paths that are built like `source/*.rst` (instead of `os.path.join('source', '*.rst')`. I couldn't try, but I guess sphinx is failing to exclude these files like in unix systems. Do we want to open an issue for making the script work in Windows @jreback?


@ThiviyanThanapalasingam do you have time to update the PR based on the feedback I provided?
Yes, I can do that. @datapythonista Have you opened another issue for making the script work in Windows? 
No, I think it should be just the one you opened.
@datapythonista ?
@ThiviyanThanapalasingam can you update the PR based on the previous feedback?
Hello @ThiviyanThanapalasingam! Thanks for updating the PR.

 - There are no PEP8 issues in the file [`doc/make.py`](https://github.com/ThiviyanThanapalasingam/pandas/blob/a919eff8df2cca0258e615c7dffa8fe8f2d7be33/doc/make.py) !


Made the updates to this PR. But seems like there is a new unrelated problem when the path contains whitespaces: #22836

I think that can be addressed in a separate PR. I would merge this on green, but happy to close this and take care of both problems in a new PR.
Let's do that in a separate PR

@ThiviyanThanapalasingam thanks for the original PR!