Cannot copy worksheets with non-ascii titles

Issue #773 resolved
eson
created an issue
Traceback (most recent call last):
  File "create_temp.py", line 236, in <module>
    CopySheet(wb,sn, "12")
  File "create_temp.py", line 168, in CopySheet
    s = wb.copy_worksheet(ws)
  File "/usr/lib/python2.7/site-packages/openpyxl/workbook/workbook.py", line 364, in copy_worksheet
    new_title = "{0} Copy".format(from_worksheet.title)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-4: ordinal not in range(128)

"{0} Copy".format(from_worksheet.title) replace with u"{0} Copy".format(from_worksheet.title) 
that is working well

Comments (3)

  1. Log in to comment