snowby666 / poe-api-wrapper

👾 A Python API wrapper for Poe.com. With this, you will have free access to GPT-4, Claude, Llama, Gemini, Mistral and more! 🚀
https://pypi.org/project/poe-api-wrapper/
GNU General Public License v3.0
677 stars 81 forks source link

ValueError: I/O operation on closed file problem. #153

Closed ohggbear closed 2 weeks ago

ohggbear commented 1 month ago

There was a problem when uploading the file attachment through the API. I can read the file normally using the URL, but if I use a local file, I encounter a "ValueError: I/O operation on closed file" problem.

sunnysktsang commented 1 month ago

Hello @ohggbear,

It sounds like you are encountering an issue that was recently addressed in the repository. This issue typically occurs when file streams are not properly managed, leading to attempts to operate on a file that has been prematurely closed.

I recommend checking out the pull request where this issue was fixed. It might provide you with the solution you need. Here’s the link to the pull request for your reference: [#149 Fix issue with file handling in generate_file function]

Please ensure that your local copy of the repository is updated with this fix. You can update your repository by pulling the latest changes: git checkout main git pull origin main

If the issue persists after ensuring the updates are incorporated, please double-check your file handling code to ensure it aligns with the best practices shown in the pull request. If there are still problems, feel free to share more details here, and I’d be happy to take another look.

Best regards, Sunny

snowby666 commented 2 weeks ago

Closing since the PR is merged