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

/lib/feedparser/sgmllib3.py contains invalid syntax #343

Open
xpunkt opened this issue Feb 7, 2014 · 10 comments
Open

/lib/feedparser/sgmllib3.py contains invalid syntax #343

xpunkt opened this issue Feb 7, 2014 · 10 comments

Comments

@xpunkt
Copy link

xpunkt commented Feb 7, 2014

Compiling /usr/share/maraschino/lib/feedparser/sgmllib3.py ...
File "/usr/share/maraschino/lib/feedparser/sgmllib3.py", line 484
print('start tag: <' + tag, end=' ')
^
SyntaxError: invalid syntax

@gugahoi
Copy link
Collaborator

gugahoi commented Feb 9, 2014

Any details on the system?! There is no need to compile anything...

@xpunkt
Copy link
Author

xpunkt commented Feb 9, 2014

doing it later only shows problems later

@gugahoi
Copy link
Collaborator

gugahoi commented Feb 10, 2014

If you cannot post details about your setup I cannot help you. What python version are you using? What OS?

@soehest
Copy link

soehest commented Aug 29, 2014

I am continuing this as i am having the same problem. Tested using Gentoo Linux And Ubuntu Linux. Versions of python tried. 2.7.6 2.7.7. 2.7.8. It is easy to recreate. Just issue command "python2 sgmllib3.py" will output:

File "sgmllib3.py", line 484
print('start tag: <' + tag, end=' '),
^
SyntaxError: invalid syntax

Having dug a bit deeper (I am not python expert) I can see that the supplied sgmllib.py which i have in /usr/lib64/python2.7/sgmllib.py does not use the same code around line 484. Is the included (in marachino) version by any chance for python3 as it does run fine with the same command using python 3.x?

@gugahoi
Copy link
Collaborator

gugahoi commented Aug 30, 2014

Nope, it is definitely for python 2.6+ maybe even 2+. I have personally never touched python 3 so I have no idea what the changes are. How are you running maraschino?

I have run it successfully and easily on Ubuntu several times so I am pretty sure the default python version that comes with it works out of the box.

@soehest
Copy link

soehest commented Aug 30, 2014

This has nothing to do with how maraschino is run. I could very well imagine that it is running nicely. It is just the SyntaxError message when one tries to run sgmllib3.py. Could you please try if you can run it manually without syntax error?

@gugahoi
Copy link
Collaborator

gugahoi commented Aug 30, 2014

Unsure of what you want me to run and why. Please clarify.

@N3MIS15
Copy link
Collaborator

N3MIS15 commented Aug 30, 2014

I could only see this being a problem when compiling an exe. It looks like the file is not being used by the lib anyways and could be removed. (untested tho)

@soehest
Copy link

soehest commented Aug 30, 2014

@gugahoi I would like you to navigate to maraschino/lib/feedparser and issue command "python2 sgmllib3.py" Reason is to verify/deverify that the command has issues. At least when running sgmllib directly. According to documentation (for sgmllib) it can be run in manual mode. I am not saying in any way that there is a issue with maraschino itself. As said previously i am no python coder so it is out of my scope to see what sgmllib actually is used for. I am just curious to why it will not run directly when the version supplied with 2.7 actually does. If bored there is a thread here about the issue: http://stackoverflow.com/questions/2456148/python-print-end.

That thread makes me think that the included sgmllib3.py is for python3 and not python2 as print('start tag: <' + tag, end=' ') is apparently not compatible with python 2.x.

@N3MIS15 I may just try that. I could also create a diff changing the lines around 484 back according to the sgmllib.py included with python 2.x which does run manual. But have no clue if anything will explode.

@gugahoi
Copy link
Collaborator

gugahoi commented Aug 30, 2014

Oh ok, I see what you mean. That kind of print statement is definitely not compatible with python 2 and I do get an error when trying to run it.

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

4 participants