Print error: {{ doc.sub_heading if doc.sub_heading != None UnicodeEncodeError: 'ascii' codec can't

Any one suggest how to fix?

Traceback (innermost last):
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/app.py", line 49, in application
response = frappe.handler.handle()
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/handler.py", line 66, in handle
execute_cmd(cmd)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/handler.py", line 89, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/init.py", line 531, in call
return fn(*args, **newargs)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/templates/pages/print.py", line 86, in get_html
html = template.render(args, filters={"len": len})
File "/home/frappe/press/benches/1409151105/env/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
return self.environment.handle_exception(exc_info, True)
File "/home/frappe/press/benches/1409151105/env/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/./templates/print_formats/standard.html", line 6, in top-level template code
{{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead) }}
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/./templates/print_formats/standard_macros.html", line 107, in template

{{ doc.sub_heading if doc.sub_heading != None
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f52447b6-2d2e-4c2c-a137-873fa6802e21%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



On 17-Sep-2014, at 8:17 am, Y Y <ya...@gmail.com> wrote:

Any one suggest how to fix?



Traceback (innermost last):
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/app.py", line 49, in application
response = frappe.handler.handle()
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/handler.py", line 66, in handle
execute_cmd(cmd)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/handler.py", line 89, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/init.py", line 531, in call
return fn(*args, **newargs)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/templates/pages/print.py", line 86, in get_html
html = template.render(args, filters={"len": len})
File "/home/frappe/press/benches/1409151105/env/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
return self.environment.handle_exception(exc_info, True)
File "/home/frappe/press/benches/1409151105/env/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/./templates/print_formats/standard.html", line 6, in top-level template code
{{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead) }}
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/./templates/print_formats/standard_macros.html", line 107, in template

{{ doc.sub_heading if doc.sub_heading != None
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f52447b6-2d2e-4c2c-a137-873fa6802e21%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5178D3B9-8D3C-415B-9881-6205D1C7284D%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
worked. thanks. can you share some knowledge article about this(maybe an article from google searched). thanks:)

在 2014年9月17日星期三UTC+8下午1时52分17秒,rushabh写道:



On 17-Sep-2014, at 8:17 am, Y Y <ya...@gmail.com> wrote:

Any one suggest how to fix?



Traceback (innermost last):
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/app.py", line 49, in application
response = frappe.handler.handle()
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/handler.py", line 66, in handle
execute_cmd(cmd)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/handler.py", line 89, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/init.py", line 531, in call
return fn(*args, **newargs)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/templates/pages/print.py", line 86, in get_html
html = template.render(args, filters={"len": len})
File "/home/frappe/press/benches/1409151105/env/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
return self.environment.handle_exception(exc_info, True)
File "/home/frappe/press/benches/1409151105/env/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/./templates/print_formats/standard.html", line 6, in top-level template code
{{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead) }}
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/./templates/print_formats/standard_macros.html", line 107, in template

{{ doc.sub_heading if doc.sub_heading != None
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f52447b6-2d2e-4c2c-a137-873fa6802e21%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/897299fa-ff32-471c-8b55-e934ce926a91%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.


On 17-Sep-2014, at 1:09 pm, Y Y <ya...@gmail.com> wrote:

worked. thanks. can you share some knowledge article about this(maybe an article from google searched). thanks:)

I checked Jinja is unicode friendly so I just made a guess that Python's "format" may not be unicode friendly :)



在 2014年9月17日星期三UTC+8下午1时52分17秒,rushabh写道:



On 17-Sep-2014, at 8:17 am, Y Y <ya...@gmail.com> wrote:

Any one suggest how to fix?



Traceback (innermost last):
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/app.py", line 49, in application
response = frappe.handler.handle()
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/handler.py", line 66, in handle
execute_cmd(cmd)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/handler.py", line 89, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/init.py", line 531, in call
return fn(*args, **newargs)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/templates/pages/print.py", line 86, in get_html
html = template.render(args, filters={"len": len})
File "/home/frappe/press/benches/1409151105/env/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
return self.environment.handle_exception(exc_info, True)
File "/home/frappe/press/benches/1409151105/env/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/./templates/print_formats/standard.html", line 6, in top-level template code
{{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead) }}
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/./templates/print_formats/standard_macros.html", line 107, in template

{{ doc.sub_heading if doc.sub_heading != None
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f52447b6-2d2e-4c2c-a137-873fa6802e21%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/897299fa-ff32-471c-8b55-e934ce926a91%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/46124256-35AA-4224-B900-1A98362E2924%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.

Thanks very much, is it possible to set python using utf8?

another issue mentioned is upload a file which name is in local language will fail... not sure how to fix...

在 2014年9月17日星期三UTC+8下午4时51分17秒,rushabh写道:


On 17-Sep-2014, at 1:09 pm, Y Y <ya...@gmail.com> wrote:

worked. thanks. can you share some knowledge article about this(maybe an article from google searched). thanks:)

I checked Jinja is unicode friendly so I just made a guess that Python's "format" may not be unicode friendly :)



在 2014年9月17日星期三UTC+8下午1时52分17秒,rushabh写道:



On 17-Sep-2014, at 8:17 am, Y Y <ya...@gmail.com> wrote:

Any one suggest how to fix?



Traceback (innermost last):
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/app.py", line 49, in application
response = frappe.handler.handle()
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/handler.py", line 66, in handle
execute_cmd(cmd)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/handler.py", line 89, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/init.py", line 531, in call
return fn(*args, **newargs)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/templates/pages/print.py", line 86, in get_html
html = template.render(args, filters={"len": len})
File "/home/frappe/press/benches/1409151105/env/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
return self.environment.handle_exception(exc_info, True)
File "/home/frappe/press/benches/1409151105/env/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/./templates/print_formats/standard.html", line 6, in top-level template code
{{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead) }}
File "/home/frappe/press/benches/1409151105/apps/frappe/frappe/./templates/print_formats/standard_macros.html", line 107, in template

{{ doc.sub_heading if doc.sub_heading != None
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f52447b6-2d2e-4c2c-a137-873fa6802e21%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/897299fa-ff32-471c-8b55-e934ce926a91%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a3803fe-8bd4-43c7-905f-ad9f39f1136a%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.