Issue 1:
Code Sample, a copy-pastable example if possible

"""Pandas bug."""
from numpy.random import choice, seed
from pandas import DataFrame
from pandas.util.testing import rands_array

seed(1234)
N = 5 * 10 ** 6

DTF = DataFrame({'Col{}'.format(k): choice(rands_array(10, 750), N) for k in range(65)})

print(DTF)

DTF.to_csv('File{}.csv'.format(N)

Problem description

to_csv exception, eventually linked to latest version regression #21471 issue with to_csv with compression

Expected Output

Expected no exception

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/frame.py", line 1745, in to_csv
formatter.save()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/io/formats/csvs.py", line 166, in save
f.write(buf)
OSError: [Errno 22] Invalid argument

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None

python: 3.6.5.final.0

python-bits: 64

OS: Darwin

OS-release: 17.6.0

machine: x86_64

processor: i386

byteorder: little

LC_ALL: None

LANG: en_US.UTF-8

LOCALE: en_US.UTF-8

pandas: 0.23.1

pytest: None

pip: 10.0.1

setuptools: 39.0.1

Cython: None

numpy: 1.14.5

scipy: 1.1.0

pyarrow: None

xarray: None

IPython: None

sphinx: None

patsy: None

dateutil: 2.7.3

pytz: 2018.4

blosc: None

bottleneck: None

tables: None

numexpr: None

feather: None

matplotlib: None

openpyxl: None

xlrd: 1.1.0

xlwt: None

xlsxwriter: None

lxml: None

bs4: None

html5lib: None

sqlalchemy: None

pymysql: None

psycopg2: None

jinja2: 2.10

s3fs: None

fastparquet: None

pandas_gbq: None

pandas_datareader: None

Issue 2:
xref #12585

I think this ought to raise a ValueErrror:

In [1]: pd.to_datetime('01-13-2012', dayfirst=True)
Out[1]: datetime.datetime(2012, 1, 13, 0, 0)

This means if my data is bad (i.e. somehow I have a mixture of american and british string-dates), I won't be told there was an issue when parsing! I can't think of a usecase where this kind of precedence would be appropriate, and it means you'll end up with incorrect dates.

The precedence behaviour appears to be a feature from dateutil (which tslib.array_to_datetime calls):

In [2]: from dateutil.parser import parse as parse_date

In [3]: parse_date('1/12/2012', dayfirst=True)
Out[3]: datetime.datetime(2012, 12, 1, 0, 0)

In [4]: parse_date('1/13/2012', dayfirst=True)
Out[4]: datetime.datetime(2012, 1, 13, 0, 0)

It should raising like this:

In [5]: parse_date('14/14/2012', dayfirst=True)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-ca14fc16e421> in <module>()
----> 1 parse_date('14/14/2012', dayfirst=True)

/Library/Python/2.7/site-packages/dateutil/parser.pyc in parse(timestr, parserinfo, **kwargs)
718 return parser(parserinfo).parse(timestr, **kwargs)
719 else:
--> 720 return DEFAULTPARSER.parse(timestr, **kwargs)
721
722

/Library/Python/2.7/site-packages/dateutil/parser.pyc in parse(self, timestr, default, ignoretz, tzinfos, **kwargs)
315 if value is not None:
316 repl[attr] = value
--> 317 ret = default.replace(**repl)
318 if res.weekday is not None and not res.day:
319 ret = ret+relativedelta.relativedelta(weekday=res.weekday)

ValueError: month must be in 1..12

... :(