Dropzone app thumbnail error in web2py appliances

65 views
Skip to first unread message

dirman

unread,
Oct 2, 2019, 6:15:37 AM10/2/19
to web2py-users

<type 'exceptions.UnicodeDecodeError'> 'utf8' codec can't decode byte 0xb7 in position 0: invalid start byte


Getting the above error as thumbnails are not showing. what could be the issue?

dirman

unread,
Oct 5, 2019, 12:41:47 PM10/5/19
to web2py-users
i really need help on this

Dave S

unread,
Oct 7, 2019, 3:11:52 AM10/7/19
to web2py-users
Can you show the complete stack trace?  We may also need to see your controller function.

/dps
 
?
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

dirman

unread,
Oct 7, 2019, 9:29:38 AM10/7/19
to web2py-users

dirman

unread,
Oct 7, 2019, 9:32:49 AM10/7/19
to web2py-users

dirman

unread,
Oct 7, 2019, 4:43:09 PM10/7/19
to web2py-users

<type 'exceptions.UnicodeDecodeError'> 'utf8' codec can't decode byte 0xa0 in position 0: invalid start byte

Version

web2py™Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
PythonPython 2.7.12: /usr/local/bin/uwsgi (prefix: /usr)

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
Traceback (most recent call last):
File "/home/www-data/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
File "/home/www-data/web2py/applications/g/controllers/default.py", line 68, in <module>
File "/home/www-data/web2py/gluon/globals.py", line 421, in <lambda>
self._caller = lambda f: f()
File "/home/www-data/web2py/gluon/cache.py", line 644, in wrapped_f
rtn = func()
File "/home/www-data/web2py/applications/g/controllers/default.py", line 64, in download
return response.download(request, db)
File "/home/www-data/web2py/gluon/globals.py", line 673, in download
(filename, stream) = field.retrieve(name, nameonly=True)
File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 1918, in retrieve
file_properties = self.retrieve_file_properties(name, path)
File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 1949, in retrieve_file_properties
filename = base64.b16decode(m.group('name'), True).decode('utf-8')
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xa0 in position 0: invalid start byte

Error snapshot help

<type 'exceptions.UnicodeDecodeError'>('utf8' codec can't decode byte 0xa0 in position 0: invalid start byte)

inspect attributes

Frames

  • File /home/www-data/web2py/gluon/restricted.py in restricted at line 219 code arguments variables

  • File /home/www-data/web2py/applications/g/controllers/default.py in <module> at line 68 code arguments variables

  • File /home/www-data/web2py/gluon/globals.py in <lambda> at line 421 code arguments variables

  • File /home/www-data/web2py/gluon/cache.py in wrapped_f at line 644 code arguments variables

  • File /home/www-data/web2py/applications/g/controllers/default.py in download at line 64 code arguments variables

  • File /home/www-data/web2py/gluon/globals.py in download at line 673 code arguments variables

  • File /home/www-data/web2py/gluon/packages/dal/pydal/objects.py in retrieve at line 1918 code arguments variables

  • File /home/www-data/web2py/gluon/packages/dal/pydal/objects.py in retrieve_file_properties at line 1949 code arguments variables

  • File /usr/lib/python2.7/encodings/utf_8.py in decode at line 16 code arguments variables

    Function argument list

    (input='\xa0\x1b\x18>\x10\x85\xe1\x11', errors='strict')

    Code listing
    11.
    12.
    13.
    14.
    15.
    16.
    17.
    18.
    19.
    20.
    ### Codec APIs

    encode = codecs.utf_8_encode

    def decode(input, errors='strict'):
    return codecs.utf_8_decode(input, errors, True)

    class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
    return codecs.utf_8_encode(input, self.errors)[0]
    Variables
    input'\xa0\x1b\x18>\x10\x85\xe1\x11'
    builtinTrueTrue
    errors'strict'
    global codecs<module 'codecs' from '/usr/lib/python2.7/codecs.pyc'>
    codecs.utf_8_decode<built-in function utf_8_decode>

Context


On Wednesday, October 2, 2019 at 10:15:37 AM UTC, dirman wrote:

dirman

unread,
Oct 7, 2019, 4:43:53 PM10/7/19
to web2py-users

villas

unread,
Oct 9, 2019, 6:34:07 AM10/9/19
to web2py-users
Clearly you are mixing character sets somewhere.  This can happen when saving utf8 characters into a latin-1 database, for example (or vice versa).

Look for any unusual characters (with accents or symbols) in your app, data or even filenames. You can inadvertently introduce the problem by copying and pasting too.

This type of problem can be notoriously tricky to understand and track down. 

The easiest thing to do is avoid the issue by converting all data to unicode and simply using unicode everywhere! 

Reply all
Reply to author
Forward
0 new messages