somkiattha / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 0 forks source link

Problem with excel conversion to xforms through XLSForm #871

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello! I am having a problem with converting my excel file through XLSForm. 
Whenever I upload the file and click "submit", I get the same message which I 
will copy and paste below. If anyone knows what I am doing wrong, please let me 
know!!!

UnicodeEncodeError at /
'ascii' codec can't encode character u'\u2013' in position 42: ordinal not in 
range(128)
Request Method: POST
Request URL:    http://23.21.114.69/xlsform/
Django Version: 1.4
Exception Type: UnicodeEncodeError
Exception Value:
'ascii' codec can't encode character u'\u2013' in position 42: ordinal not in 
range(128)
Exception Location:     
/home/ubuntu/django/xlsform/xlsform/pyxform_interface/views.py in index, line 77
Python Executable:      /usr/bin/python
Python Version: 2.6.5
Python Path:
['/home/ubuntu/django/xlsform',
 '/usr/local/lib/python2.6/dist-packages/pip-1.1-py2.6.egg',
 '/home/ubuntu/django/xlsform/xlsform/pyxform_interface/src/pyxform',
 '/usr/lib/python2.6',
 '/usr/lib/python2.6/plat-linux2',
 '/usr/lib/python2.6/lib-tk',
 '/usr/lib/python2.6/lib-old',
 '/usr/lib/python2.6/lib-dynload',
 '/usr/lib/python2.6/dist-packages',
 '/usr/lib/pymodules/python2.6',
 '/usr/lib/pymodules/python2.6/gtk-2.0',
 '/usr/local/lib/python2.6/dist-packages',
 '/home/ubuntu/django/xlsform/xlsform']
Server time:    Fri, 12 Jul 2013 12:46:23 -0500
Unicode error hint

The string that could not be encoded/decoded was: P_1_Y–IMP_2
Traceback Switch to copy-and-paste view

/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py in 
get_response
                        response = callback(request, *callback_args, **callback_kwargs) ...
▶ Local vars
/home/ubuntu/django/xlsform/xlsform/pyxform_interface/views.py in index
                error = 'Error: ' + str(e) ...
▶ Local vars
Request information

