UnicodeEncodeError: 'ascii' codec can't encode characters in position 104-108: ordinal not in range(128)

RESOLVED FIXED

Status

Mozilla Developer Network
Editing
P2
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: groovecoder, Unassigned)

Tracking

Details

(Reporter)

Description

5 years ago
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)
Priority: -- → P2
(Assignee)

Updated

5 years ago
Component: Docs Platform → Editing
Product: Mozilla Developer Network → Mozilla Developer Network

Comment 1

5 years ago
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

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.