bugXMPP4R - Bugs: bug #18456, Ruby 1.9 incompatability in...

 
 
Show feedback again

bug #18456: Ruby 1.9 incompatability in client.rb, use of $defout

Submitted by:  Jon Tara <jtara>
Submitted on:  Fri 05 Aug 2011 07:03:44 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 05 Aug 2011 07:03:44 PM UTC, original submission:

Ruby 1.9 removes (not just deprecates) the global variable $defout. There is a use of $defout in client.rb in auth_nonsasl:

$defout.flush

This flushes Ruby's default output stream.

Since $defout is undefined in Ruby 1.9x, the application will throw a NoMethodError, undefined method 'flush' for nil:NilClass.

It's not clear to me that this line is even necessary. I'm guessing it's there to flush the log, but since there's nothing like this anywhere else in XMPP4R... (I also searched for references to $>, $stdout, $stderr...)

Quick no-patch workaround is to simply define $defout in your application. I used:

$defout = $>

Not sure from the Ruby docs that this is quite equivalent, though.

Jon Tara <jtara>

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jtara (Submitted the item)
  • -unavailable- added by jtara
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 05 Aug 2011 07:03:44 PM UTCjtaraCarbon-Copy-=>Added jtara
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup