Bugs: Browse | Submit New | Admin

[#5067] open-uri fails under multithreading

Date:
2006-07-15 00:11
Priority:
3
Submitted By:
Olathe (olathe)
Assigned To:
Nobuyoshi Nakada (nobu)
Category:
Misc / Other Standard Library
State:
Closed
Platform:
 
Summary:
open-uri fails under multithreading

Detailed description
The following code gives .../lib/ruby/1.8/open-uri.rb:215:in `open_http': uninitialized constant Net::HTTP (NameError)
:

require 'open-uri'
a = Thread.new { open('http://www.google.com/') }
b = Thread.new { open('http://www.google.com/') }
a.join
b.join

Strangely enough, adding require 'net/http' to the top makes it work just fine, though I assume require 'open-uri' is
supposed to do that automatically.  open-uri seems to work fine other than that.

I am using ruby 1.8.4 (2006-04-14) [i386-mswin32] from the one-click installer.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2006-07-18 21:55
Sender: Tom Copeland

This led to a change in CVS, thank you!

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/8236

Yours,

Tom

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
status_idOpen2006-07-18 21:55tom
assigned_tonone2006-07-18 21:55tom
close_date2006-07-18 21:552006-07-18 21:55tom