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

Error moving completed download #245

Closed
lrusak opened this issue Jul 16, 2015 · 5 comments
Closed

Error moving completed download #245

lrusak opened this issue Jul 16, 2015 · 5 comments

Comments

@lrusak
Copy link

lrusak commented Jul 16, 2015

Whenever a download finishes they seem to randomly fail and the download disappears from all folders.
This occurs when using the develop branch.

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/local/usenet/sabnzbd/sabnzbd/sabnzbd/assembler.py", line 85, in run
    filepath = get_filepath(long_path(cfg.download_dir.get_path()), nzo, filename)
  File "/usr/local/usenet/sabnzbd/sabnzbd/sabnzbd/decorators.py", line 31, in newFunction
    return f(*args, **kw)
  File "/usr/local/usenet/sabnzbd/sabnzbd/sabnzbd/misc.py", line 876, in get_filepath
    if os.path.exists(fullPath):
  File "/usr/local/lib/python2.7/genericpath.py", line 18, in exists
    os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 113: ordinal not in range(128)

My OS

FreeBSD software 9.3-RELEASE-p13 FreeBSD 9.3-RELEASE-p13 

Python Version

Python 2.7.9 (default, Apr 16 2015, 21:44:36) [GCC 4.2.1 20070831 patched [FreeBSD]] on freebsd9
@shypike
Copy link
Member

shypike commented Jul 16, 2015

I suspect that you have a file system that supports only 8bit ASCII in file names.
Is this true?
The u'u\2013' character is the "long dash", which is not represented in any of the 8bit ASCII tables.

It could also be a bug in the Python library, because the os.path.exists() function should be able to handle Unicode.

@shypike
Copy link
Member

shypike commented Jul 16, 2015

Which version of SABnzbd are you using?
0.7.x does not support Unicode, only the still-in-Alpha 0.8.0 does.

@lrusak
Copy link
Author

lrusak commented Jul 16, 2015

I am using the develop branch so 0.8.x
This is running on a zfs filesystem, so I'm not sure what it supports.

@shypike
Copy link
Member

shypike commented Jul 16, 2015

It's important that Python knows how the file system is set up.
Read this for some more info: https://stackoverflow.com/questions/2076708/python-os-stat-and-unicode-file-names
Especially the first answer is important.

@lrusak
Copy link
Author

lrusak commented Jul 16, 2015

Thanks for the hints, I got it working now

root@enterprise /$ locale                                                                                                                                                                                         
LANG=
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=en_US.UTF-8

@lrusak lrusak closed this as completed Jul 16, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants