'ascii' codec can't encode character u'\xc4' in position 0: ordinal not in range(128)
Request Method: POST
Request URL: http://kortti.hfi/laheta/email
Exception Type: UnicodeEncodeError
Exception Value:
'ascii' codec can't encode character u'\xc4' in position 0: ordinal not in range(128)
Exception Location: /usr/lib/pymodules/python2.6/django/core/mail.py in forbid_multi_line_headers, line 85
Python Executable: /usr/bin/python
Python Version: 2.6.5
Python Path: ['/usr/local/lib/python2.6/dist-packages/django_sphinx-2.2.3-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/xlrd-0.7.1-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/xlwt-0.7.2-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/xlutils-1.4.1-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/errorhandler-1.1.1-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/soaplib-0.8.1-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/lxml-2.2.6-py2.6-linux-x86_64.egg', '/usr/local/lib/python2.6/dist-packages/pytz-2010h-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/polib-0.5.2-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/python_memcached-1.45-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/pycrypto-2.1.0-py2.6-linux-x86_64.egg', '/usr/local/lib/python2.6/dist-packages/suds-0.3.9-py2.6.egg', '/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/local/lib/python2.6/dist-packages', '/usr/local/lib/python2.6/dist-packages/PIL', '/home/ecard']
Server time: Ti, 23 Mar 2010 17:33:22 +0200
Unicode error hint
The string that could not be encoded/decoded was: Äiti
Traceback Switch to copy-and-paste view
* /usr/lib/pymodules/python2.6/django/core/handlers/base.py in get_response
85. # Apply view middleware
86. for middleware_method in self._view_middleware:
87. response = middleware_method(request, callback, callback_args, callback_kwargs)
88. if response:
89. return response
90.
91. try:
92. response = callback(request, *callback_args, **callback_kwargs) ...
93. except Exception, e:
94. # If the view raised an exception, run it through exception
95. # middleware, and if the exception middleware returns a
96. # response, use that. Otherwise, reraise the exception.
97. for middleware_method in self._exception_middleware:
98. response = middleware_method(request, e)
▶ Local vars
Variable Value
callback
callback_args
()
callback_kwargs
{}
e
UnicodeEncodeError('ascii', u'\xc4iti', 0, 1, 'ordinal not in range(128)')
exc_info
(
exceptions
middleware_method
receivers
[(
request
resolver
response
None
self
settings
urlconf
'ecard.urls'
urlresolvers
* /home/ecard/ecard/card/views.py in send_card
305. message = Template(mail.content)
306. params = {'sender': sender, 'receivers': receivers_mail, 'card': settings.BASE_URL + reverse('watch_card', kwargs=dict(id=new_card.pk, hash=hash, sender='1'))}
307. msg = EmailMessage(mail.subject,
308. message.render(Context(params)),
309. p>',
310. [sender + ' <' + card_details['sender_email'] + '>'], [],
311. hes.fi>'})
312. msg.send() ...
313.
314. if now:
315. """ Increase card sent counter """
316. card.increment_sent_counter_and_save()
317. cache.delete(settings.CACHE_PREFIX + 'popular_cards')
318. """ Send mail to receivers """
▶ Local vars
Variable Value
cachekey
'prod_mailtemplate_mail_sender'
card
card_details
{'card_content': u'H, Hyv\xe4\xe4 Jouluajoulua !!', 'receiver_email': ui7@gmail.com', 'receiver_name': u'ille', 'send_card': 1, 'sender_email': u'mail.com', 'sender_name': u'\xc4iti'}
check_competition
True
check_content
True
check_email
True
check_name
True
check_receiver_mail
True
check_receiver_name
True
check_string
'724642uavy3mb$^#m*j-l$_^66$5v#q7-71-lo3gum6geipsogts+da'
comp_form
competition
False
errors
{}
frame
''
frameindex
0
frames
{'a': '', 'koivuraami': 'koivuraami1_B.gif', 'kultaraami': 'kultaraami.gif', 'kulunutmetalliraami': 'kulunutmetalliraami.png', 'lapselleraami': 'lapselleraami.png', 'marmoriraami': 'marmoriraami.png', 'mustapuuraami': 'mustapuuraami.gif', 'peiliraami': 'peiliraami.png', 'puuraami': 'puuraami.png', 'tyttoraami': 'tyttoraami.png'}
frames_thumbs
{'a': '', 'koivuraami': 'koivuraami1_THUMB.png', 'kultaraami': 'kultaraami_THUMB.gif', 'kulunutmetalliraami': 'kulunutmetalliraami_THUMB.png', 'lapselleraami': 'lapselleraami_THUMB.png', 'marmoriraami': 'marmoriraami_THUMB.png', 'mustapuuraami': 'mustapuuraami_THUMB.gif', 'peiliraami': 'peiliraami_THUMB.png', 'puuraami': 'puuraami_THUMB.png', 'tyttoraami': 'tyttoraami_THUMB.png'}
hash
'e768ae7c5899e68ecbcb52e91517c3a6'
i
1
id
u'3133'
m
message
msg
new_card
normal_tag
False
notify
True
now
False
own_upload
False
params
{'card': '213.239.220.27/kortti/katso/72464/e768ae7c5899e68ecbcb52e91517c3a6/1', 'receivers': [u'gmail.com'], 'sender': u'\xc4iti,'}
rec_card
receiver
u'gmail.com'
receivers_mail
[u'fgmail.com']
receivers_name
[u'Ak']
request
send_time
datetime.datetime(2010, 12, 24, 0, 0)
sender
u'\xc4s'
tag
u'joulu'
* /usr/lib/pymodules/python2.6/django/core/mail.py in send
259.
260. def send(self, fail_silently=False):
261. """Sends the email message."""
262. if not self.recipients():
263. # Don't bother creating the network connection if there's nobody to
264. # send to.
265. return 0
266. return self.get_connection(fail_silently).send_messages([self]) ...
267.
268. def attach(self, filename=None, content=None, mimetype=None):
269. """
270. Attaches a file with the given filename and content. The filename can
271. be omitted and the mimetype is guessed, if not provided.
272.
▶ Local vars
Variable Value
fail_silently
False
self
* /usr/lib/pymodules/python2.6/django/core/mail.py in send_messages
165. return
166. new_conn_created = self.open()
167. if not self.connection:
168. # We failed silently on open(). Trying to send would be pointless.
169. return
170. num_sent = 0
171. for message in email_messages:
172. sent = self._send(message) ...
173. if sent:
174. num_sent += 1
175. if new_conn_created:
176. self.close()
177. return num_sent
178.
▶ Local vars
Variable Value
email_messages
[
message
new_conn_created
True
num_sent
0
self
* /usr/lib/pymodules/python2.6/django/core/mail.py in _send
179. def _send(self, email_message):
180. """A helper method that does the actual sending."""
181. if not email_message.recipients():
182. return False
183. try:
184. self.connection.sendmail(email_message.from_email,
185. email_message.recipients(),
186. email_message.message().as_string()) ...
187. except:
188. if not self.fail_silently:
189. raise
190. return False
191. return True
192.
▶ Local vars
Variable Value
email_message
self
* /usr/lib/pymodules/python2.6/django/core/mail.py in message
233. def message(self):
234. encoding = self.encoding or settings.DEFAULT_CHARSET
235. msg = SafeMIMEText(smart_str(self.body, settings.DEFAULT_CHARSET),
236. self.content_subtype, encoding)
237. msg = self._create_message(msg)
238. msg['Subject'] = self.subject
239. msg['From'] = self.extra_headers.pop('From', self.from_email)
240. msg['To'] = ', '.join(self.to) ...
241.
242. # Email header names are case-insensitive (RFC 2045), so we have to
243. # accommodate that when doing comparisons.
244. header_names = [key.lower() for key in self.extra_headers]
245. if 'date' not in header_names:
246. msg['Date'] = formatdate()
▶ Local vars
Variable Value
encoding
'utf-8'
msg
self
* /usr/lib/pymodules/python2.6/django/core/mail.py in __setitem__
89. else:
90. if name.lower() == 'subject':
91. val = Header(val)
92. return name, val
93.
94. class SafeMIMEText(MIMEText):
95. def __setitem__(self, name, val):
96. name, val = forbid_multi_line_headers(name, val) ...
97. MIMEText.__setitem__(self, name, val)
98.
99. class SafeMIMEMultipart(MIMEMultipart):
100. def __setitem__(self, name, val):
101. name, val = forbid_multi_line_headers(name, val)
102. MIMEMultipart.__setitem__(self, name, val)
▶ Local vars
Variable Value
name
'To'
self
val
u'\xc4iti,>'
* /usr/lib/pymodules/python2.6/django/core/mail.py in forbid_multi_line_headers
78. val = val.encode('ascii')
79. except UnicodeEncodeError:
80. if name.lower() in ('to', 'from', 'cc'):
81. result = []
82. for item in val.split(', '):
83. nm, addr = parseaddr(item)
84. nm = str(Header(nm, settings.DEFAULT_CHARSET))
85. result.append(formataddr((nm, str(addr)))) ...
86. val = ', '.join(result)
87. else:
88. val = Header(val, settings.DEFAULT_CHARSET)
89. else:
90. if name.lower() == 'subject':
91. val = Header(val)
▶ Local vars
Variable Value
addr
u'\xc4iti'
item
u'\xc4iti'
name
'To'
nm
''
result
[]
val
u'\xc4iti,
Environment: Request Method: POST Request URL: http://ekortti.hs.fi/laheta/email Django Version: 1.1.1 Python Version: 2.6.5 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.flatpages', 'djangosphinx', 'ecard.adminx', 'ecard.campaign', 'ecard.card', 'ecard.holiday', 'ecard.home', 'ecard.nameday', 'ecard.tag', 'ecard.mail', 'ecard.feed', 'ecard.competition'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware') Traceback: File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py" in get_response 92. response = callback(request, *callback_args, **callback_kwargs) File "/home/ecard/ecard/card/views.py" in send_card 312. msg.send() File "/usr/lib/pymodules/python2.6/django/core/mail.py" in send 266. return self.get_connection(fail_silently).send_messages([self]) File "/usr/lib/pymodules/python2.6/django/core/mail.py" in send_messages 172. sent = self._send(message) File "/usr/lib/pymodules/python2.6/django/core/mail.py" in _send 186. email_message.message().as_string()) File "/usr/lib/pymodules/python2.6/django/core/mail.py" in message 240. msg['To'] = ', '.join(self.to) File "/usr/lib/pymodules/python2.6/django/core/mail.py" in __setitem__ 96. name, val = forbid_multi_line_headers(name, val) File "/usr/lib/pymodules/python2.6/django/core/mail.py" in forbid_multi_line_headers 85. result.append(formataddr((nm, str(addr)))) Exception Type: UnicodeEncodeError at /laheta/email Exception Value: 'ascii' codec can't encode character u'\xc4' in position 0: ordinal not in range(128)
Request information
GET
No GET data
POST
Variable Value
Postinro
u''
sender_name
u'\xc4iti,'
frame
u''
tag
u'joulu'
Sukunimi
u''
send_time
u'24.12.2010'
u''
card_content
u'Hei, Hyv\xe4\xe4 Jouluajoulua !!'
Osoite
u''
send_now
u'0'
Gsmnro
u''
friend_name
u'e'
id
u'3133'
Puhnro
u''
Postitoimipaikka
u''
x
u'78'
send_card
u'1'
frame_index
u'0'
Etunimi
u''
friend_email
u'f
u'@gmail.com'
y
u'7'
ecard_notification
u'1'
FILES
No FILES data
COOKIES
No cookie data
META
Variable Value
CONTENT_LENGTH
'387'
CONTENT_TYPE
'application/x-www-form-urlencoded'
DOCUMENT_ROOT
'/home/ecard/ecard/static'
ECARD_DEV_MODE
'False'
GATEWAY_INTERFACE
'CGI/1.1'
HTTP_ACCEPT
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
HTTP_ACCEPT_CHARSET
'ISO-8859-7,utf-8;q=0.7,*;q=0.7'
HTTP_ACCEPT_ENCODING
'gzip,deflate'
HTTP_ACCEPT_LANGUAGE
'el-gr,el;q=0.8,en-us;q=0.5,en;q=0.3'
HTTP_CONNECTION
'close'
HTTP_HOST
'ekortti.hs.fi'
HTTP_REFERER
'http://ekortti.hs.fi/laheta/email'
HTTP_USER_AGENT
'Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 (.NET CLR 3.5.30729)'
HTTP_X_REAL_IP
'79.103.26.70'
PATH
'/usr/local/bin:/usr/bin:/bin'
PATH_INFO
u'/laheta/email'
PATH_TRANSLATED
'/home/ecard/ecard/conf/apache.wsgi/laheta/email'
QUERY_STRING
''
REMOTE_ADDR
'127.0.0.1'
REMOTE_PORT
'42616'
REQUEST_METHOD
'POST'
REQUEST_URI
'/laheta/email'
SCRIPT_FILENAME
'/home/ecard/ecard/conf/apache.wsgi'
SCRIPT_NAME
u''
SERVER_ADDR
'127.0.0.1'
SERVER_ADMIN
'admin@sc5.fi'
SERVER_NAME
'ekortti.hs.fi'
SERVER_PORT
'80'
SERVER_PROTOCOL
'HTTP/1.0'
SERVER_SIGNATURE
'Apache/2.2.14 (Ubuntu) Server at ekortti.hs.fi Port 80\n'
SERVER_SOFTWARE
'Apache/2.2.14 (Ubuntu)'
mod_wsgi.application_group
'213.239.220.27|'
mod_wsgi.callable_object
'application'
mod_wsgi.listener_host
''
mod_wsgi.listener_port
'80'
mod_wsgi.process_group
''
mod_wsgi.reload_mechanism
'0'
mod_wsgi.script_reloading
'1'
mod_wsgi.version
(2, 8)
wsgi.errors
wsgi.file_wrapper
wsgi.input
wsgi.multiprocess
True
wsgi.multithread
False
wsgi.run_once
False
wsgi.url_scheme
'http'
wsgi.version
(1, 0)
Settings
Using settings module ecard.settings
Setting Value
ABSOLUTE_URL_OVERRIDES
{}
ADMINS
()
ADMIN_FOR
()
ADMIN_MEDIA_PREFIX
'/static/media/'
ALLOWED_INCLUDE_ROOTS
()
APPEND_SLASH
True
AUTHENTICATION_BACKENDS
('django.contrib.auth.backends.ModelBackend',)
BANNED_IPS
()
BASE_PATH
'/home/ecard/ecard'
BASE_URL
'213.239.220.27'
CACHE_BACKEND
'memcached://213.239.220.27:11211;213.239.221.107:11211/'
CACHE_MIDDLEWARE_KEY_PREFIX
''
CACHE_MIDDLEWARE_SECONDS
600
CACHE_PREFIX
'prod_'
COMMENTS_ALLOW_PROFANITIES
False
COMMENTS_BANNED_USERS_GROUP
None
COMMENTS_FIRST_FEW
0
COMMENTS_MODERATORS_GROUP
None
COMMENTS_SKETCHY_USERS_GROUP
None
DATABASES
{'default': {'DATABASE_ENGINE': 'mysql', 'DATABASE_HOST': '213.239.220.27', 'DATABASE_NAME': 'ecard', 'DATABASE_PASSWORD': 'AnAtz2BLGZL6xAKC', 'DATABASE_PORT': '', 'DATABASE_USER': 'ecard'}}
DATABASE_ENGINE
'mysql'
DATABASE_HOST
'213.239.220.27'
DATABASE_NAME
'ecard'
DATABASE_OPTIONS
{}
DATABASE_PASSWORD
'********************'
DATABASE_PORT
''
DATABASE_USER
'ecard'
DATETIME_FORMAT
'N j, Y, P'
DATE_FORMAT
'N j, Y'
DEBUG
True
DEBUG_PROPAGATE_EXCEPTIONS
False
DEFAULT_CHARSET
'utf-8'
DEFAULT_CONTENT_TYPE
'text/html'
DEFAULT_FILE_STORAGE
'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL
'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE
''
DEFAULT_LANGUAGE
'fi'
DEFAULT_TABLESPACE
''
DISALLOWED_USER_AGENTS
()
EMAIL_HOST
'localhost'
EMAIL_HOST_PASSWORD
'********************'
EMAIL_HOST_USER
''
EMAIL_PORT
25
EMAIL_SUBJECT_PREFIX
'[Django] '
EMAIL_USE_TLS
False
FILE_CHARSET
'utf-8'
FILE_UPLOAD_HANDLERS
('django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler')
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
FILE_UPLOAD_PERMISSIONS
None
FILE_UPLOAD_TEMP_DIR
None
FIXTURE_DIRS
()
FORCE_SCRIPT_NAME
None
FRAMES
{'a': '', 'koivuraami': 'koivuraami1_B.gif', 'kultaraami': 'kultaraami.gif', 'kulunutmetalliraami': 'kulunutmetalliraami.png', 'lapselleraami': 'lapselleraami.png', 'marmoriraami': 'marmoriraami.png', 'mustapuuraami': 'mustapuuraami.gif', 'peiliraami': 'peiliraami.png', 'puuraami': 'puuraami.png', 'tyttoraami': 'tyttoraami.png'}
FRAMES_THUMBS
{'a': '', 'koivuraami': 'koivuraami1_THUMB.png', 'kultaraami': 'kultaraami_THUMB.gif', 'kulunutmetalliraami': 'kulunutmetalliraami_THUMB.png', 'lapselleraami': 'lapselleraami_THUMB.png', 'marmoriraami': 'marmoriraami_THUMB.png', 'mustapuuraami': 'mustapuuraami_THUMB.gif', 'peiliraami': 'peiliraami_THUMB.png', 'puuraami': 'puuraami_THUMB.png', 'tyttoraami': 'tyttoraami_THUMB.png'}
IGNORABLE_404_ENDS
('mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi', 'favicon.ico', '.php')
IGNORABLE_404_STARTS
('/cgi-bin/', '/_vti_bin', '/_vti_inf')
INSTALLED_APPS
['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.flatpages', 'djangosphinx', 'ecard.adminx', 'ecard.campaign', 'ecard.card', 'ecard.holiday', 'ecard.home', 'ecard.nameday', 'ecard.tag', 'ecard.mail', 'ecard.feed', 'ecard.competition']
INTERNAL_IPS
()
LANGUAGES
(('fi', 'Finnish'),)
LANGUAGES_BIDI
('he', 'ar', 'fa')
LANGUAGE_CODE
'fi-fi'
LANGUAGE_COOKIE_NAME
'django_language'
LOCALE_PATHS
()
LOGIN_REDIRECT_URL
'/accounts/profile/'
LOGIN_URL
'/accounts/login/'
LOGOUT_URL
'/accounts/logout/'
MANAGERS
()
MEDIA_ROOT
'/home/ecard/ecard/static/'
MEDIA_URL
'/static/'
MIDDLEWARE_CLASSES
('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')
MONTH_DAY_FORMAT
'F j'
PASSWORD_RESET_TIMEOUT_DAYS
'********************'
PREPEND_WWW
False
PRODUCTION
True
PROFANITIES_LIST
'********************'
ROOT_URLCONF
'ecard.urls'
SECRET_KEY
'********************'
SEND_BROKEN_LINK_EMAILS
False
SERVER_EMAIL
'root@localhost'
SESSION_COOKIE_AGE
1209600
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_NAME
'sessionid'
SESSION_COOKIE_PATH
'/'
SESSION_COOKIE_SECURE
False
SESSION_ENGINE
'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
SESSION_FILE_PATH
None
SESSION_SAVE_EVERY_REQUEST
False
SETTINGS_MODULE
'ecard.settings'
SITE_ID
4
SOAP_ASIAKAS_NAMESPACE
'http://Sanoma.fi/SanomaData/Asiakasliidi'
SOAP_NAMESPACE
'http://Sanoma.fi/SanomaData/Liidi'
SOAP_SERVICE_URL
'http://194.137.237.109/hspalvelu/HSLiidi/tuotanto/hsasiakasliidi.asmx?wsdl'
SPHINX_API_VERSION
275
SPHINX_PORT
9312
TEMPLATE_CONTEXT_PROCESSORS
('django.core.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.request', 'ecard.context_processors.urls')
TEMPLATE_DEBUG
True
TEMPLATE_DIRS
('/home/ecard/ecard/templates',)
TEMPLATE_LOADERS
('django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source')
TEMPLATE_STRING_IF_INVALID
''
TEST_DATABASE_CHARSET
None
TEST_DATABASE_COLLATION
None
TEST_DATABASE_NAME
None
TEST_RUNNER
'django.test.simple.run_tests'
TIME_FORMAT
'P'
TIME_ZONE
'Europe/Helsinki'
TRANSACTIONS_MANAGED
False
URL_VALIDATOR_USER_AGENT
'Django/1.1.1 (http://www.djangoproject.com)'
USE_ETAGS
False
USE_I18N
True
YEAR_MONTH_FORMAT
'F Y'Professor Frederick H. Damon
Department of Anthropology
University of Virginia argues that boats serve as a calculus of
interisland relations.
Ei kommentteja:
Lähetä kommentti