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

no implicit conversion of Integer into String (TypeError) #107

Open
andrewngo opened this issue Dec 13, 2024 · 2 comments
Open

no implicit conversion of Integer into String (TypeError) #107

andrewngo opened this issue Dec 13, 2024 · 2 comments

Comments

@andrewngo
Copy link

andrewngo commented Dec 13, 2024

I don't have a repo without proprietary code yet but upgrading to 1.6.3 throws an error on my Windows machine.

debugging, it looks like dev.fileno is an integer and it doesn't seem to like that

puts dev.fileno
3

puts dev.fileno.class
Integer

> File.new(dev.fileno, mode: MODE, path: filename)
*** TypeError Exception: no implicit conversion of Integer into String
no implicit conversion of Integer into String (TypeError)
from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/logger-1.6.3/lib/logger/log_device.rb:99:in `fixup_mode'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/logger-1.6.3/lib/logger/log_device.rb:123:in `create_logfile'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/logger-1.6.3/lib/logger/log_device.rb:110:in `rescue in open_logfile'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/logger-1.6.3/lib/logger/log_device.rb:106:in `open_logfile'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/logger-1.6.3/lib/logger/log_device.rb:85:in `set_dev'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/logger-1.6.3/lib/logger/log_device.rb:19:in `initialize'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/logger-1.6.3/lib/logger.rb:593:in `new'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/logger-1.6.3/lib/logger.rb:593:in `initialize'
<my code>

ruby -v
ruby 3.2.3 (2024-01-18 revision 52bb2ac0a6) [x64-mingw-ucrt]

@Watson1978
Copy link

Watson1978 commented Dec 22, 2024

I have same problem.

Reproduce

require 'bundler/inline'
gemfile do
  source 'https://rubygems.org'
  # gem 'logger', '= 1.6.2'
  gem 'logger', '= 1.6.3'
end

require 'pathname'

path = Pathname.new('test.log')
logger = Logger.new(path)
PS C:\sandbox\ruby> ruby .\logger.rb
C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/logger-1.6.3/lib/logger/log_device.rb:99:in `initialize': no implicit conversion of Pathname into String (TypeError)

        dev = File.new(dev.fileno, mode: MODE, path: filename)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/logger-1.6.3/lib/logger/log_device.rb:99:in `new'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/logger-1.6.3/lib/logger/log_device.rb:99:in `fixup_mode'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/logger-1.6.3/lib/logger/log_device.rb:112:in `open_logfile'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/logger-1.6.3/lib/logger/log_device.rb:85:in `set_dev'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/logger-1.6.3/lib/logger/log_device.rb:19:in `initialize'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/logger-1.6.3/lib/logger.rb:593:in `new'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/logger-1.6.3/lib/logger.rb:593:in `initialize'
        from ./logger.rb:11:in `new'
        from ./logger.rb:11:in `<main>'

@Watson1978
Copy link

@nobu Can you look this issue ?

kenhys added a commit to kenhys/fluentd that referenced this issue Dec 26, 2024
Since logger 1.6.3 or later, there is a bug that it cause unexpected
exception (no implicit conversion of Integer into String (TypeError)) on windows.
So hold on 1.6.2 for a while.

See ruby/logger#107

Signed-off-by: Kentaro Hayashi <[email protected]>
kenhys added a commit to kenhys/fluentd that referenced this issue Dec 26, 2024
Since logger 1.6.3 or later, there is a bug that it cause unexpected
exception (no implicit conversion of Integer into String (TypeError)) on windows.
So hold on 1.6.2 for a while.

See ruby/logger#107

Signed-off-by: Kentaro Hayashi <[email protected]>
kenhys added a commit to kenhys/fluentd that referenced this issue Dec 26, 2024
Since logger 1.6.3 or later, there is a bug that it cause unexpected
exception (no implicit conversion of Integer into String (TypeError)) on windows.
So hold on 1.6.2 for a while.

See ruby/logger#107

Signed-off-by: Kentaro Hayashi <[email protected]>
kenhys added a commit to fluent/fluentd that referenced this issue Dec 26, 2024
**Which issue(s) this PR fixes**: 
Fixes #

**What this PR does / why we need it**: 

Since logger 1.6.3 or later, there is a bug that it cause unexpected
exception (no implicit conversion of Integer into String (TypeError)) on
windows. So hold on 1.6.2 for a while.

See ruby/logger#107

**Docs Changes**:

N/A

**Release Note**: 

N/A

Signed-off-by: Kentaro Hayashi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants