WojciechMula / pyahocorasick

Python module (C extension and plain python) implementing Aho-Corasick algorithm
BSD 3-Clause "New" or "Revised" License
948 stars 125 forks source link

Why printf("Parsed count %zu\n", count); [Automaton.c;121] #77

Closed gygabyte017 closed 6 years ago

gygabyte017 commented 6 years ago

Why is there this printf:

printf("Parsed count %zu\n", count);

in Automaton.c at row 121?

It is very annoying, every time I reload an automaton stored with pickle it displays this "Parsed count" in stdout.

woakesd commented 6 years ago

Guilty.

I put this in to fix an issue with loading pickles automatons in windows. The print alone fixes the problem (I don’t remember the exact problem).

Since I have experienced another issue also reported by others and taken to saving my data in a dict and creating the automaton from this.

WojciechMula commented 6 years ago

Sorry for this, fixed. I'll release a new version within a minutes.

WojciechMula commented 6 years ago

@pombredanne Would you help, please? Why we have 1.1.7.dev1 in setup.py, while the latest tag was 1.1.6? I haven't released recently and it seems I've messed something.

pombredanne commented 6 years ago

@WojciechMula After tagging 1.1.6 I bumped the release in https://github.com/WojciechMula/pyahocorasick/commit/58c8520345c68b1457044e6747e50cc24f72aea8 such that working from master would not collide with the actual tagged release. This is something I routinely do to make sure there is no confusion about the latest and greatest vs. a release

pombredanne commented 6 years ago

We/I could push a new 1.1.7 if you like? But then according to the principle above and after tagging 1.1.7, I would also commit a post-release bump to 1.1.8.dev in setup.py? I hope this makes sense for you!

WojciechMula commented 6 years ago

@pombredanne Sounds great, thank you for the explanation. Apparently I forgot about this rule. I've already pushed 1.1.7 tag and released the module pypi, will try to sort it out shortly.

WojciechMula commented 6 years ago

@gygabyte017 I hope everything is correct now. Could you please check the version 1.1.7? @woakesd It's my fault - I should have spotted it during code review.

pombredanne commented 6 years ago

@WojciechMula you did everything right :) You may just want to bump master to 1.1.8.dev1 since you made a release... This is just a small convenience but helps when sorting out bug reports to distinguish master code from a tag.

WojciechMula commented 6 years ago

@pombredanne Thank you :) I set 1.1.8.dev1 in setup.py, what else have I do?

pombredanne commented 6 years ago

you are all set! :+1:

gygabyte017 commented 6 years ago

I confirm it works as expected. Thank you a lot for your work!