moskytw / mosql

Build SQL with native Python data structure smoothly.
http://mosql.mosky.tw
MIT License
140 stars 17 forks source link

0.9.1 does not work on Python 3 #37

Closed uranusjr closed 9 years ago

uranusjr commented 10 years ago

0.9

>>> from mosql.query import select
>>> print(select('foo'))
SELECT * FROM "foo"

0.9.1

>>> from mosql.query import select
>>> select('foo')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.4/site-packages/mosql/util.py", line 830, in __call__
    return self.stringify(*positional_values, **clause_args)
  File "/usr/lib/python3.4/site-packages/mosql/util.py", line 826, in stringify
    return self.format(clause_args)
  File "/usr/lib/python3.4/site-packages/mosql/util.py", line 812, in format
    return self.statement.format(clause_args)
  File "/usr/lib/python3.4/site-packages/mosql/util.py", line 763, in format
    pieces.append(clause.format(arg))
  File "/usr/lib/python3.4/site-packages/mosql/util.py", line 690, in format
    x = formatter(x)
  File "/usr/lib/python3.4/site-packages/mosql/util.py", line 209, in qualifier_wrapper
    return f(x)
  File "/usr/lib/python3.4/site-packages/mosql/util.py", line 321, in identifier
    elif s.find('.') == -1 and s.find(' ') == -1:
TypeError: Type str doesn't support the buffer API

Haven’t had time to look into it, but basically everything is failing because of the same error.

uranusjr commented 9 years ago

See #40.