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

TypeError: unsupported operand type(s) for %: 'bytes' and 'tuple' #44

Closed
jasontibbitts opened this issue Dec 7, 2015 · 4 comments
Closed
Assignees

Comments

@jasontibbitts
Copy link
Contributor

A user reported the following backtrace in https://bugzilla.redhat.com/show_bug.cgi?id=1288853
(Please ignore the fact that the reporter has no interpersonal skills whatsoever.)

Traceback (most recent call last):
File "/usr/bin/pyzor", line 408, in <module>
  main()
File "/usr/bin/pyzor", line 152, in main
  if not dispatch(client, servers, config):
File "/usr/bin/pyzor", line 239, in check
  send_digest(digested, mock_runner, servers)
File "/usr/bin/pyzor", line 262, in send_digest
  _send_digest(runner, servers[0], digested)
File "/usr/bin/pyzor", line 253, in _send_digest
  runner.run(server, (digested, server))
File "/usr/lib/python3.4/site-packages/pyzor/client.py", line 258, in run
  response = self.routine(*args, **kwargs)
File "/usr/lib/python3.4/site-packages/pyzor/client.py", line 122, in _mock_check
  pyzor.proto_version))
TypeError: unsupported operand type(s) for %: 'bytes' and 'tuple'

I'm pretty sure this is simply python3-incompatible code. What I don't yet understand is why I can't repeat it. Will have to dig into this further

@alexkiro
Copy link
Contributor

alexkiro commented Dec 8, 2015

A user reported the following backtrace

Thanks for bringing that up here :)

I'm pretty sure this is simply python3-incompatible code. What I don't yet understand is why I can't repeat it. Will have to dig into this further

It does seem very likely that this is a problem with Python 3. We are testing with Python 3.4.2 (https://travis-ci.org/SpamExperts/pyzor/jobs/53316283) and it should be compatible.

Would help if we could have some more information:

  • the version of Pyzor (e.g. older version are not compatible with Python 3)
  • the Python version (Pyzor should support Python 3.4)
  • how is Pyzor being installed?

Unfortunately the code needs to first run through the 2to3 tool to be compatible but pip already takes care of that if you are using:

pip install pyzor

However if you are using other methods then it needs to be converted for Python 3. We are planning to use python-future to make get rid of this step in future releases.

@jasontibbitts
Copy link
Contributor Author

Somehow I didn't see your message; sorry for being slow to respond.

Fedora 23 has pyzor 1.0 and python3 3.4.3. pyzor is installed via the Fedora RPM, which I'm helping to maintain. The Fedora package doesn't apply any patches.

The RPM build process uses setup.py build (and install) to build and install things. My understanding is that this automatically ran 2to3; at least setup.py indicates that it does in the try block at the top. However, there's nothing about 2to3 in the build log so perhaps it isn't being called. I'm not entirely sure how I would check.

@tonyandrewmeyer
Copy link
Contributor

For what it's worth, when I saw similar issues in rps-reputation it was something reproducible in 3.4, but not in 3.5.

@tonyandrewmeyer
Copy link
Contributor

Assuming #58 fixes this (I verified that local bit of the code, but haven't checked if there are others).

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

No branches or pull requests

3 participants