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

Work in Progress: Python 3 support. #32

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

dadosch
Copy link

@dadosch dadosch commented Sep 17, 2019

currently it fails, because with Python3 the way strings and bytes are handelt changed:

(maybe this is an issue with py-leveldb?)

2019-09-17 22:40:59,129 INFO pyGI.geigerlog: Fetching None log entries from 1568752859 to 1568756459
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/usr/lib/python3/dist-packages/bottle.py", line 1740, in wrapper
    rv = callback(*a, **ka)
  File "/home/pi/PiGI/software/pyGI/geigerserver.py", line 59, in handle_ws
    client.receive_commands(clients_handler)
  File "/home/pi/PiGI/software/pyGI/geigerclient.py", line 66, in receive_commands
    handler.send_log(self,age=age_seconds,amount=None)
  File "/home/pi/PiGI/software/pyGI/geigerclient.py", line 152, in send_log
    history = self.geigerlog.get_log_entries(start=start,end=end,age=age,amount=amount)
  File "/home/pi/PiGI/software/pyGI/geigerlog.py", line 187, in get_log_entries
    return self.get_log_entries_all(start,end)
  File "/home/pi/PiGI/software/pyGI/geigerlog.py", line 115, in get_log_entries_all
    entries_list = list(self.db.RangeIter(key_from=str(start),fill_cache=True))
TypeError: a bytes-like object is required, not 'str'

@chron0
Copy link
Member

chron0 commented Sep 17, 2019

not sure, haven't run it on 3 yet, so no shareable prior porting experience to offer :/

@dadosch
Copy link
Author

dadosch commented Sep 18, 2019

This commit makes the webui work, everythings seems to work fine, except saving the configuration

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/usr/lib/python3/dist-packages/bottle.py", line 1740, in wrapper
    rv = callback(*a, **ka)
  File "/home/pi/PiGI/software/pyGI/geigerserver.py", line 59, in handle_ws
    client.receive_commands(clients_handler)
  File "/home/pi/PiGI/software/pyGI/geigerclient.py", line 107, in receive_commands
    cfg.set('node',field,val)
  File "/home/pi/PiGI/software/pyGI/configurator.py", line 100, in set
    self.dynamic_conf.set(section,option,value)
  File "/usr/lib/python3.7/configparser.py", line 1197, in set
    self._validate_value_types(option=option, value=value)
  File "/usr/lib/python3.7/configparser.py", line 1182, in _validate_value_types
    raise TypeError("option values must be strings")
TypeError: option values must be strings

@dadosch
Copy link
Author

dadosch commented Sep 18, 2019

Now everything should work. @chron0 could you test?

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

Successfully merging this pull request may close these issues.

2 participants