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

AttributeError: 'Weather' object has no attribute 'dom' #1

Open
variablenix opened this issue Sep 27, 2015 · 1 comment
Open

AttributeError: 'Weather' object has no attribute 'dom' #1

variablenix opened this issue Sep 27, 2015 · 1 comment

Comments

@variablenix
Copy link

Running ctw USCA0987 or ctw --nometric USCA0987 (happens regardless of location) results in an attribute error with Python 3.4.3. Running ctw by itself does print a Welcome to "Curse the Weather" Version 0.6 message.

Traceback (most recent call last):
  File "/usr/bin/ctw", line 378, in 
    curses.wrapper(main)
  File "/usr/lib/python3.4/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/bin/ctw", line 283, in main
    update(stdscr)
  File "/usr/bin/ctw", line 250, in update
    weather = weatherfeed.Weather(location, metric)
  File "/usr/lib/python3.4/weatherfeed.py", line 40, in __init__
    self.dom = parseString(self._getData())
  File "/usr/lib/python3.4/xml/dom/minidom.py", line 1970, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python3.4/xml/dom/expatbuilder.py", line 925, in parseString
    return builder.parseString(string)
  File "/usr/lib/python3.4/xml/dom/expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 64, column 26
Exception ignored in: >
Traceback (most recent call last):
  File "/usr/lib/python3.4/weatherfeed.py", line 44, in __del__
    self.dom.unlink()
AttributeError: 'Weather' object has no attribute 'dom'

I did notice the API URL in weatherfeed.py gives a Bad Request error for:
urlHandle = urllib.request.urlopen('http://xoap.weather.com/weather/local/%s?cc=1&dayf=5&prod=xoap&link=xoap&unit=%s&par=1003666583&key=4128909340a9b2fc'

I also noticed weather.com redirects to wunderground.com so I registered a new API and updated the URL in weatherfeed.py only to still get the same AttributeError. The new API is something like http://api.wunderground.com/api/APIKEY/conditions/q/CA/San_Francisco.json

@qwelyt
Copy link

qwelyt commented Jan 18, 2016

I get the same error.
Here is some info about my system:

[~ %] ctw -d CAXX0343
Traceback (most recent call last):
  File "/usr/bin/ctw", line 378, in <module>
    curses.wrapper(main)
  File "/usr/lib/python3.5/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/bin/ctw", line 283, in main
    update(stdscr)
  File "/usr/bin/ctw", line 250, in update
    weather = weatherfeed.Weather(location, metric)
  File "/usr/lib/python3.5/weatherfeed.py", line 40, in __init__
    self.dom = parseString(self._getData())
  File "/usr/lib/python3.5/xml/dom/minidom.py", line 1968, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python3.5/xml/dom/expatbuilder.py", line 925, in parseString
    return builder.parseString(string)
  File "/usr/lib/python3.5/xml/dom/expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
xml.parsers.expat.ExpatError: undefined entity: line 43, column 49
Exception ignored in: <bound method Weather.__del__ of <weatherfeed.Weather object at 0x7f39eae2f3c8>>
Traceback (most recent call last):
  File "/usr/lib/python3.5/weatherfeed.py", line 44, in __del__
    self.dom.unlink()
AttributeError: 'Weather' object has no attribute 'dom'

[~ %] ctw --version
ctw version 0.6
weatherfeed.py backend version: 0.20

[~ %] python --version
Python 3.5.1

[~ %] uname -a
Linux work-work-work 4.3.3-2-ARCH #1 SMP PREEMPT Wed Dec 23 20:09:18 CET 2015 x86_64 GNU/Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants