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

MAGIC FLV test condition gives false negative, get bytes test str #3

Closed
shithead opened this issue Nov 28, 2021 · 3 comments · Fixed by #4
Closed

MAGIC FLV test condition gives false negative, get bytes test str #3

shithead opened this issue Nov 28, 2021 · 3 comments · Fixed by #4
Assignees
Labels
bug Something isn't working

Comments

@shithead
Copy link

shithead commented Nov 28, 2021

In file flv.py line 57-62

magic, version, flags, offset = struct.unpack(
    '!3sBBI', self.fp.read(9))
if self._debug:
    print('FLV.open() hdr=', magic, version, flags, offset)
if magic != 'FLV':
 raise ValueError('This is not a FLV file')

magic contains bytes see https://docs.python.org/3/library/struct.html#format-characters but in line 61 is test on 'FLV' string.

output from line 60: FLV.open() hdr= b'FLV' 1 5 9

@KnugiHK KnugiHK added the bug Something isn't working label Nov 28, 2021
@KnugiHK
Copy link
Owner

KnugiHK commented Nov 28, 2021

I probably missed this piece of code when I converting the project from Python 2 to Python 3. Thanks for your report!

@KnugiHK KnugiHK linked a pull request Nov 28, 2021 that will close this issue
@KnugiHK
Copy link
Owner

KnugiHK commented Nov 28, 2021

I will leave this open until a new release is made.

@KnugiHK KnugiHK self-assigned this Nov 28, 2021
@KnugiHK KnugiHK changed the title MAGIC FLV test condition gives false negativ, get bytes test str MAGIC FLV test condition gives false negative, get bytes test str Nov 28, 2021
@KnugiHK
Copy link
Owner

KnugiHK commented Dec 2, 2021

Released in 0.4.0. I am closing this issue.

@KnugiHK KnugiHK closed this as completed Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants