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

using py3 on linux not working #322

Closed
ewierschke opened this issue Jun 7, 2017 · 5 comments
Closed

using py3 on linux not working #322

ewierschke opened this issue Jun 7, 2017 · 5 comments

Comments

@ewierschke
Copy link

ewierschke commented Jun 7, 2017

Using either CentOS 6.9 or 7.3 with python34 installed from repo produces the following on watchmaker execution.

Traceback (most recent call last):
  File "/usr/bin/watchmaker", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python3.4/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.4/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.4/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.4/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.4/site-packages/watchmaker/cli.py", line 93, in main
    sys.exit(watchmaker_client.install())
  File "/usr/lib/python3.4/site-packages/watchmaker/__init__.py", line 415, in install
    workers_manager.worker_cadence()
  File "/usr/lib/python3.4/site-packages/watchmaker/managers/workers.py", line 27, in worker_cadence
    **configuration
  File "/usr/lib/python3.4/site-packages/watchmaker/workers/yum.py", line 43, in __init__
    self.dist_info = self.get_dist_info()
  File "/usr/lib/python3.4/site-packages/watchmaker/workers/yum.py", line 59, in get_dist_info
    with open(name='/etc/system-release', mode='rb') as fh_:
TypeError: Required argument 'file' (pos 1) not found
@KevinPlus3
Copy link
Contributor

KevinPlus3 commented Jun 7, 2017

This does not sound like a Python issue - but rather an issue with opening /etc/system-release. Are you saying this is working fine in Python 2.*, but did not work fine with Python 3.*?

@KevinPlus3
Copy link
Contributor

Adding comment from Loren as he has researched it - "It is a py3 issue. py3 switched the default open to io.open, which changed the name of the first argument from name in py2 to file."

@KevinPlus3
Copy link
Contributor

Once this is addressed, then a new error pops up:

Traceback (most recent call last):
  File "/usr/bin/watchmaker", line 11, in <module>
    load_entry_point('watchmaker==0.4.5.dev0', 'console_scripts', 'watchmaker')()
  File "/usr/lib/python3.4/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.4/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.4/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.4/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.4/site-packages/watchmaker/cli.py", line 93, in main
    sys.exit(watchmaker_client.install())
  File "/usr/lib/python3.4/site-packages/watchmaker/__init__.py", line 415, in install
    workers_manager.worker_cadence()
  File "/usr/lib/python3.4/site-packages/watchmaker/managers/workers.py", line 27, in worker_cadence
    **configuration
  File "/usr/lib/python3.4/site-packages/watchmaker/workers/yum.py", line 43, in __init__
    self.dist_info = self.get_dist_info()
  File "/usr/lib/python3.4/site-packages/watchmaker/workers/yum.py", line 69, in get_dist_info
    matched = self.DIST_PATTERN.search(release.lower())
TypeError: can't use a string pattern on a bytes-like object

@KevinPlus3
Copy link
Contributor

Gonna look into it and try to address it tonight.

@KevinPlus3
Copy link
Contributor

With PR #323 and #324 , we can finally close this.

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

2 participants