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

Log names can only container alphanumeric characters #77

Open
ranguli opened this issue Dec 11, 2022 · 0 comments
Open

Log names can only container alphanumeric characters #77

ranguli opened this issue Dec 11, 2022 · 0 comments

Comments

@ranguli
Copy link

ranguli commented Dec 11, 2022

Hello,

When I try to create a log group that contains any non-alphanumeric character (for example the log name special characters) I get the following error:

Traceback (most recent call last):
  File "/home/joshua/Downloads/pyqso-1.1.0/bin/../pyqso/logbook.py", line 151, in open
    self.summary.update()
  File "/home/joshua/Downloads/pyqso-1.1.0/bin/../pyqso/summary.py", line 232, in update
    self.items["QSO_COUNT"].set_label(str(self.logbook.record_count))
  File "/home/joshua/Downloads/pyqso-1.1.0/bin/../pyqso/logbook.py", line 1131, in record_count
    return sum([log.record_count for log in self.logs])
  File "/home/joshua/Downloads/pyqso-1.1.0/bin/../pyqso/logbook.py", line 1131, in <listcomp>
    return sum([log.record_count for log in self.logs])
  File "/home/joshua/Downloads/pyqso-1.1.0/bin/../pyqso/log.py", line 333, in record_count
    c.execute("SELECT Count(*) FROM %s" % self.name)
sqlite3.OperationalError: near "-": syntax error
ERROR:root:near "characters": syntax error
Traceback (most recent call last):
  File "/home/joshua/Downloads/pyqso-1.1.0/bin/../pyqso/logbook.py", line 279, in new_log
    c.execute(query)
sqlite3.OperationalError: near "characters": syntax error
ERROR:root:Database error. Try another log name.

I'm guessing this is because the log group name is passed verbatim into the SQL statement and that makes sqlite unhappy. Perhaps there is a way to get around this so that log names can contain spaces or other characters? Perhaps the log names can be stored in another table and accessed by some sort of identifier?

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

1 participant