【问题标题】:Mercurial Review board UnicodeEncodeError: 'charmap' codec can't encode character u'\ufffd' in position 31: character maps to <undefined>Mercurial Review board UnicodeEncodeError: 'charmap' codec can't encode character u'\ufffd' in position 31: character maps to <undefined>
【发布时间】:2018-06-26 06:24:42
【问题描述】:

我似乎在 mercurial(使用 Notepad++)中打开了其中一个 .py 文件,只是出于好奇检查 mercurial hg 扩展的工作原理,我现在无法使用审查板:这是我面临的错误..我什至替换了 reviewboard 文件夹,但似乎编译的 python 文件正在创建一个问题。 如果有某种方法可以重新编译这些以重置编码,我会很高兴:

chcp 65001
set PYTHONIOENCODING=utf-8

我还尝试按照一些帖子中的建议在我的 Windows 命令行上设置编码以解决编码问题:

#!python
** Mercurial version (4.6.1).  TortoiseHg version (4.6.1)
** Command: --nofork workbench
** CWD: C:\hiteshi\Latest\GM_dev
** Encoding: cp1252
** Extensions loaded: fetch, gestalt, kilnauth, big-push, kiln, caseguard, hgflow, strip, mq, reviewboard, histedit, shelve, largefiles, tortoisehg.util.configitems
** Python version: 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)]
** Windows version: sys.getwindowsversion(major=6, minor=2, build=9200, platform=2, service_pack='')
** Processor architecture: x64
** Qt-5.9.2 PyQt-5.9.1 QScintilla-2.10.2.dev1711012104
Traceback (most recent call last):
  File "tortoisehg\hgqt\postreview.pyo", line 361, in accept
  File "tortoisehg\hgqt\postreview.pyo", line 274, in postReviewOpts
  File "tortoisehg\hgqt\postreview.pyo", line 263, in getSummary
  File "tortoisehg\util\hglib.pyo", line 117, in fromunicode
  File "encodings\cp1252.pyo", line 12, in encode
UnicodeEncodeError: 'charmap' codec can't encode character u'\ufffd' in position 31: character maps to <undefined>

【问题讨论】:

  • 你能重新安装 Mercurial 来解决这个问题吗?
  • 正要这样做,但想问是否有办法以更好的方式做到这一点,花费更少的时间..还是谢谢..
  • 我们遇到了这个问题,Tortoise Hg 更新版本(4.6)与 REview board 版本不兼容,似乎这个问题已经在 Tortoise Hg 论坛上提出了。解决方案 1)将 Hg 恢复为4.5 之前的版本。 2) 使用“导出到补丁”选项手动更新审查委员会

标签: python python-3.x python-2.7 mercurial


【解决方案1】:

我们遇到了问题,Tortoise Hg 更新版本(4.6)与 REview board 版本不兼容,似乎这个问题已经在 Tortoise Hg 论坛上提出。解决方案 1)将 Hg 恢复到之前的 4.5 版本。 2) 使用“导出到补丁”选项手动更新审查委员会

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-27
    • 2018-04-18
    • 1970-01-01
    • 2017-05-10
    • 2018-08-14
    • 2014-09-27
    相关资源
    最近更新 更多