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/ 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, 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:

;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__.:

branch = True
source =

omit =

source =

My nose configuration file is:

; Uncomment to have the stdout
; Uncomment to remove the python logger from output (except for console logs)

; Only 1 running test process
; Process timeout is 5 minutes
; Restart worker process (avoid memory leak)

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