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

Bug in filexfer example: filename should be fp? #1083

Closed
angererc opened this issue Apr 12, 2024 · 0 comments
Closed

Bug in filexfer example: filename should be fp? #1083

angererc opened this issue Apr 12, 2024 · 0 comments

Comments

@angererc
Copy link

I must admit I didn't try to run the code. Just random stranger on the internet who was reading the example. It appears to me that the 'filename' parameter in run_answer on line 34 should be 'fp'. A) because main() passes the file pointer, not the name, and B) because fp is referenced on line 48, which without having tried it myself I assume will cause an exception.

https://github.com/aiortc/aiortc/blob/e9c13eab915ddc27f365356ed9ded0585b9a1bb7/examples/datachannel-filexfer/filexfer.py#L34C37-L34C45

jlaine added a commit to jlaine/aiortc that referenced this issue May 21, 2024
The example "worked" due to a global variable, but this was not the
desired code.

Thanks to @angererc for spotting this!
@jlaine jlaine closed this as completed in 46e8c24 May 21, 2024
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