GET
No GET data
POST
No POST data
FILES
Variable        Value
file
<InMemoryUploadedFile: YAB_12_Month_Follow_Up_(Kobo)7_11_13.xlsx 
(application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)>
COOKIES
No cookie data
META
Variable        Value
mod_wsgi.reload_mechanism
'1'
mod_wsgi.listener_port
'80'
HTTP_REFERER
'http://23.21.114.69/xlsform/'
mod_wsgi.listener_host
''
SERVER_SOFTWARE
'Apache/2.2.14 (Ubuntu)'
SCRIPT_NAME
u'/xlsform'
SERVER_SIGNATURE
'<address>Apache/2.2.14 (Ubuntu) Server at 23.21.114.69 Port 80</address>\n'
REQUEST_METHOD
'POST'
PATH_INFO
u'/'
HTTP_ORIGIN
'http://23.21.114.69'
SERVER_PROTOCOL
'HTTP/1.1'
QUERY_STRING
''
PATH
'/usr/local/bin:/usr/bin:/bin'
CONTENT_LENGTH
'229646'
HTTP_USER_AGENT
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.58.2 (KHTML, 
like Gecko) Version/5.1.8 Safari/534.58.2'
HTTP_CONNECTION
'keep-alive'
SERVER_NAME
'23.21.114.69'
REMOTE_ADDR
'134.174.1.211'
wsgi.url_scheme
'http'
PATH_TRANSLATED
'/var/www/index.php'
SERVER_PORT
'80'
wsgi.multiprocess
False
SERVER_ADDR
'10.209.94.106'
DOCUMENT_ROOT
'/var/www'
mod_wsgi.process_group
'xlsform'
SCRIPT_FILENAME
'/home/ubuntu/django/xlsform/xlsform/wsgi.py'
SERVER_ADMIN
'webmaster@localhost'
wsgi.input
<mod_wsgi.Input object at 0xb9b358b8>
HTTP_HOST
'23.21.114.69'
wsgi.multithread
True
mod_wsgi.callable_object
'application'
REQUEST_URI
'/xlsform/'
HTTP_ACCEPT
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
wsgi.version
(1, 0)
GATEWAY_INTERFACE
'CGI/1.1'
wsgi.run_once
False
wsgi.errors
<mod_wsgi.Log object at 0xba0cd280>
REMOTE_PORT
'31266'
HTTP_ACCEPT_LANGUAGE
'en-us'
mod_wsgi.version
(2, 8)
CONTENT_TYPE
'multipart/form-data; boundary=----WebKitFormBoundaryoFlC9NAmG7i69Wbc'
mod_wsgi.application_group
'xlsform'
mod_wsgi.script_reloading
'1'
wsgi.file_wrapper
''
HTTP_ACCEPT_ENCODING
'gzip, deflate'
Settings
Using settings module xlsform.settings
Setting Value
USE_L10N
True
USE_THOUSAND_SEPARATOR
False
CSRF_COOKIE_SECURE
False
LANGUAGE_CODE
'en-us'
ROOT_URLCONF
'xlsform.urls'
MANAGERS
()
DEFAULT_CHARSET
'utf-8'
STATIC_ROOT
''
MESSAGE_STORAGE
'django.contrib.messages.storage.fallback.FallbackStorage'
EMAIL_SUBJECT_PREFIX
'[Django] '
FILE_UPLOAD_PERMISSIONS
None
URL_VALIDATOR_USER_AGENT
'Django/1.4 (https://www.djangoproject.com)'
STATICFILES_FINDERS
('django.contrib.staticfiles.finders.FileSystemFinder',
 'django.contrib.staticfiles.finders.AppDirectoriesFinder')
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_NAME
'sessionid'
ADMIN_FOR
()
TIME_INPUT_FORMATS
('%H:%M:%S', '%H:%M')
DATABASES
{'default': {'ENGINE': 'django.db.backends.dummy',
             'HOST': '',
             'NAME': '',
             'OPTIONS': {},
             'PASSWORD': u'********************',
             'PORT': '',
             'TEST_CHARSET': None,
             'TEST_COLLATION': None,
             'TEST_MIRROR': None,
             'TEST_NAME': None,
             'TIME_ZONE': 'UTC',
             'USER': ''}}
SERVER_EMAIL
'root@localhost'
FILE_UPLOAD_HANDLERS
('django.core.files.uploadhandler.MemoryFileUploadHandler',
 'django.core.files.uploadhandler.TemporaryFileUploadHandler')
DEFAULT_CONTENT_TYPE
'text/html'
APPEND_SLASH
True
FIRST_DAY_OF_WEEK
0
DATABASE_ROUTERS
[]
YEAR_MONTH_FORMAT
'F Y'
STATICFILES_STORAGE
'django.contrib.staticfiles.storage.StaticFilesStorage'
CACHES
{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
             'LOCATION': ''}}
SESSION_COOKIE_PATH
'/'
USE_X_FORWARDED_HOST
False
MIDDLEWARE_CLASSES
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')
USE_I18N
True
THOUSAND_SEPARATOR
','
SECRET_KEY
u'********************'
LANGUAGE_COOKIE_NAME
'django_language'
DEFAULT_INDEX_TABLESPACE
''
TRANSACTIONS_MANAGED
False
LOGGING_CONFIG
'django.utils.log.dictConfig'
SEND_BROKEN_LINK_EMAILS
False
TEMPLATE_LOADERS
('django.template.loaders.filesystem.Loader',
 'django.template.loaders.app_directories.Loader')
