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

AttributeError: 'int' object has no attribute 'isdigit' #14

Closed
thekvs opened this issue Sep 4, 2017 · 5 comments
Closed

AttributeError: 'int' object has no attribute 'isdigit' #14

thekvs opened this issue Sep 4, 2017 · 5 comments

Comments

@thekvs
Copy link

thekvs commented Sep 4, 2017

I've got this error while trying to run example from README:

$ dockerize -t sed /bin/sed
Traceback (most recent call last):
  File "/home/kvs/.local/bin/dockerize", line 11, in <module>
    sys.exit(main())
  File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/main.py", line 125, in main
    app.build()
  File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/dockerize.py", line 122, in build
    self.resolve_deps()
  File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/dockerize.py", line 200, in resolve_deps
    deps.add(path)
  File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/depsolver.py", line 110, in add
    self.get_deps(path)
  File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/depsolver.py", line 81, in get_deps
    elf = ELFFile(path)
  File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/depsolver.py", line 36, in __init__
    self.read_sections()
  File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/depsolver.py", line 48, in read_sections
    if not line or not line[0].isdigit():
AttributeError: 'int' object has no attribute 'isdigit'

Used version (installed via pip):

$ dockerize --version
dockerize version 0.2.2
@larsks
Copy link
Owner

larsks commented Sep 4, 2017

What version of docker are you running? It's possible that there has been an api change such that integers are now delivered as numeric values rather than strings. I'll take a look.

@thekvs
Copy link
Author

thekvs commented Sep 4, 2017

The latest stable docker-ce.

$ docker --version
Docker version 17.06.1-ce, build 874a737

@Serkan-devel
Copy link

This issue still persists on armhf

Docker version 17.05.0-ce, build 89658be

@iddm
Copy link
Contributor

iddm commented Mar 8, 2018

How can the version of docker affect that? The error is clear that the variable at the needed line is not a string anymore. Looking from where from it is got we don't have anything related to the docker, or to the kernel or anything else, but to objdump utility. So the problem can be only in its output or the python itself. I'd ask for a coreutils version and python version.

@iddm
Copy link
Contributor

iddm commented Mar 8, 2018

If we look at the problem, we will see that the python version is 3.6 and the code chunk which gives the error contains the subprocess.check_output which has changed since 3.6 version:

  • Changed in version 3.6: Added encoding and errors parameters

This can be fixed by using encoding parameter correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants