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

Editing and viewing battles #57

Open
Despu opened this issue Sep 13, 2015 · 1 comment
Open

Editing and viewing battles #57

Despu opened this issue Sep 13, 2015 · 1 comment

Comments

@Despu
Copy link

Despu commented Sep 13, 2015

I had following error message when either looked uploaded battle or edited it:
2015-09-13 21:28:14,518 ERROR: Exception on /battles/6698 [GET]
Traceback (most recent call last):
File "/var/www/clanwars/myenv/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/var/www/clanwars/myenv/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/var/www/clanwars/myenv/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/var/www/clanwars/myenv/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/var/www/clanwars/myenv/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "/var/www/clanwars/whyattend/webapp.py", line 152, in decorated_function
return f(_args, *_kwargs)
File "/var/www/clanwars/whyattend/webapp.py", line 1048, in battle_details
return render_template('battles/battle.html', battle=battle, replays=replays)
File "/var/www/clanwars/myenv/lib/python2.7/site-packages/flask/templating.py", line 128, in render_template
context, ctx.app)
File "/var/www/clanwars/myenv/lib/python2.7/site-packages/flask/templating.py", line 110, in _render
rv = template.render(context)
File "/var/www/clanwars/myenv/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
return self.environment.handle_exception(exc_info, True)
File "/var/www/clanwars/myenv/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "/var/www/clanwars/whyattend/templates/battles/battle.html", line 1, in top-level template code
{% extends "layout.html" %}
File "/var/www/clanwars/whyattend/templates/layout.html", line 163, in top-level template code
{% block content %}{% endblock %}
File "/var/www/clanwars/whyattend/templates/battles/battle.html", line 128, in block "content"
{% if battle.replay.unpickle() %}
File "/var/www/clanwars/whyattend/model.py", line 266, in unpickle
try:
File "/usr/lib/python2.7/pickle.py", line 1382, in loads
return Unpickler(file).load()
File "/usr/lib/python2.7/pickle.py", line 858, in load
dispatchkey
File "/usr/lib/python2.7/pickle.py", line 880, in load_eof
raise EOFError
EOFError

I changed original code from model.py (around line 265-266):
def unpickle(self):
return pickle.loads(self.replay_pickle)

to following code (which probably is probably my old version crash fixes):
def unpickle(self):
try:
return pickle.loads(self.replay_pickle)
except EOFError:
return None
except ValueError:
return None
else:
return None

Which doesnt give any errors anymore but then you wont get any information from replays.

Are this part broken or is just my version?

@Despu
Copy link
Author

Despu commented Sep 13, 2015

Actually replays before 3.9. works. I assume this is version 9.10 issue.

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

1 participant