Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3: delete_docker_containers broken #60

Open
pfuntner opened this issue Jan 3, 2020 · 1 comment
Open

Python 3: delete_docker_containers broken #60

pfuntner opened this issue Jan 3, 2020 · 1 comment
Labels
python3 Bugs related to switching from Python 2 to Python 3

Comments

@pfuntner
Copy link
Owner

pfuntner commented Jan 3, 2020

I'm finding more scripts that aren't working with Python 3:

$ delete_docker_containers
CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS               NAMES
47d0d5ff12b4        cc0abc535e36        "bash -c 'sleep 3153…"   About a minute ago   Created                                 alpine-latest-20200103094308152624
1f6474c87756        549b9b86cb8d        "bash -c 'sleep 3153…"   About a minute ago   Up About a minute                       ubuntu-18.04-20200103094257448886
0bc2b9f607d6        c6a43cd4801e        "bash -c 'sleep 3153…"   About a minute ago   Up About a minute                       ubuntu-16.04-20200103094256287931
32f5a41ddd39        f6c68e2ad82a        "bash -c 'sleep 3153…"   About a minute ago   Up About a minute                       debian-9-20200103094255098109
59349c9de889        5d7d9c6338e8        "bash -c 'sleep 3153…"   About a minute ago   Up About a minute                       debian-8-20200103094253913629
44c331f95bde        5e35e350aded        "bash -c 'sleep 3153…"   About a minute ago   Up About a minute                       centos-7-20200103094252741353
9db2ea3fa9d0        d0957ffdf8a2        "bash -c 'sleep 3153…"   About a minute ago   Up About a minute                       centos-6-20200103094251576296

Remove all containers? yes
47d0d5ff12b4
1f6474c87756
0bc2b9f607d6
32f5a41ddd39
59349c9de889
44c331f95bde
9db2ea3fa9d0
Traceback (most recent call last):
  File "/home/centos/bin/delete_docker_containers", line 39, in <module>
    (rc, stderr, stderr) = run(['docker', 'rm', '-f'] + [line.split()[0] for line in lines[1:]], capture=False)
  File "/home/centos/bin/delete_docker_containers", line 15, in run
    stdout = stdout.decode('utf-8')
AttributeError: 'NoneType' object has no attribute 'decode'
$

Switching back to Python 2 for now.

@pfuntner pfuntner changed the title Python 3: delete-docker-containers broken Python 3: delete_docker_containers broken Jan 3, 2020
@pfuntner
Copy link
Owner Author

pfuntner commented Jan 3, 2020

The script does abort but only after it's already deleted all the containers! Oh well!

@pfuntner pfuntner added the python3 Bugs related to switching from Python 2 to Python 3 label Oct 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python3 Bugs related to switching from Python 2 to Python 3
Projects
None yet
Development

No branches or pull requests

1 participant