Last Comment Bug 781822 - UnicodeEncodeError: 'ascii' codec can't encode characters in position 104-108: ordinal not in range(128)
: UnicodeEncodeError: 'ascii' codec can't encode characters in position 104-108...
Status: RESOLVED FIXED
:
Product: Mozilla Developer Network
Classification: Other
Component: Editing (show other bugs)
: unspecified
: All All
: P2 normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-10 08:16 PDT by Luke Crouch [:groovecoder]
Modified: 2012-11-08 09:23 PST (History)
1 user (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Luke Crouch [:groovecoder] 2012-08-10 08:16:07 PDT
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/17.0 Firefox/17.0
Build ID: 20120809030541

Steps to reproduce:

Go to https://developer.mozilla.org/en-US/docs/Extensions/Bootcamp_tutorial


Actual results:

Traceback (most recent call last):

  File "/data/www/developer.mozilla.org/kuma/vendor/src/django/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/data/www/developer.mozilla.org/kuma/vendor/src/django-waffle/waffle/decorators.py", line 20, in _wrapped_view
    return view(request, *args, **kwargs)

  File "/data/www/developer.mozilla.org/kuma/vendor/src/django/django/views/decorators/http.py", line 37, in inner
    return func(request, *args, **kwargs)

  File "/data/www/developer.mozilla.org/kuma/apps/wiki/views.py", line 166, in process
    return func(request, *args, **kwargs)

  File "/data/www/developer.mozilla.org/kuma/vendor/src/django/django/views/decorators/http.py", line 124, in inner
    response = func(request, *args, **kwargs)

  File "/data/www/developer.mozilla.org/kuma/vendor/src/django/django/db/transaction.py", line 271, in _autocommit
    return func(*args, **kw)

  File "/data/www/developer.mozilla.org/kuma/apps/wiki/views.py", line 455, in document
    attachments = _format_attachment_obj(doc.attachments)

  File "/data/www/developer.mozilla.org/kuma/apps/wiki/views.py", line 204, in _format_attachment_obj
    'size': attachment.current_revision.file.size,

  File "/data/www/developer.mozilla.org/kuma/vendor/src/django/django/db/models/fields/files.py", line 77, in _get_size
    return self.storage.size(self.name)

  File "/data/www/developer.mozilla.org/kuma/vendor/src/django/django/core/files/storage.py", line 216, in size
    return os.path.getsize(self.path(name))

  File "/usr/lib64/python2.6/genericpath.py", line 49, in getsize
    return os.stat(filename).st_size

UnicodeEncodeError: 'ascii' codec can't encode characters in position 104-108: ordinal not in range(128)
Comment 1 [github robot] 2012-11-08 09:23:41 PST
Commits pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/b44a8a878fcf3cf3284d857ccedff093e393754f
fix bug 781822 - Prevent attachment size issue

https://github.com/mozilla/kuma/commit/0fe0cd8b5be03be8cdd4d46f9c9e25fdb95585d3
Merge pull request #692 from darkwing/unicode-attachment-781822

fix bug 781822 - Prevent attachment size issue

Note You need to log in before you can comment on or make changes to this bug.