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

theskumar / python-dotenv / 464
88%

Build:
DEFAULT BRANCH: master
Ran 12 May 2019 10:41AM UTC
Jobs 9
Files 6
Run time 2min
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

pending completion
464

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.

260 of 293 relevant lines covered (88.74%)

6.16 hits per line

Jobs
ID Job ID Ran Files Coverage
1 464.1 (TOXENV=lint) 12 May 2019 10:41AM UTC 0
Travis Job 464.1
2 464.2 (TOXENV=manifest) 12 May 2019 10:41AM UTC 0
Travis Job 464.2
3 464.3 (TOXENV=py27) 12 May 2019 10:41AM UTC 0
88.05
Travis Job 464.3
4 464.4 (TOXENV=py34) 12 May 2019 10:42AM UTC 0
88.05
Travis Job 464.4
5 464.5 (TOXENV=py35) 12 May 2019 10:42AM UTC 0
88.05
Travis Job 464.5
6 464.6 (TOXENV=py36) 12 May 2019 10:42AM UTC 0
88.05
Travis Job 464.6
7 464.7 (TOXENV=py37) 12 May 2019 10:43AM UTC 0
88.05
Travis Job 464.7
8 464.8 (TOXENV=pypy) 12 May 2019 10:43AM UTC 0
88.05
Travis Job 464.8
9 464.9 (TOXENV=pypy3) 12 May 2019 10:44AM UTC 0
88.05
Travis Job 464.9
Source Files on build 464
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #464
  • 62df65a6 on github
  • Prev Build on master (#462)
  • Next Build on master (#465)
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