WSGI_APPLICATION
'xlsform.wsgi.application'
TEMPLATE_DEBUG
True
X_FRAME_OPTIONS
'SAMEORIGIN'
AUTHENTICATION_BACKENDS
('django.contrib.auth.backends.ModelBackend',)
FORCE_SCRIPT_NAME
None
CACHE_BACKEND
'locmem://'
SIGNING_BACKEND
'django.core.signing.TimestampSigner'
SESSION_COOKIE_SECURE
False
CSRF_COOKIE_DOMAIN
None
FILE_CHARSET
'utf-8'
DEBUG
True
SESSION_FILE_PATH
None
DEFAULT_FILE_STORAGE
'django.core.files.storage.FileSystemStorage'
INSTALLED_APPS
('pyxform_interface',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles')
LANGUAGES
(('ar', 'Arabic'),
 ('az', 'Azerbaijani'),
 ('bg', 'Bulgarian'),
 ('bn', 'Bengali'),
 ('bs', 'Bosnian'),
 ('ca', 'Catalan'),
 ('cs', 'Czech'),
 ('cy', 'Welsh'),
 ('da', 'Danish'),
 ('de', 'German'),
 ('el', 'Greek'),
 ('en', 'English'),
 ('en-gb', 'British English'),
 ('eo', 'Esperanto'),
 ('es', 'Spanish'),
 ('es-ar', 'Argentinian Spanish'),
 ('es-mx', 'Mexican Spanish'),
 ('es-ni', 'Nicaraguan Spanish'),
 ('et', 'Estonian'),
 ('eu', 'Basque'),
 ('fa', 'Persian'),
 ('fi', 'Finnish'),
 ('fr', 'French'),
 ('fy-nl', 'Frisian'),
 ('ga', 'Irish'),
 ('gl', 'Galician'),
 ('he', 'Hebrew'),
 ('hi', 'Hindi'),
 ('hr', 'Croatian'),
 ('hu', 'Hungarian'),
 ('id', 'Indonesian'),
 ('is', 'Icelandic'),
 ('it', 'Italian'),
 ('ja', 'Japanese'),
 ('ka', 'Georgian'),
 ('kk', 'Kazakh'),
 ('km', 'Khmer'),
 ('kn', 'Kannada'),
 ('ko', 'Korean'),
 ('lt', 'Lithuanian'),
 ('lv', 'Latvian'),
 ('mk', 'Macedonian'),
 ('ml', 'Malayalam'),
 ('mn', 'Mongolian'),
 ('nb', 'Norwegian Bokmal'),
 ('ne', 'Nepali'),
 ('nl', 'Dutch'),
 ('nn', 'Norwegian Nynorsk'),
 ('pa', 'Punjabi'),
 ('pl', 'Polish'),
 ('pt', 'Portuguese'),
 ('pt-br', 'Brazilian Portuguese'),
 ('ro', 'Romanian'),
 ('ru', 'Russian'),
 ('sk', 'Slovak'),
 ('sl', 'Slovenian'),
 ('sq', 'Albanian'),
 ('sr', 'Serbian'),
 ('sr-latn', 'Serbian Latin'),
 ('sv', 'Swedish'),
 ('sw', 'Swahili'),
 ('ta', 'Tamil'),
 ('te', 'Telugu'),
 ('th', 'Thai'),
 ('tr', 'Turkish'),
 ('tt', 'Tatar'),
 ('uk', 'Ukrainian'),
 ('ur', 'Urdu'),
 ('vi', 'Vietnamese'),
 ('zh-cn', 'Simplified Chinese'),
 ('zh-tw', 'Traditional Chinese'))
COMMENTS_ALLOW_PROFANITIES
False
STATICFILES_DIRS
()
PREPEND_WWW
False
SECURE_PROXY_SSL_HEADER
None
SESSION_COOKIE_HTTPONLY
True
DEBUG_PROPAGATE_EXCEPTIONS
False
MONTH_DAY_FORMAT
'F j'
LOGIN_URL
'/accounts/login/'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
TIME_FORMAT
'P'
DATE_INPUT_FORMATS
('%Y-%m-%d',
 '%m/%d/%Y',
 '%m/%d/%y',
 '%b %d %Y',
 '%b %d, %Y',
 '%d %b %Y',
 '%d %b, %Y',
 '%B %d %Y',
 '%B %d, %Y',
 '%d %B %Y',
 '%d %B, %Y')
CSRF_COOKIE_NAME
'csrftoken'
EMAIL_HOST_PASSWORD
u'********************'
PASSWORD_RESET_TIMEOUT_DAYS
u'********************'
CACHE_MIDDLEWARE_ALIAS
'default'
SESSION_SAVE_EVERY_REQUEST
False
NUMBER_GROUPING
0
SESSION_ENGINE
'django.contrib.sessions.backends.db'
CSRF_FAILURE_VIEW
'django.views.csrf.csrf_failure'
CSRF_COOKIE_PATH
'/'
LOGIN_REDIRECT_URL
'/accounts/profile/'
LOGGING
{'disable_existing_loggers': False,
 'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}},
 'handlers': {'mail_admins': {'class': 'django.utils.log.AdminEmailHandler',
                              'filters': ['require_debug_false'],
                              'level': 'ERROR'}},
 'loggers': {'django.request': {'handlers': ['mail_admins'],
                                'level': 'ERROR',
                                'propagate': True}},
 'version': 1}
IGNORABLE_404_URLS
()
LOCALE_PATHS
()
TEMPLATE_STRING_IF_INVALID
''
LOGOUT_URL
'/accounts/logout/'
EMAIL_USE_TLS
False
FIXTURE_DIRS
()
EMAIL_HOST
'localhost'
DATE_FORMAT
'N j, Y'
MEDIA_ROOT
''
DEFAULT_EXCEPTION_REPORTER_FILTER
'django.views.debug.SafeExceptionReporterFilter'
ADMINS
()
FORMAT_MODULE_PATH
None
DEFAULT_FROM_EMAIL
'webmaster@localhost'
MEDIA_URL
''
DATETIME_FORMAT
'N j, Y, P'
TEMPLATE_DIRS
()
SITE_ID
1
DISALLOWED_USER_AGENTS
()
ALLOWED_INCLUDE_ROOTS
()
DECIMAL_SEPARATOR
'.'
SHORT_DATE_FORMAT
'm/d/Y'
TEST_RUNNER
'django.test.simple.DjangoTestSuiteRunner'
CACHE_MIDDLEWARE_KEY_PREFIX
u'********************'
TIME_ZONE
'America/Chicago'
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
EMAIL_BACKEND
'django.core.mail.backends.smtp.EmailBackend'
DEFAULT_TABLESPACE
''
TEMPLATE_CONTEXT_PROCESSORS
('django.contrib.auth.context_processors.auth',
 'django.core.context_processors.debug',
 'django.core.context_processors.i18n',
 'django.core.context_processors.media',
 'django.core.context_processors.static',
 'django.core.context_processors.tz',
 'django.contrib.messages.context_processors.messages')
SESSION_COOKIE_AGE
1209600
SETTINGS_MODULE
'xlsform.settings'
USE_ETAGS
False
LANGUAGES_BIDI
('he', 'ar', 'fa')
FILE_UPLOAD_TEMP_DIR
None
INTERNAL_IPS
()
STATIC_URL
'/static/'
EMAIL_PORT
25
USE_TZ
True
SHORT_DATETIME_FORMAT
'm/d/Y P'
PASSWORD_HASHERS
u'********************'
ABSOLUTE_URL_OVERRIDES
{}
CACHE_MIDDLEWARE_SECONDS
600
DATETIME_INPUT_FORMATS
('%Y-%m-%d %H:%M:%S',
 '%Y-%m-%d %H:%M:%S.%f',
 '%Y-%m-%d %H:%M',
 '%Y-%m-%d',
 '%m/%d/%Y %H:%M:%S',
 '%m/%d/%Y %H:%M:%S.%f',
 '%m/%d/%Y %H:%M',
 '%m/%d/%Y',
 '%m/%d/%y %H:%M:%S',
 '%m/%d/%y %H:%M:%S.%f',
 '%m/%d/%y %H:%M',
 '%m/%d/%y')
EMAIL_HOST_USER
''
PROFANITIES_LIST
u'********************'
You're seeing this error because you have DEBUG = True in your Django settings 
file. Change that to False, and Django will display a standard 500 page.

Original issue reported on code.google.com by yano...@nafundi.com on 13 Jul 2013 at 1:47

GoogleCodeExporter commented 9 years ago
Hi Yaw,

Did you try this one of this solution : 
http://stackoverflow.com/questions/3715865/unicodeencodeerror-ascii-codec-cant-e
ncode-character

Clem

Original comment by peron.c...@gmail.com on 15 Jul 2013 at 7:31

GoogleCodeExporter commented 9 years ago
I have no context for this. 

What form was being used?

Was this on our site? Or some other server.

Original comment by mitchellsundt@gmail.com on 13 Mar 2014 at 11:30

GoogleCodeExporter commented 9 years ago
It's been a while. My guess was that a form was uploaded with unicode 
characters and it crashed xlsform.opendatakit.org.

Original comment by yano...@nafundi.com on 13 Mar 2014 at 11:41