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

xolox / python-humanfriendly / 375 / 8
93%
master: 93%

Build:
Build:
LAST BUILD BRANCH: dev
DEFAULT BRANCH: master
Ran 18 Feb 2020 12:58PM UTC
Files 11
Run time 2s
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

18 Feb 2020 12:50PM UTC coverage: 92.637% (-0.1%) from 92.752%
375.8

push

travis-ci

xolox
Fix Python 3 incompatibility (distutils.spawn)

Much to my dismay this morning I ran into the following breakage on a
Python 3.6 installation based on native Debian /  Ubuntu packages:

  Traceback (most recent call last):
    File "...", line 1, in <module>
      from coloredlogs.syslog import enable_system_logging
    File ".../coloredlogs/__init__.py", line 138, in <module>
      from humanfriendly import coerce_boolean
    File ".../humanfriendly/__init__.py", line 25, in <module>
      from humanfriendly.tables import format_pretty_table as format_table
    File ".../humanfriendly/tables.py", line 32, in <module>
      from humanfriendly.terminal import (
    File ".../humanfriendly/terminal.py", line 26, in <module>
      import distutils.spawn
  ModuleNotFoundError: No module named 'distutils.spawn'

To enable local development and testing against lots of Python releases
I use the "deadsnakes" package repository to install 2.7, 3.4, 3.5, 3.6,
3.7 and 3.8 at the same time. Before committing 335a69bae5 I did check
the availability of the distutils.spawn module:

peter@peter-mbp> ls -l /usr/lib/python*/distutils/spawn.py
-rw-r--r-- 1 root root 8,5K nov  7 11:07 /usr/lib/python2.7/distutils/spawn.py
-rw-r--r-- 1 root root 7,4K mrt 29  2019 /usr/lib/python3.4/distutils/spawn.py
-rw-r--r-- 1 root root 7,3K nov 24 02:35 /usr/lib/python3.5/distutils/spawn.py
-rw-r--r-- 1 root root 7,3K okt 28 17:30 /usr/lib/python3.6/distutils/spawn.py
-rw-r--r-- 1 root root 7,7K okt 28 17:30 /usr/lib/python3.7/distutils/spawn.py
-rw-r--r-- 1 root root 7,7K okt 28 17:30 /usr/lib/python3.8/distutils/spawn.py

I took this to mean it would be available on all these versions. Clearly
I was wrong and this broke Python 3 compatibility. This new commit
should fix the issue by using shutil.which() on Python 3 instead.

569 of 648 branches covered (87.81%)

1321 of 1426 relevant lines covered (92.64%)

0.93 hits per line

Source Files on job 375.8
  • Tree
  • List 0
  • Changed 5
  • Source Changed 2
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 355
  • Travis Job 375.8
  • 3545a665 on github
  • Prev Job for on dev (#373.2)
  • Next Job for on dev (#376.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

© 2025 Coveralls, Inc