BUG: Infer compression by default in read_fwf() (#22199)
State: closed

- [x] closes #22199
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Bug
name: IO Data
description: IO issues that don't fit into a more specific label
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22200?src=pr&el=h1) Report
> Merging [#22200](https://codecov.io/gh/pandas-dev/pandas/pull/22200?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/fc7bc3f74d1f5702bf66c519ad190126538a8f5b?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `100%`.

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

```diff
@@           Coverage Diff           @@
##           master   #22200   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         163      163           
  Lines       51943    51943           
=======================================
  Hits        47946    47946           
  Misses       3997     3997
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.71% <100%> (ø)` | :arrow_up: |
| #single | `43% <100%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22200?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/parsers.py](https://codecov.io/gh/pandas-dev/pandas/pull/22200/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhcnNlcnMucHk=) | `95.38% <100%> (ø)` | :arrow_up: |

------

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

can you merge master and update
Hello @NasaGeek! Thanks for updating the PR.





Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on December 24, 2018 at 00:18 Hours UTC
Rebased and expanded a test
can you merge master and update according to fixtures as pointed to by @gfyoung 
@NasaGeek can you merge master and update
@NasaGeek can you merge master (or @gfyoung if you can)
Happy to rebase, @jreback, but unfortunately I don't yet have an approach to your parametrization request. The available fixture doesn't quite give me enough to work with by itself. It looks like pandas.util.testing.decompress_file may provide a solution if it's augmented to allow return writable file objects. The issue there is that the open function in python2's zipfile module will not give back writable files. Would you be willing to miss coverage on zipfile in python2? If so, what's the best way to skip it?
@NasaGeek : You raise some good points regarding the fixtures.  I'm going to first do some refactoring on the `test_read_fwf.py` file itself first before revisiting this PR.
Just wanted to confirm you didn't need anything else from me on this PR. @gfyoung's changes look fine to me.
lgtm. ping on green. @jbrockmendel if you have comments.
@jreback : Tests are all green.  PTAL.

@jbrockmendel : Any other thoughts?
Alrighty, I think we have enough approvals here 😉 
Thanks @NasaGeek for contributing to this!