DeprecationWarning: You passed a bytestring as `filenames`

Issue #530 resolved
Anonymous created an issue

I am using coverage (version 4.0) with nose (1.3.7) for my test suite on Travis CI.

Every time I am using the coverage script (erase, run, report, ...) I get this error raised:

coverage run --rcfile=.coveragerc -m nose -c .noserc
/home/travis/virtualenv/python2.7.12/lib/python2.7/site-packages/coverage/config.py:27: 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.
  return configparser.RawConfigParser.read(self, filename, **kwargs)

I do not understand what it means and where it comes from ...

I run this command:

coverage run --rcfile=.coveragerc -m nose -c .noserc

My coverage configuration file is:

[report]
;fail_under = 100
exclude_lines =
    pragma: no cover
    def __repr__
    if self.debug:
    if settings.DEBUG
    raise AssertionError
    raise NotImplementedError
    if 0:
    if __name__ == .__main__.:

[run]
branch = True
source =
    alignak

omit =
    */mock/*
    */nose/*

[paths]
source =
    /home/travis/build/Alignak-monitoring/alignak/alignak

My nose configuration file is:

[nosetests]
verbosity=3
; Uncomment to have the stdout
;nocapture=1
; Uncomment to remove the python logger from output (except for console logs)
;nologcapture=1

; Only 1 running test process
processes=1
; Process timeout is 5 minutes
process-timeout=300
; Restart worker process (avoid memory leak)
process-restartworker=1

Comments (10)

  1. Ned Batchelder repo owner

    Thanks, I can see that this line is in the Travis job:

    $ export PYTHONWARNINGS=all
    

    Aren't you bothered by the slew of other warnings you're getting? Why enable all these warnings? I don't need Python to tell me that my Python 2 code will behave differently in Python 3. I've already accounted for that.

  2. mohierf

    Thank you for the feedback and the hint for Python warnings, I did not know about this Travis feature. It seems that it is enabled as a default ... but I do not know yet why. I will investigate this.

  3. Log in to comment