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

Fix calling issue with open-uri #80

Merged
merged 1 commit into from
Apr 8, 2021
Merged

Conversation

towo
Copy link
Member

@towo towo commented Feb 9, 2021

Following the deprecation of using Kernel#open directly, open-uri started issuing a warning to not use open without being called with the appropriate wrappers.

This apparently interfers with the monkey-patched Librarian::Puppet::Logger#warn method by passing two arguments:

warn('calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open', uplevel: 1)
[...]
1: from /home/twolter/.gem/ruby/2.7.0/gems/librarian-puppet-3.0.0/lib/librarian/puppet/util.rb:15:in `warn'
/opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/librarianp-1.0.0/lib/librarian/logger.rb:15:in `warn': wrong number of arguments (given 2, expected 0..1) (ArgumentError)

With this PR, open has been replaced by URI.open, which works perfectly.

Following the deprecation of using `Kernel#open` directly, `open-uri`
started issuing a warning to not use `open` without being called with
the appropriate wrappers.

This apparently interfers with the monkey-patched
`Librarian::Puppet::Logger#warn` method by passing two arguments:

```
warn('calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open', uplevel: 1)
[...]
1: from /home/twolter/.gem/ruby/2.7.0/gems/librarian-puppet-3.0.0/lib/librarian/puppet/util.rb:15:in `warn'
/opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/librarianp-1.0.0/lib/librarian/logger.rb:15:in `warn': wrong number of arguments (given 2, expected 0..1) (ArgumentError)
```

With this commit, `open` has been replaced by `URI.open` which works
perfectly.
@bastelfreak bastelfreak added the bug label Apr 8, 2021
@bastelfreak bastelfreak merged commit 8abe51b into voxpupuli:master Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants