python yahoo weather xml parse works with 2.7.1 but not 2.6.1
<pre><code>#!/usr/bin/env python

import subprocess
import urllib
from xml.dom import minidom

CITY_ID = '23396898'
TEMP_TYPE = 'c'

WEATHER_URL = 'http://xml.weather.yahoo.com/forecastrss?w=' + CITY_ID +' &amp;u=' + TEMP_TYPE
WEATHER_NS = 'http://xml.weather.yahoo.com/ns/rss/1.0'

dom = minidom.parse(urllib.urlopen(WEATHER_URL))
ycondition = dom.getElementsByTagNameNS(WEATHER_NS, 'condition')[0]
CURRENT_OUTDOOR_TEMP = ycondition.getAttribute('temp')
print(CURRENT_OUTDOOR_TEMP)
</code></pre>

<p>This works fine when I run it on a machine running python 2.7.1 but not on a machine running 2.6.1. The problem is the actual number is wrong. I have verified I'm pulling the elements correctly and can get other numeric values without issue. But I run this on 2.7.1 and get 12 as the current celsius temp but run this in 2.6.1 and get 54. </p>

<p>What has me even more confused is it works fine with fahrenheit in both environments. If you put f for TEMP_TYPE it will work fine.  I've confirmed it happens on multiple machines. However they are identical deployments so the issue could be something other than 2.6.1. Can anyone give me any ideas why I'm getting this issue?</p>

<p>Running on Mac OS X in both instances.</p>

<p>edit: problem is with  urllib.urlopen() not working correctly in 2.6 not sure why.</p>

<p>edit:</p>

<p>I've also run this with elementtree with the same results. It appears it may be something specific to this environment but why would it convert it back to fahrenheit. Odd.</p>

<pre><code>import urllib
from xml.etree.ElementTree import parse

CITY_ID = '23396898'
TEMP_TYPE = 'c'

WEATHER_URL = 'http://xml.weather.yahoo.com/forecastrss?w=' + CITY_ID +' &amp;u=' + TEMP_TYPE
WEATHER_NS = 'http://xml.weather.yahoo.com/ns/rss/1.0'

rss = parse(urllib.urlopen(WEATHER_URL)).getroot()
ycondition = rss.find('channel/item/{%s}condition' % WEATHER_NS)
print ycondition.get('temp')
</code></pre>

<p>if you go directly to the url you can see the information directly.</p>

<p><a href="http://xml.weather.yahoo.com/forecastrss?w=2496543&amp;u=f" rel="nofollow">http://xml.weather.yahoo.com/forecastrss?w=2496543&amp;u=f</a>
<a href="http://xml.weather.yahoo.com/forecastrss?w=2496543&amp;u=c" rel="nofollow">http://xml.weather.yahoo.com/forecastrss?w=2496543&amp;u=c</a></p>
