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

Cannot remove WARNING: messages from output #96

Open
gozooit opened this issue Apr 13, 2021 · 1 comment
Open

Cannot remove WARNING: messages from output #96

gozooit opened this issue Apr 13, 2021 · 1 comment

Comments

@gozooit
Copy link

gozooit commented Apr 13, 2021

Hi,

I'm trying to list all the codebar data from large files, and I want a clean output. However, I keep getting WARNING: messages and I can't find a way to get rid of them. I saw this similar issue (29) but the resolution didn't work for me.

The warning messages I get (which I don't really understand to be honest) :

  • It seems that it's trying to read PDF417 eventhough I specified to read CODE128
WARNING: .\zbar\decoder\pdf417.c:89: <unknown>: Assertion "g[0] >= 0 && g[1] >= 0 && g[2] >= 0" failed.
	dir=1 sig=9d9b k=0 g0=217 g1=47d g2=ffffffff buf[0000]=
  • I have no clue about this error
WARNING: zbar\decoder\databar.c:1250: <unknown>: Assertion "seg->finder >= 0" failed.
	i=10 f=-1(000) part=1

The fixes I tried :

  • Removing warnings and redirecting stderr to null
import os
import sys
import warnings

warnings.filterwarnings('ignore')

f = open(os.devnull, 'w')
sys.stderr = f
  • Specifying the type of the barcode I'm trying to read

decoded_objects = decode(Image.open(tiff), symbols=[ZBarSymbol.CODE128])

None of them worked. Is there any way to have a clean output ? I'm running out of solutions..

@gozooit
Copy link
Author

gozooit commented Aug 10, 2022 via email

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