what does xml.parsers.expat.ExpatError: not well-formed (invalid token): mean

There is a portion of my program that has to go on the internet and  grab data and I have it working fine and if there is no internet then I just Pass the exception... the problem comes in when the computer is connected to the internet but the computer cant access internet ie needs pass word or must log on.... I get the error below Ive tried to create an excpetion but it doesnt work... so is there another error that I should use to catch this or is there a module I should import ?

xml.parsers.expat.ExpatError: not well-formed (invalid token): line 6, column 75
File "c:\Python26\sign\April_1_version_Reg_Tracker_X.py", line 5969, in <module>
  InsertData(None, -1, 'SEMS Patient Reporting Software ver 0.0.6')
File "c:\Python26\sign\April_1_version_Reg_Tracker_X.py", line 43, in __init__
File "c:\Python26\sign\April_1_version_Reg_Tracker_X.py", line 409, in textentry
File "c:\Python26\sign\April_1_version_Reg_Tracker_X.py", line 433, in WeatherData
  google_result = pywapi.get_weather_from_google(self.city)
File "c:\Python26\sign\pywapi.py", line 52, in get_weather_from_google
  dom = minidom.parse(handler)
File "C:\Python26\Lib\xml\dom\minidom.py", line 1918, in parse
  return expatbuilder.parse(file)
File "C:\Python26\Lib\xml\dom\expatbuilder.py", line 928, in parse
  result = builder.parseFile(file)
File "C:\Python26\Lib\xml\dom\expatbuilder.py", line 207, in parseFile
  parser.Parse(buffer, 0)

Open in new window

this is the code Im using now
def WeatherData(self):
            google_result = pywapi.get_weather_from_google(self.city)
            self.weather1a =  str(google_result['current_conditions']['condition'])
        except IOError: 
	except ExpatError:

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Please clarify "connected to the internet but the computer cant access internet ie needs pass word or must log on"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dolamitejenkinsAuthor Commented:
Thanks I figured it out I was placing the code into the wrong module
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.