hrishikeshrt / PyCDSL

Python Interface to Cologne Digital Sanskrit Lexicon (CDSL)
https://pypi.org/project/PyCDSL/
Other
12 stars 1 forks source link

re.Match error #3

Closed drdhaval2785 closed 2 years ago

drdhaval2785 commented 2 years ago

Description

I tried to run the example given in the docs.

What I Did

>>> results = CDSL.MW.search("राम")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dhaval/.local/lib/python3.6/site-packages/pycdsl/pycdsl.py", line 281, in search
    for result in search_query
  File "/home/dhaval/.local/lib/python3.6/site-packages/peewee.py", line 6923, in __iter__
    self.execute()
  File "/home/dhaval/.local/lib/python3.6/site-packages/peewee.py", line 1911, in inner
    return method(self, database, *args, **kwargs)
  File "/home/dhaval/.local/lib/python3.6/site-packages/peewee.py", line 1982, in execute
    return self._execute(database)
  File "/home/dhaval/.local/lib/python3.6/site-packages/peewee.py", line 2155, in _execute
    cursor = database.execute(self)
  File "/home/dhaval/.local/lib/python3.6/site-packages/peewee.py", line 3172, in execute
    sql, params = ctx.sql(query).query()
  File "/home/dhaval/.local/lib/python3.6/site-packages/peewee.py", line 614, in sql
    return obj.__sql__(self)
  File "/home/dhaval/.local/lib/python3.6/site-packages/peewee.py", line 2424, in __sql__
    ctx.literal(' WHERE ').sql(self._where)
  File "/home/dhaval/.local/lib/python3.6/site-packages/peewee.py", line 614, in sql
    return obj.__sql__(self)
  File "/home/dhaval/.local/lib/python3.6/site-packages/peewee.py", line 1483, in __sql__
    .sql(self.rhs))
  File "/home/dhaval/.local/lib/python3.6/site-packages/peewee.py", line 618, in sql
    return self.sql(Value(obj))
  File "/home/dhaval/.local/lib/python3.6/site-packages/peewee.py", line 614, in sql
    return obj.__sql__(self)
  File "/home/dhaval/.local/lib/python3.6/site-packages/peewee.py", line 1383, in __sql__
    return ctx.value(self.value, self.converter)
  File "/home/dhaval/.local/lib/python3.6/site-packages/peewee.py", line 630, in value
    value = self.state.converter(value)
  File "/home/dhaval/.local/lib/python3.6/site-packages/pycdsl/models.py", line 63, in db_value
    return to_internal(value)
  File "/home/dhaval/.local/lib/python3.6/site-packages/pycdsl/models.py", line 36, in to_internal
    if isinstance(matchobj_or_str, re.Match):
AttributeError: module 're' has no attribute 'Match'
hrishikeshrt commented 2 years ago

Package requires Python >= 3.7

drdhaval2785 commented 2 years ago

Any chances of reducing python version requirements?

hrishikeshrt commented 2 years ago

There are certain improvements to re and cmd modules in 3.7 which might make it hard. I will try, however.

drdhaval2785 commented 2 years ago

If it is non-trivial, please do not try extra. I will update my python.

hrishikeshrt commented 2 years ago

The piece of code that used re.Match no longer exists since 428d6a00f704817af301ed49fe85346a25be08d6 I didn't encounter this error in 3.6.13. Thus, I am closing this. Please let me know if you still encounter the error.