Non-UTF-8 code starting with '\xd1', but no encoding declared

Bug #1940752 reported by Emanuel Angelo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Breezy
Triaged
Medium
Martin Packman

Bug Description

After building the version with the entry point as a rust binary, when I try to run it I get this error message:

SyntaxError: Non-UTF-8 code starting with '\xd1' in file /home/user/breezy/brz on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 21.04
Release: 21.04
Codename: hirsute

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

How are you trying to run brz?

Revision history for this message
Emanuel Angelo (emansije) wrote (last edit ):

In a folder in $PATH I have a link to the binary in the brz branch. I also have the bzr package installed from the ubuntu's repositories, but the previous has priority over the latter. I tried to cd into the breezy branch folder and run breezy from there. It didn't throw an error this time:

$ cd ~/breezy
$ ./brz version
brz: WARNING: breezy version doesn't match the brz program.
  This may indicate an installation problem.
  breezy version is 3.1.0
  brz version is 3.3.0

Breezy (brz) 3.1.0
  Python interpreter: /usr/bin/python3 3.9.5
  Python standard library: /usr/lib/python3.9
  Platform: Linux-5.11.0-25-generic-x86_64-with-glibc2.33
  breezy: /usr/lib/python3/dist-packages/breezy
  Breezy configuration: /home/user/.config/breezy
  Breezy log file: /home/user/.cache/breezy/brz.log

Copyright 2005-2012 Canonical Ltd.
Copyright 2017-2020 Breezy developers
https://www.breezy-vcs.org/

brz comes with ABSOLUTELY NO WARRANTY. brz is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

---

I guess I should have installed breezy from the development branch instead of running the binary directly from the branch folder. What would be the best way to install the development branch without interfering with the version from the ubuntu's repositories?

Revision history for this message
Martin Packman (gz) wrote :

Ah, this is easy_install screwing things up then. That installation doesn't actually place the brz script in the bin on path dir, but a stub like this instead:

```
#!/usr/bin/python3
# EASY-INSTALL-SCRIPT: 'breezy==3.2.1','brz'
__requires__ = 'breezy==3.2.1'
__import__('pkg_resources').run_script('breezy==3.2.1', 'brz')
```

So, if that stub gets called but then pkg_resources finds the new binary, it's going to lead to this unhappiness. Fix is probably a bit of migration docs and suggestions to pip uninstall previous versions?

Jelmer Vernooij (jelmer)
Changed in brz:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Martin Packman (gz)
Jelmer Vernooij (jelmer)
Changed in brz:
milestone: none → 4.0.0
importance: Low → Medium
Jelmer Vernooij (jelmer)
Changed in brz:
milestone: 4.0.0 → 3.3.1
status: Triaged → Fix Released
status: Fix Released → Triaged
Jelmer Vernooij (jelmer)
Changed in brz:
milestone: 3.3.1 → 3.3.2
Jelmer Vernooij (jelmer)
Changed in brz:
milestone: 3.3.2 → 3.3.3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.