github-issues-import icon indicating copy to clipboard operation
github-issues-import copied to clipboard

Import issue error with Unicode characters in title

Open provegard opened this issue 12 years ago • 6 comments

I had an issue with a typographic quote in the title, got:

Traceback (most recent call last):
  File "gh-issues-import.py", line 387, in <module>
    import_issues(issues)
  File "gh-issues-import.py", line 356, in import_issues
    print("Successfully created issue '%s'" % result_issue['title'])
  File "c:\python33\lib\encodings\cp850.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u201d' in position 44: character maps to <undefined>

provegard avatar Nov 01 '13 13:11 provegard

Looks like some of Python's functions don't like Unicode characters that much (which is something I really should have tested, being Swedish myself).

Sorry for the delay, I will get on this ASAP!

IQAndreas avatar Nov 10 '13 20:11 IQAndreas

I have been testing around, and it seems to handle unicode characters (and even unescaped backslashes) seem to import just fine on my system (Ubuntu 13.10), so I worry it may be an "operating-system specific" problem.

What operating system are you using, and do you have a link to the issue you tried to import?

IQAndreas avatar Nov 10 '13 20:11 IQAndreas

I'm using Windows. The issue is in a private repo, but I will try to replicate the issue with two public repos.

provegard avatar Nov 17 '13 13:11 provegard

The issue is in a private repo, but I will try to replicate the issue with two public repos.

You are welcome to use the following issue:

  • https://github.com/IQAndreas/github-issues-import/issues/19

And then write to the following repo:

  • https://github.com/IQAndreas-testprojects/github-issues-import-example

With the following command:

$ python3 gh-issues-import.py --source IQAndreas/github-issues-import --target IQAndreas-testprojects/github-issues-import-example --issues 19 --no-config

I haven't tested, but I don't believe you need write-permissions on the target repo in order to open issues there (even with an automated script).

IQAndreas avatar Nov 21 '13 09:11 IQAndreas

I am closing this issue for now since it seems to be resolved, but if you are still having problems with it, please leave a comment, and I will re-open this issue.

IQAndreas avatar Apr 27 '14 00:04 IQAndreas

I'm still having the same issue importing issues between two private repos. The repo being imported into is a fork from the repo being imported from. The issues being imported occasionally contain CJK characters.

Are you sure you wish to continue? [Y/n] Y
Traceback (most recent call last):
  File "C:\github-issues-import-master\gh-issues-import.py", line 445, in <module>
    import_issues(issues)
  File "C:\github-issues-import-master\gh-issues-import.py", line 407, in import_issues
    print("Successfully created issue '%s'" % result_issue['title'])
  File "C:\Python34\lib\encodings\cp437.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u201c' in position
87: character maps to <undefined>

vincenttran18 avatar Aug 13 '14 18:08 vincenttran18