sjeltoff / python-weather-api

Automatically exported from code.google.com/p/python-weather-api
0 stars 0 forks source link

XML and charsets #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Script:

{{import pywapi
import pprint
pp = pprint.PrettyPrinter(indent=4)

result = pywapi.get_weather_from_google('10001', 'zh-cn')
pp.pprint(result)
}}

Result: 

{{
[04:54:33][root@li51-150:/home/qetzal/python/python-weather-api]# python 
pywapi-google-example.py
Traceback (most recent call last):
  File "pywapi-google-example.py", line 5, in <module>
    result = pywapi.get_weather_from_google('10001', 'zh-cn')
  File "/home/qetzal/python/python-weather-api/pywapi.py", line 52, in 
get_weather_from_google
    dom = minidom.parse(handler)
  File "/usr/local/lib/python2.6/xml/dom/minidom.py", line 1918, in parse
    return expatbuilder.parse(file)
  File "/usr/local/lib/python2.6/xml/dom/expatbuilder.py", line 928, in 
parse
    result = builder.parseFile(file)
  File "/usr/local/lib/python2.6/xml/dom/expatbuilder.py", line 207, in 
parseFile
    parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, 
column 428
}}

Original issue reported on code.google.com by qet...@gmail.com on 10 Aug 2009 at 8:56

GoogleCodeExporter commented 8 years ago
http://world.yo2.cn/2009/07/01/all-about-weather-api/comment-page-1/#comment-275
358

Original comment by qet...@gmail.com on 10 Aug 2009 at 9:33

GoogleCodeExporter commented 8 years ago
Fixed in r87: http://code.google.com/p/python-weather-api/source/detail?r=87

Original comment by qet...@gmail.com on 10 Aug 2009 at 10:21

GoogleCodeExporter commented 8 years ago
great!
:)

Original comment by shinysky...@gmail.com on 10 Aug 2009 at 1:44