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

XML #24

Closed
gman2691 opened this issue Feb 7, 2017 · 14 comments
Closed

XML #24

gman2691 opened this issue Feb 7, 2017 · 14 comments
Labels

Comments

@gman2691
Copy link

gman2691 commented Feb 7, 2017

The examples of your program on GitHub have an XMLSyntax Error

@panzarino
Copy link
Owner

@gman2691 can you please provide a direct example of where this occurs

@gman2691
Copy link
Author

The teaser code that you posted to find all of the scores in the Mets games.

@panzarino
Copy link
Owner

@gman2691 I'm not getting any error, can you please post the error response you are getting?

@jimluke827
Copy link

I get this error lxml.etree.XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1

@jimluke827
Copy link

full copy:

Traceback (most recent call last):
File "C:/......../main.py", line 5, in
month = mlbgame.games(2015, 6, home="Mets")
File "C:........._init_.py", line 205, in games
game = day(i, y, x, home=home, away=away)
File "C:.........._init_.py", line 175, in day
data = mlbgame.game.scoreboard(year, month, day, home=home, away=away)
File "C:.................\game.py", line 17, in scoreboard
parsed = etree.parse(data)
File "src\lxml\lxml.etree.pyx", line 3427, in lxml.etree.parse (src\lxml\lxml.etree.c:81101)
File "src\lxml\parser.pxi", line 1811, in lxml.etree._parseDocument (src\lxml\lxml.etree.c:117832)
File "src\lxml\parser.pxi", line 1837, in lxml.etree._parseDocumentFromURL (src\lxml\lxml.etree.c:118179)
File "src\lxml\parser.pxi", line 1741, in lxml.etree._parseDocFromFile (src\lxml\lxml.etree.c:117091)
File "src\lxml\parser.pxi", line 1138, in lxml.etree._BaseParser._parseDocFromFile (src\lxml\lxml.etree.c:111637)
File "src\lxml\parser.pxi", line 595, in lxml.etree._ParserContext._handleParseResultDoc (src\lxml\lxml.etree.c:105093)
File "src\lxml\parser.pxi", line 706, in lxml.etree._handleParseResult (src\lxml\lxml.etree.c:106801)
File "src\lxml\parser.pxi", line 635, in lxml.etree._raiseParseError (src\lxml\lxml.etree.c:105655)
File "file:/C:/.................../scoreboard.xml.gz", line 1
lxml.etree.XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1

Process finished with exit code 1

@panzarino
Copy link
Owner

@jimluke827 I'm not getting that error at all, it could be an issue with lxml. Can you try updating both mlbgame and lxml to the latest version?

@jimluke827
Copy link

@zachpanz88 I am at the latest version of each.

@jimluke827
Copy link

@zachpanz88 I was using Python 3, I used python 2 and had a ton of trouble getting libxml2 to install, but once I got that all set everything is working

@gman2691 see above if you are using wrong version of python

@panzarino
Copy link
Owner

Again, I do not seem to get the error when I am testing with python 3.

File "file:/C:/.................../scoreboard.xml.gz", line 1

@jimluke827 Is there any way you could fill in part of that "......" so I can diagnose what day the information is coming from? I just need the "month_06/day_xx/" part.

Just to be clear, we are talking about this example, correct?

from __future__ import print_function
import mlbgame

month = mlbgame.games(2015, 6, home="Mets")
games = mlbgame.combine_games(month)
for game in games:
    print(game)

@jimluke827
Copy link

@zachpanz88 I don't have the error anymore, but I just used the exact examples that were shown in the readme, neither worked and both gave the same error.

@panzarino
Copy link
Owner

panzarino commented Feb 14, 2017

@jimluke827 I noticed from your error messages that you are using Windows. I have been testing everything on Linux, which handles .gz files much better than Windows. The problem could have arisen from Windows not being able to handle the compressed files, so I'll run some tests on Windows.

@rhoffer21
Copy link

Expanding on this, I also had the same issue. I believe it is related to the .gz compressed xml files in a windows environment. I was eventually able to remedy the issue by moving the archived gameday-data to a backup folder which forced the wrapper to make calls to the server instead of using the archived xml data.

I unfortunately don't have a better work around to offer at this time, other than moving the saved data.

@panzarino
Copy link
Owner

@rhoffer21 I will try to find a better compression format for windows (probably zip). I will also build a delete function into the update module that will allow you to remove all downloaded data.

@panzarino
Copy link
Owner

Released in 2.3.2.

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

No branches or pull requests

4 participants