• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

theskumar / python-dotenv / 464 / 3
88%
master: 88%

Build:
DEFAULT BRANCH: master
Ran 12 May 2019 10:41AM UTC
Files 6
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 May 2019 10:40AM UTC coverage: 88.055% (+0.6%) from 87.5%
TOXENV=py27

push

travis-ci

theskumar
Fix unicode/str inconsistency in Python 2 (#177)

This encodes environment keys and values for `os.environ` in Python 2
and fixes the following issues:

* Values loaded from `.env` being `unicode` whereas regular values being
  `str` (i.e. `bytes`) in Python 2.
* Error when loading `.env` with UTF-8 characters in Python 2.
* `# type: ignore` hiding the issue from the type checker.

`sys.getfilesystemencoding()` is used because it seems to match the
encoding used for environment variables with Python 2.  Since it can
apparently return `None`, we fall back to a default encoding (UTF-8
here) if that's the case.

I tested this on Windows where `"mbcs"` is the file system encoding.
Hopefully, this will also work on other systems.

258 of 293 relevant lines covered (88.05%)

0.88 hits per line

Source Files on job 464.3 (TOXENV=py27)
  • Tree
  • List 0
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 373
  • Travis Job 464.3
  • 62df65a6 on github
  • Prev Job for TOXENV=py27 on master (#462.3)
  • Next Job for TOXENV=py27 on master (#465.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc