Something went wrong while setting issue due date.
flake8.api.legacy.get_style_guide invariantly triggers DeprecationWarning under python2
Minimal reproduction:
import warnings
from flake8.api.legacy import get_style_guide
warnings.simplefilter('error')
get_style_guide()
Stacktrace:
$ .tox/py27/bin/python test.py
Traceback (most recent call last):
File "test.py", line 6, in <module>
get_style_guide()
File "/home/asottile/workspace/cheetah_lint/.tox/py27/local/lib/python2.7/site-packages/flake8/api/legacy.py", line 31, in get_style_guide
application.parse_configuration_and_cli([])
File "/home/asottile/workspace/cheetah_lint/.tox/py27/local/lib/python2.7/site-packages/flake8/main/application.py", line 164, in parse_configuration_and_cli
self.option_manager, argv
File "/home/asottile/workspace/cheetah_lint/.tox/py27/local/lib/python2.7/site-packages/flake8/options/aggregator.py", line 47, in aggregate_options
original_values.isolated)
File "/home/asottile/workspace/cheetah_lint/.tox/py27/local/lib/python2.7/site-packages/flake8/options/config.py", line 281, in parse
return self.merge_user_and_local_config()
File "/home/asottile/workspace/cheetah_lint/.tox/py27/local/lib/python2.7/site-packages/flake8/options/config.py", line 244, in merge_user_and_local_config
user_config = self.parse_user_config()
File "/home/asottile/workspace/cheetah_lint/.tox/py27/local/lib/python2.7/site-packages/flake8/options/config.py", line 216, in parse_user_config
config = self.config_finder.user_config()
File "/home/asottile/workspace/cheetah_lint/.tox/py27/local/lib/python2.7/site-packages/flake8/options/config.py", line 120, in user_config
config, found_files = self._read_config(self.user_config_file())
File "/home/asottile/workspace/cheetah_lint/.tox/py27/local/lib/python2.7/site-packages/flake8/options/config.py", line 56, in _read_config
found_files = config.read(files)
File "/home/asottile/workspace/cheetah_lint/.tox/py27/local/lib/python2.7/site-packages/backports/configparser/__init__.py", line 696, in read
stacklevel=2,
DeprecationWarning: You passed a bytestring as `filenames`. This will not work on Python 3. Use `cp.read_file()` or switch to using Unicode strings across the board.
The filename it is complaining about:
$ .tox/py27/bin/python -m pdb test.py
> /home/asottile/workspace/cheetah_lint/test.py(1)<module>()
-> import warnings
(Pdb) c
Traceback (most recent call last):
File "/usr/lib/python2.7/pdb.py", line 1314, in main
pdb._runscript(mainpyfile)
File "/usr/lib/python2.7/pdb.py", line 1233, in _runscript
self.run(statement)
File "/usr/lib/python2.7/bdb.py", line 400, in run
exec cmd in globals, locals
...
File "/home/asottile/workspace/cheetah_lint/.tox/py27/local/lib/python2.7/site-packages/backports/configparser/__init__.py", line 696, in read
stacklevel=2,
DeprecationWarning: You passed a bytestring as `filenames`. This will not work on Python 3. Use `cp.read_file()` or switch to using Unicode strings across the board.
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /home/asottile/workspace/cheetah_lint/.tox/py27/local/lib/python2.7/site-packages/backports/configparser/__init__.py(696)read()
-> stacklevel=2,
(Pdb) up
> /home/asottile/workspace/cheetah_lint/.tox/py27/local/lib/python2.7/site-packages/flake8/options/config.py(56)_read_config()
-> found_files = config.read(files)
(Pdb) files
'/home/asottile/.config/flake8'