question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

utf8 error by importing mercurial repository

See original GitHub issue

When importing repository in the os.mbed.com (Mercurial), I got following problem in my PC (Japanese Windows 7).

PS C:\Users\toyom> mbed --version
1.7.3
PS C:\Users\toyom> mbed import https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-blinky/
[mbed] Importing program "mbed-os-example-blinky" from "https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-blinky" at latest revision in the current branch
[mbed] ERROR: Unknown Error: 'utf8' codec can't decode byte 0x91 in position 0: invalid start byte
---

There is no problem importing GitHub repositiry.

PS C:\Users\toyom> mbed import https://github.com/ARMmbed/mbed-os-example-blinky
[mbed] Importing program "mbed-os-example-blinky" from "https://github.com/ARMmbed/mbed-os-example-blinky" at latest revision in the current branch
[mbed] Adding library "mbed-os" from "https://github.com/ARMmbed/mbed-os" at rev #03196b244ee0
PS C:\Users\toyom>

Also, mbed-cli v1.6.0 did not have this problem.

PS C:\Users\toyom> mbed --version
1.6.0
PS C:\Users\toyom> mbed import https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-blinky
[mbed] Importing program "mbed-os-example-blinky" from "https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-blinky" at latest revision in the current branch
[mbed] Adding library "mbed-os" from "https://github.com/ARMmbed/mbed-os" at rev #03196b244ee0
PS C:\Users\toyom>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
toyowatacommented, Oct 2, 2018

@screamerbg @cmonr

Interestingly, after I put -vv option for the Mbed-CLI, I could import the repository successfully. I can now import any mercurial repos without any problem. This is strange.

Imported log file is here: mbed_import.txt

[Python version]

PS C:\test> python --version
Python 2.7.15

[pip list]

PS C:\test> pip list --verbose
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
appdirs (1.4.3)
astroid (1.6.3)
backports.functools-lru-cache (1.5)
beautifulsoup4 (4.6.0)
certifi (2018.4.16)
chardet (3.0.4)
colorama (0.3.9)
configparser (3.5.0)
enum34 (1.1.6)
fasteners (0.14.1)
funcsigs (1.0.2)
functools32 (3.2.3.post2)
future (0.16.0)
futures (3.2.0)
fuzzywuzzy (0.16.0)
idna (2.6)
intelhex (2.2.1)
intervaltree (2.1.0)
isort (4.3.4)
Jinja2 (2.10)
jsonschema (2.6.0)
junit-xml (1.8)
lazy-object-proxy (1.3.1)
lockfile (0.12.2)
MarkupSafe (1.0)
mbed-cli (1.7.3)
mbed-greentea (1.4.0)
mbed-host-tests (1.3.1)
mbed-ls (1.4.6)
mccabe (0.6.1)
mock (2.0.0)
monotonic (1.5)
pbr (4.0.4)
pip (9.0.3)
prettytable (0.7.2)
project-generator (0.9.11)
project-generator-definitions (0.2.35)
pyelftools (0.24)
pylint (1.8.4)
pyOCD (0.10.0)
pyserial (3.4)
pyusb (1.0.2)
pywinusb (0.4.2)
PyYAML (3.12)
requests (2.18.4)
setuptools (39.0.1)
singledispatch (3.4.0.3)
six (1.11.0)
sortedcontainers (2.0.4)
urllib3 (1.22)
websocket-client (0.48.0)
wrapt (1.10.11)
xmltodict (0.11.0)
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

[Mirrored to Jira]

0reactions
theotherjimmycommented, Oct 2, 2018

@screamerbg We could resolve this issue by changing the return value from a decoded string into a raw bytes object. Then we would have to use bytes regex to process it. We could also use a replacing decoder, but this looks like it’s related to cloning, so that may not work as expected. [Mirrored to Jira]

Read more comments on GitHub >

github_iconTop Results From Across the Web

bazaar - Bzr: Can't import Mercurial (Hg) Repository due to UTF-8 ...
This error occurs because there is data in the input stream that is not valid utf8; Mercurial usually stores only utf8 data, but...
Read more >
UTF-8 error blocking import of Mercurial (hg) repository - Launchpad ...
I have a Mercurial repository with about 2100 commits. It exported successfully to the fast-import format (about 53 GB). However, when I try...
Read more >
Mercurial: Repository path encoding of non UTF-8 characters
Running: ruby script/runner "Repository.fetch_changesets" -e production gives the following errors: /home/redmine/redmine-0.8.0/vendor/rails/railties/lib ...
Read more >
⚓ T7339 Raise a setup warning when the "en_US.UTF-8 ...
Looking at the Mercurial repository on the server directly (using hg log), the umlauts are displayed properly. I have set LANG=en_GB.UTF-8 on my...
Read more >
EncodingStrategy - Mercurial
byte string in local encoding (messages, user input); byte string in UTF-8 encoding (repository metadata). This page sorts out which type of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found