You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to serialize and then restore database, all I get when trying to call scan on restored database is hyperscan.InvalidError: error code -1. I'm using python module version 0.7.7 and python 3.11.9.
Here's sample code:
db=hyperscan.Database(mode=hyperscan.HS_MODE_BLOCK)
db.compile(
expressions=[b'bar']
)
defcallback(id, start, end, flags, context):
print(f"Matched {id} from {start} to {end}")
db.scan(b'foo bar baz', callback)
data=hyperscan.dumpb(db)
db2=hyperscan.loadb(data, hyperscan.HS_MODE_BLOCK)
db2.scan(b'foo bar baz', callback)
And results:
data = hyperscan.dumpb(db)
db2 = hyperscan.loadb(data, hyperscan.HS_MODE_BLOCK)
> db2.scan(b'foo bar baz', callback)
E hyperscan.InvalidError: error code -1
I also noticed in debugger that restored db has no scratch atribute set (it's None), but I'm not sure if this is the reason.
The text was updated successfully, but these errors were encountered:
yeah unless anyone has a different opinion i don't see a reason why the scratch couldn't be initialized during loadb similar to the db. could possibly even do it in python wrapper space, and make it optional so it can be turned off in the event you want to manually reserve scratch i'd imagine?
I was trying to serialize and then restore database, all I get when trying to call scan on restored database is
hyperscan.InvalidError: error code -1
. I'm using python module version 0.7.7 and python 3.11.9.Here's sample code:
And results:
I also noticed in debugger that restored
db
has noscratch
atribute set (it'sNone
), but I'm not sure if this is the reason.The text was updated successfully, but these errors were encountered: