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

Missing torrent files crashes the torrent feed #29

Open
hubx opened this issue Aug 29, 2013 · 0 comments
Open

Missing torrent files crashes the torrent feed #29

hubx opened this issue Aug 29, 2013 · 0 comments

Comments

@hubx
Copy link
Contributor

hubx commented Aug 29, 2013

If a torrent file is missing, the whole torrent cannot be created:

Traceback:
File "/opt/owntube-venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/opt/owntube-venv/local/lib/python2.7/site-packages/django/contrib/syndication/views.py" in __call__
  38.         feedgen = self.get_feed(obj, request)
File "/opt/owntube-venv/local/lib/python2.7/site-packages/django/contrib/syndication/views.py" in get_feed
  157.                     length = smart_unicode(self.__get_dynamic_attr('item_enclosure_length', item)),
File "/opt/owntube-venv/local/lib/python2.7/site-packages/django/contrib/syndication/views.py" in __get_dynamic_attr
  71.                 return attr(obj)
File "./videoportal/feeds.py" in item_enclosure_length
  129.      return os.path.getsize(settings.BITTORRENT_FILES_DIR + item.slug + '.torrent')
File "/opt/owntube-venv/lib/python2.7/genericpath.py" in getsize
  49.     return os.stat(filename).st_size

Exception Type: OSError at /feeds/latest/torrent/
Exception Value: [Errno 2] No such file or directory: '/opt/OwnTube/media/torrents/vosi-20130528.torrent'

Check if file exists before asking for its size and creating an entry for 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

1 participant