remove 1 char line terminator limit
State: closed

This PR closes #3501
This restriction is preventing the loading of CRLF delimited CSVs


Steps to reproduce:

```
import pandas as pd
import StringIO
pd.read_csv(StringIO.StringIO(' a,b,c\r\n'), header=None, lineterminator='\r\n')

ValueError: Only length-1 line terminators supported

```

while the following parses the CSV successfully: 

```
import pandas as pd
import StringIO
pd.read_csv(StringIO.StringIO(' a,b,c\r\n'), header=None)
```



Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas
name: IO CSV
description: read_csv, to_csv

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

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

```diff
@@            Coverage Diff             @@
##           master   #19601      +/-   ##
==========================================
- Coverage   91.82%   91.59%   -0.23%     
==========================================
  Files         152      150       -2     
  Lines       49248    48790     -458     
==========================================
- Hits        45222    44691     -531     
- Misses       4026     4099      +73
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.97% <ø> (-0.25%)` | :arrow_down: |
| #single | `41.73% <ø> (-0.17%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/19601?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/tseries/plotting.py](https://codecov.io/gh/pandas-dev/pandas/pull/19601/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvcGxvdHRpbmcucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/core/dtypes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/19601/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2Jhc2UucHk=) | `47.61% <0%> (-44.28%)` | :arrow_down: |
| [pandas/plotting/\_compat.py](https://codecov.io/gh/pandas-dev/pandas/pull/19601/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb21wYXQucHk=) | `62% <0%> (-28.91%)` | :arrow_down: |
| [pandas/core/arrays/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/19601/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2Jhc2UucHk=) | `56.66% <0%> (-27.48%)` | :arrow_down: |
| [pandas/core/missing.py](https://codecov.io/gh/pandas-dev/pandas/pull/19601/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvbWlzc2luZy5weQ==) | `85.9% <0%> (-5.75%)` | :arrow_down: |
| [pandas/plotting/\_timeseries.py](https://codecov.io/gh/pandas-dev/pandas/pull/19601/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL190aW1lc2VyaWVzLnB5) | `60.82% <0%> (-4.49%)` | :arrow_down: |
| [pandas/core/reshape/tile.py](https://codecov.io/gh/pandas-dev/pandas/pull/19601/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS90aWxlLnB5) | `90.25% <0%> (-3.12%)` | :arrow_down: |
| [pandas/io/html.py](https://codecov.io/gh/pandas-dev/pandas/pull/19601/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2h0bWwucHk=) | `85.98% <0%> (-2.81%)` | :arrow_down: |
| [pandas/io/formats/format.py](https://codecov.io/gh/pandas-dev/pandas/pull/19601/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvZm9ybWF0LnB5) | `96.24% <0%> (-2.01%)` | :arrow_down: |
| [pandas/core/arrays/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/19601/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2NhdGVnb3JpY2FsLnB5) | `94.87% <0%> (-1.32%)` | :arrow_down: |
| ... and [62 more](https://codecov.io/gh/pandas-dev/pandas/pull/19601/diff?src=pr&el=tree-more) | |

------

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

It's not clear exactly what this is fixing - your second example runs before this change?  Also needs tests, thanks.
@chris-b1 
sure - will add tests
the first example explicitly specifies the CRLF lineterminator and fails - the second example does not specify the lineterminator and succeeds. This behavior does not seem desirable
As the tests are showing, this is more complicated than just removing the check - down in the c parser the line terminator can only be 1 character:
https://github.com/pandas-dev/pandas/blob/df38f66b417b754afdd2b0e17282255bbf2c769e/pandas/_libs/src/parser/tokenizer.h#L172

`'\r\n'` is special - parsing code gets tough to follow, but is effectively the default.
https://github.com/pandas-dev/pandas/blob/df38f66b417b754afdd2b0e17282255bbf2c769e/pandas/_libs/src/parser/tokenizer.c#L668

So a better workaround for #3501 may be to simply special-case it - treat `'\r\n'` as `lineterminator=None`
closing as stale. if you are interested in fixing according to @chris-b1 comments, pls ping / submit new pr.
\r\n line terminator in windows is still problematic.
even with single char line terminator, pandas displays \n in undesirable places.
I'm new to pandas and python. Do I need to debug this myself?
ironically, part of the issue is using debug console in visual studio code. - it displays literal \n instead of producing a new line. 
I still cannot load a csv file with a CRLF line terminator. is their a trick to load such a file in pandas?
@danjjl unfortunately it is still a mess. I have CSV files with \r\n line terminators and some columns contain random \n's within the text. Panda breaks on this.
This is still reproducible in v1.2.4.
this a non merged PR the issue is #3501