BUG: Fix loading files from S3 with # characters in URL (GH25945)
State: closed

This fixes loading files with URLs such as s3://bucket/key#1.csv.  The part
from the # on was being lost because it was considered to be a URL fragment.
The fix disables URL fragment parsing as it doesn't make sense for S3 URLs.

- [x] closes #25945 
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Bug
name: IO Data
description: IO issues that don't fit into a more specific label

Comments:
I believe the CI failures are due to my added test, which is causing s3fs to be imported due to importing the `_strip_schema` function from `pandas.io.s3`.  This was really the only way I could see to add a test for this fix, other than try to load something from an actual S3 bucket.  Is it okay to add s3fs as a test dependency, and if so, how do I do that?
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25992?src=pr&el=h1) Report
> Merging [#25992](https://codecov.io/gh/pandas-dev/pandas/pull/25992?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/6de813364fd4ebfd16e2794e5ac3422d3bef87e7?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #25992      +/-   ##
==========================================
- Coverage   91.82%   91.82%   -0.01%     
==========================================
  Files         175      175              
  Lines       52539    52539              
==========================================
- Hits        48246    48242       -4     
- Misses       4293     4297       +4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.38% <100%> (ø)` | :arrow_up: |
| #single | `40.73% <0%> (-0.14%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25992?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/s3.py](https://codecov.io/gh/pandas-dev/pandas/pull/25992/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3MzLnB5) | `89.47% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/25992/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `75% <0%> (-12.5%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25992/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.79% <0%> (-0.12%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25992?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/25992?src=pr&el=footer). Last update [6de8133...05bf507](https://codecov.io/gh/pandas-dev/pandas/pull/25992?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

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

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

```diff
@@            Coverage Diff             @@
##           master   #25992      +/-   ##
==========================================
- Coverage   91.84%   91.83%   -0.01%     
==========================================
  Files         175      175              
  Lines       52517    52517              
==========================================
- Hits        48232    48228       -4     
- Misses       4285     4289       +4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.39% <100%> (ø)` | :arrow_up: |
| #single | `40.72% <0%> (-0.14%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25992?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/s3.py](https://codecov.io/gh/pandas-dev/pandas/pull/25992/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3MzLnB5) | `89.47% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/25992/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `75% <0%> (-12.5%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25992/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.79% <0%> (-0.12%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25992?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/25992?src=pr&el=footer). Last update [af0ecbe...0007503](https://codecov.io/gh/pandas-dev/pandas/pull/25992?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Comments addressed.
great. ping on green.
Thanks @swt2c