Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backports/configparser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def read(self, filenames, encoding=None):

Return list of successfully read files.
"""
if PY2 and isinstance(filenames, bytes):
if PY2 and isinstance(filenames, bytes) and sys.py3kwarning:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This additional guard should have been added inside the if, only for the warnings.warn().
By adding it here, filenames = [filenames] is not executed.

This is breaking flake8 (which depends on configparser under Python 2) for me, setup.cfg of my project seems to be ignored with this change, while it works normally if I remove it.

I see that this code has just been removed in the master branch, are you planning to release configparser 3.7.0 soon?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which causes #27

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you planning to release configparser 3.7.0 soon?

Yes. I actually thought I had. Indeed, I'd tagged it, just not pushed the releases. I'll do that now.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Both 3.5.3 and 3.7.0 fix the issue for me.

# we allow for a little unholy magic for Python 2 so that
# people not using unicode_literals can still use the library
# conveniently
Expand Down