I have a question regarding the new is_file_like function and its usage in IO functions like read_csv

This new change in pandas 0.20 breaks many codes which previously assume that a file-like object is just an object possessing read or write method.

Is there any specific reason we have to enforce such conditions?

When making such changes why we have to break the previous behaviors?

Comment From: jorisvandenbossche

@stonefly There are a couple of related issues about this, eg see https://github.com/pandas-dev/pandas/issues/17135, https://github.com/pandas-dev/pandas/issues/16135, https://github.com/pandas-dev/pandas/issues/16530 Can you see if you have additional issues that are not mentioned there?

If so, please be more specific: what files are giving trouble? What version of pandas are you using? (some things were fixed only in 0.20.2)

Comment From: stonefly

Hi, I can confirm that 0.20.2 fixes our problem (because it does not see next method in 0.20.1).

But in general it is not the first time we got surprising breaks due to some changes like this.

Do you know why we start changing this logic since 0.20?

Isn't duck-typing rule sufficient here?

Comment From: jreback

closing as this is duplicated by many issues.