Different DataFrames saved under filenames with different cases are overwritten

# Generate three different DFs
lower_df = pd.DataFrame({'a':['spam','eggs','ham']})
camel_df = pd.DataFrame({'a':['Spam','Eggs','Ham']}) 
upper_df = pd.DataFrame({'A':['SPAM','EGGS','HAM']})

# Write out the three DFs to three different CSVs
lower_df.to_csv('ingredients.csv')
camel_df.to_csv('Ingredients.csv')
upper_df.to_csv('INGREDIENTS.csv')

Problem description

Three different datasets, written to filenames with three different case sensitivities, results in only one file being produced.

Expected Output

On Windows 64, only one file is produced: it's titled "ingredients.csv" but contains the data from upper_df. I would expect three different files to be written out with the corresponding data from each of the three DFs.

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.6.3.final.0 python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 94 Stepping 3, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: None.None pandas: 0.20.3 pytest: 3.2.1 pip: None setuptools: 36.5.0.post20170921 Cython: 0.26.1 numpy: 1.13.3 scipy: 0.19.1 xarray: None IPython: 6.1.0 sphinx: 1.6.3 patsy: 0.4.1 dateutil: 2.6.1 pytz: 2017.2 blosc: None bottleneck: 1.2.1 tables: 3.4.2 numexpr: 2.6.2 feather: None matplotlib: 2.1.0 openpyxl: 2.4.8 xlrd: 1.1.0 xlwt: 1.3.0 xlsxwriter: 1.0.2 lxml: 4.1.0 bs4: 4.6.0 html5lib: 0.999999999 sqlalchemy: 1.1.13 pymysql: None psycopg2: None jinja2: 2.9.6 s3fs: None pandas_gbq: None pandas_datareader: None

Comment From: TomAugspurger

We should be matching the filesystem here. On my Mac that (correctly) has a single file since my filesystem is case insensitive.

Can you check the output of

open('foo.csv', 'wb')
open('FOO.csv', wb')

and let me know if you get one or two files? I assume python is doing the correct thing.

Comment From: brianckeegan

I can confirm that only one file is produced on my Windows 64: the "foo.csv" but not "FOO.csv"

Comment From: brianckeegan

Since it appears that Windows's NTFS and FAT file systems are normally case insensitive, this appears to be the intended functionality and outside the scope of pandas.

Recommend closing and I'll hack my way to another solution.

Comment From: chris-b1

Correct, Windows paths are effectively case insensitive