Attempting to import a patch with binary data from the clipboard fails with exception
Created originally on Bitbucket by chphilli (Chris Phillips)
While trying to copy some working directory changes from one repository to another, I used the "copy patch" feature in the source repository and the "import" "from clipboad" feature to add the change to the destination repository. This attempt failed with the exception below.
Some of the files in the changes were binary .dll and .pdb files, so I assume that was the source of the problem. However, it seems like the tool should at the very least just respond with a message stating that binary files can't be handled like this rather than throwing an exception traceback up to the user. (Of course, it would be even better if the import actually could be done this way!)
For reference, exporting this same set of changes via "hg diff -a > patch" and then using THG to import this saved patch from disk worked just fine.
{{{ #!python ** Mercurial version (1.8.3). TortoiseHg version (2.0.4) ** Command: ** CWD: C:\Windows\system32 ** Extensions loaded: fixfrozenexts, fetch, gestalt, kilnauth, kilnpath, big-push, kiln, caseguard, kbfiles, purge, churn, extdiff, graphlog, mq, rebase ** Python version: 2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit (AMD64)] ** Windows version: (6, 1, 7601, 2, 'Service Pack 1') ** Processor architecture: x64 ** Qt-4.7.1 PyQt-4.8.3 Traceback (most recent call last): File "tortoisehg\hgqt\thgimport.pyo", line 197, in getcliptext File "tortoisehg\util\hglib.pyo", line 75, in fromunicode File "encodings\cp1252.pyo", line 12, in encode UnicodeEncodeError: 'charmap' codec can't encode character u'\ufeff' in position 423: character maps to
}}}