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

theskumar / python-dotenv / 463 / 5
89%
master: 88%

Build:
Build:
LAST BUILD BRANCH: patch-1
DEFAULT BRANCH: master
Ran 06 May 2019 05:21PM 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

06 May 2019 05:19PM UTC coverage: 88.055% (+0.6%) from 87.5%
TOXENV=py35

Pull #177

travis-ci

web-flow
Fix unicode/str inconsistency in Python 2

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.
Pull Request #177: Fix unicode/str inconsistency in Python 2

258 of 293 relevant lines covered (88.05%)

0.88 hits per line

Source Files on job 463.5 (TOXENV=py35)
  • Tree
  • List 0
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 372
  • Travis Job 463.5
  • d14271cc on github
  • Prev Job for TOXENV=py35 on fix-str-unicode-env-python-2 (#462.5)
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