Skip to content

Conversation

@mrj
Copy link
Contributor

@mrj mrj commented Aug 23, 2025

Calling Account#upload_video on master with a file path string (no file:// URI scheme), I get a private method 'open' called for an instance of URI::Generic error that wasn't fixed by #438.

This PR changes

file = URI.parse(path_or_url).open

to

file = URI.open(path_or_url)

open automatically parses first when its argument is a string-with-scheme, and defers to Kernel#open for paths.

I'm testing on Ruby 3.4.5. But looking at the history of open-uri.rb, this call to open should work on even ancient Ruby versions.

@kangkyu
Copy link
Contributor

kangkyu commented Sep 15, 2025

According to your comment above, we need basically revert 746a1b3

I don't exactly remember but "open-uri" has been changed a bit. Your change works for any version of Ruby? @mrj

@kangkyu kangkyu self-requested a review September 15, 2025 17:35
@mrj
Copy link
Contributor Author

mrj commented Sep 15, 2025

The require 'open-uri' in 746a1b3 is definitely needed. But I wasn't aware that it also made the two changes from open to parse + open. These additional changes do break path URLs for me. I'll ask the committer about their motivation for those changes.

@kangkyu
Copy link
Contributor

kangkyu commented Sep 16, 2025

Thank you @mrj let me know if there's anything you want to add or change. I am going to merge if you are ok

@mrj
Copy link
Contributor Author

mrj commented Sep 16, 2025

Thanks Kang-Kyu. This PR only fixes upload_video not upload_thumbnall. I'll add that first.

@kangkyu kangkyu merged commit 04662a7 into nullscreen:master Sep 16, 2025
3 checks passed
@mrj
Copy link
Contributor Author

mrj commented Oct 7, 2025

Thanks for committing this. In #449 I've done the same with upload_thumbnail.

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

Successfully merging this pull request may close these issues.

2 participants