Python 3.8: ERROR: The branch lp:brz has no revision None

Bug #1844684 reported by Miro Hrončok on 2019-09-19
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Breezy
Critical
Jelmer Vernooij

Bug Description

Hello Breezy developers!

We are trying to package breezy for Fedora as a replacement of bazaar. However our Fedora Rawhide (development branch) is already at Python 3.8. I've reproduced the follwoing problem with pip installed breezy:

$ python3 --version
Python 3.8.0b4

$ pip freeze
asn1crypto==0.24.0
bcrypt==3.1.7
breezy==3.0.1
certifi==2018.10.15
cffi==1.12.3
configobj==5.0.6
cryptography==2.7
Cython==0.29.13
distro==1.4.0
dulwich==0.19.12
entrypoints==0.3
fastimport==0.9.8
httplib2==0.13.1
idna==2.8
jeepney==0.4.1
keyring==19.2.0
launchpadlib==1.10.7
lazr.restfulclient==0.14.2
lazr.uri==1.0.3
oauthlib==3.1.0
paramiko==2.6.0
pbr==5.4.3
ply==3.11
pycparser==2.19
PyNaCl==1.3.0
PySocks==1.7.0
SecretStorage==3.1.1
six==1.12.0
testresources==2.0.1
urllib3==1.25.3
wadllib==1.3.3

I needed to unpack breezy-3.0.1.tar.gz from PyPI and remove all the generated Cython C sources with:

$ find . -name '*_pyx.c' -exec rm \{\} \;

Than I could install it via python3 setup.py install.

Here is the problem:

$ brz init-repo brz

Shared repository with trees (format: 2a)
Location:
  shared repository: brz

$ cd brz

$ brz branch lp:brz brz.dev
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
    96kB 14kB/s |
brz: ERROR: The branch lp:brz has no revision None.

I was not able to reproduce this on Python 3.7, only with 3.8.

Hi Miro,

On Thu, Sep 19, 2019 at 02:34:46PM -0000, Miro Hrončok wrote:
> We are trying to package breezy for Fedora as a replacement of bazaar.
> However our Fedora Rawhide (development branch) is already at Python
> 3.8. I've reproduced the follwoing problem with pip installed breezy:
>
> $ python3 --version
> Python 3.8.0b4
>
> $ pip freeze
> asn1crypto==0.24.0
> bcrypt==3.1.7
> breezy==3.0.1
> certifi==2018.10.15
> cffi==1.12.3
> configobj==5.0.6
> cryptography==2.7
> Cython==0.29.13
> distro==1.4.0
> dulwich==0.19.12
> entrypoints==0.3
> fastimport==0.9.8
> httplib2==0.13.1
> idna==2.8
> jeepney==0.4.1
> keyring==19.2.0
> launchpadlib==1.10.7
> lazr.restfulclient==0.14.2
> lazr.uri==1.0.3
> oauthlib==3.1.0
> paramiko==2.6.0
> pbr==5.4.3
> ply==3.11
> pycparser==2.19
> PyNaCl==1.3.0
> PySocks==1.7.0
> SecretStorage==3.1.1
> six==1.12.0
> testresources==2.0.1
> urllib3==1.25.3
> wadllib==1.3.3
>
>
> I needed to unpack breezy-3.0.1.tar.gz from PyPI and remove all the generated Cython C sources with:
>
> $ find . -name '*_pyx.c' -exec rm \{\} \;
>
> Than I could install it via python3 setup.py install.
>
> Here is the problem:
>
> $ brz init-repo brz
>
> Shared repository with trees (format: 2a)
> Location:
> shared repository: brz
>
> $ cd brz
>
> $ brz branch lp:brz brz.dev
> You have not informed bzr of your Launchpad ID, and you must do this to
> write to Launchpad or access private data. See "bzr help launchpad-login".
> 96kB 14kB/s |
> brz: ERROR: The branch lp:brz has no revision None.
>
>
> I was not able to reproduce this on Python 3.7, only with 3.8.

Could you run brz with -Derror?

Jelmer

Miro Hrončok (churchyard) wrote :
Download full text (3.4 KiB)

Traceback (most recent call last):
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/builtins.py", line 1513, in run
    to_dir = br_from.controldir.sprout(
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/bzr/bzrdir.py", line 380, in sprout
    return operation.run(
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/cleanup.py", line 132, in run
    return _do_with_cleanups(
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/bzr/bzrdir.py", line 435, in _sprout
    fetch_spec = fetch_spec_factory.make_fetch_spec()
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/bzr/fetch.py", line 429, in make_fetch_spec
    return vf_search.NotInOtherForRevs(self.target_repo, self.source_repo,
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/bzr/vf_search.py", line 375, in execute
    return self.to_repo.search_missing_revision_ids(
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/repository.py", line 585, in search_missing_revision_ids
    return InterRepository.get(other, self).search_missing_revision_ids(
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/bzr/vf_repository.py", line 2429, in search_missing_revision_ids
    result = self._walk_to_common_revisions(revision_ids,
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/bzr/vf_repository.py", line 2396, in _walk_to_common_revisions
    raise errors.NoSuchRevision(
breezy.errors.NoSuchRevision: CHKInventoryRepository('http://bazaar.launchpad.net/~brz/brz/trunk/.bzr/repository/') has no revision <email address hidden>'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/commands.py", line 1016, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/commands.py", line 1202, in run_bzr
    ret = run(*run_argv)
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/commands.py", line 759, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/commands.py", line 784, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/cleanup.py", line 136, in run_simple
    return _do_with_cleanups(
  File "/usr/local/lib64/python3.8/site-packages/breezy-3.0.1-py3.8-linux-x86_64.egg/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  Fi...

Read more...

Jelmer Vernooij (jelmer) wrote :

Thanks. I'm having trouble reproducing this on Debian. Before we go the docker route, could you perhaps try to run the brz testsuite by running:

$ ./brz selftest

and attaching the output to the bug?

Jelmer Vernooij (jelmer) wrote :

% python3.8 --version
Python 3.8.0b4

Jelmer Vernooij (jelmer) wrote :

Actually, nevermind - I've just reproduced it with python3.8.0b4 on Debian.

Jelmer Vernooij (jelmer) wrote :

looks like python3.8 relies more on hashes - the following change fixes things for me:

=== modified file 'breezy/_static_tuple_c.h'
--- old/breezy/_static_tuple_c.h 2017-05-21 18:10:28 +0000
+++ new/breezy/_static_tuple_c.h 2019-09-20 02:11:42 +0000
@@ -20,7 +20,7 @@
 #include <Python.h>
 #include <string.h>

-#define STATIC_TUPLE_HAS_HASH 0
+#define STATIC_TUPLE_HAS_HASH 1
 /* Caching the hash adds memory, but allows us to save a little time during
  * lookups. TIMEIT hash(key) shows it as
  * 0.108usec w/ hash

I'll propose this as a change tomorrow.

Changed in brz:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Jelmer Vernooij (jelmer)
milestone: none → 3.0.2
Jelmer Vernooij (jelmer) wrote :

Hmm, on further reflection - that appears to just be an optimization (caching the hash), so not sure why it helps in this case.. will dig further tomorrow.

Miro Hrončok (churchyard) wrote :

This haven't fixed the issue for me :(

Jelmer Vernooij (jelmer) wrote :

Hmm. I'll do some more digging. I'm pretty sure it is related to the C extensions, but haven't worked out exactly how yet.

Victor Stinner (vstinner) wrote :
Download full text (18.1 KiB)

I worked on testing Breezy on Python 3.8. I had issues to find how to run tests. And I failed to reproduce the bug.

After many trial-and-error attempts, I found the following commands to run the test suite.

Result: "FAILED (failures=6, errors=7, known_failure_count=66)".

I had to fix 2 syntax errors and replace isAlive() with is_alive(). FYI is_alive() works since Python 2.6, so it's compatible with Python 2.7.

My patch:
================================================================
diff --git a/breezy/bzr/smart/server.py b/breezy/bzr/smart/server.py
index 837c103..ef23166 100644
--- a/breezy/bzr/smart/server.py
+++ b/breezy/bzr/smart/server.py
@@ -267,7 +267,7 @@ class SmartTCPServer(object):
         still_active = []
         for handler, thread in self._active_connections:
             thread.join(timeout)
- if thread.isAlive():
+ if thread.is_alive():
                 still_active.append((handler, thread))
         self._active_connections = still_active

diff --git a/breezy/info.py b/breezy/info.py
index 08e3e96..24fd81a 100644
--- a/breezy/info.py
+++ b/breezy/info.py
@@ -113,7 +113,7 @@ def gather_location_info(repository=None, branch=None, working=None,
             if working_path == master_path_base:
                 locs['checkout of co-located branch'] = params['branch']
             elif 'branch' in params:
- locs['checkout of branch'] = "%s, branch %s" (
+ locs['checkout of branch'] = "%s, branch %s" % (
                     master_path_base, params['branch'])
             else:
                 locs['checkout of branch'] = master_path
diff --git a/breezy/patch.py b/breezy/patch.py
index eee4fe2..446a570 100644
--- a/breezy/patch.py
+++ b/breezy/patch.py
@@ -47,7 +47,7 @@ def write_to_cmd(args, input=""):
     stdout, stderr = process.communicate(input)
     status = process.wait()
     if status < 0:
- raise Exception("%s killed by signal %i" (args[0], -status))
+ raise Exception("%s killed by signal %i" % (args[0], -status))
     return stdout, stderr, status

diff --git a/breezy/tests/test_server.py b/breezy/tests/test_server.py
index 81c2c0f..3a357b0 100644
--- a/breezy/tests/test_server.py
+++ b/breezy/tests/test_server.py
@@ -256,7 +256,7 @@ class TestThread(cethread.CatchingExceptionThread):
         serving a client connection is hung.
         """
         super(TestThread, self).join(timeout)
- if timeout and self.isAlive():
+ if timeout and self.is_alive():
             # The timeout expired without joining the thread, the thread is
             # therefore stucked and that's a failure as far as the test is
             # concerned. We used to hang here.
================================================================

Commands:
=================================
tar -xf breezy-3.0.1.tar.gz
cd breezy-3.0.1/
git apply ~/breezy-python38.patch
find . -name '*_pyx.c' -exec rm \{\} \;
python3.8 -m venv env
# the secret dependency :-)
env/bin/python -m pip install python-subunit
source env/bin/activate
# following commands are run in the venv
python setup.py install
$PWD/env/bin/brz selftest --parallel=fork
===============================...

Victor Stinner (vstinner) wrote :

About the "RuntimeError: Failed to change the filesystem default encoding" error in _patch_filesystem_default_encoding(), IMO brz should re-exec itself (os.execv) to enabled Python 3.7 UTF-8 Mode:
https://www.python.org/dev/peps/pep-0540/

Example:
---
import os
import sys

# FIXME: skip this code on Python 3.6 and older ;-)
if not sys.flags.utf8_mode:
    print("re-exec!")
    argv = [sys.executable, "-X", "utf8"] + sys.argv
    try:
        os.execv(argv[0], argv)
    except Exception:
        print("os.execv failed, too bad: %r" % exc)
        sys.exit(1)

print("UTF-8 Mode:", sys.flags.utf8_mode)
print("filesystem encoding:", sys.getfilesystemencoding())
print("argv:", sys.argv)
---

Output:
---
$ python3 script.py arg1 arg2
re-exec!
UTF-8 Mode: 1
filesystem encoding: utf-8
argv: ['x.py', 'arg1', 'arg2']
---

With the C and POSIX locales, UTF-8 is enabled by default, no need to re-exec:
---
vstinner@apu$ LANG= python3 x.py arg1 arg2
UTF-8 Mode: 1
filesystem encoding: utf-8
argv: ['x.py', 'arg1', 'arg2']
---

Victor Stinner (vstinner) wrote :
Download full text (4.7 KiB)

Miro built a Fedora package of Breezy. I installed it manually on Fedora Rawhide and I finally managed to reproduce the bug!

vstinner@rawhide$ rpm -q breezy
breezy-3.0.1-1.fc32.x86_64

vstinner@rawhide$ brz --version
Breezy (brz) 3.0.1
  Python interpreter: /usr/bin/python3 3.8.0rc1
  Python standard library: /usr/lib64/python3.8
  Platform: Linux-5.4.0-0.rc1.git1.1.fc32.x86_64-x86_64-with-glibc2.2.5
  breezy: /usr/lib64/python3.8/site-packages/breezy
  Breezy configuration: /home/vstinner/.config/breezy
  Breezy log file: /home/vstinner/.brz.log

Copyright 2005-2012 Canonical Ltd.
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.

vstinner@rawhide$ brz init-repo brz
vstinner@rawhide$ cd brz
vstinner@rawhide$ brz branch lp:brz brz.dev
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
brz: ERROR: The branch lp:brz has no revision None.

vstinner@rawhide$ cat ~/.brz.log

this is a debug log for diagnosing/reporting problems in brz
you can delete or truncate this file, or include sections in
bug reports to https://bugs.launchpad.net/brz/+filebug

mer. 2019-10-09 19:00:29 +0200
0.056 encoding stdout as sys.stdout encoding 'utf-8'
0.056 encoding stdout as sys.stdout encoding 'utf-8'
0.057 encoding stdout as sys.stdout encoding 'utf-8'
0.075 breezy version: 3.0.1
0.075 brz arguments: ['branch', 'lp:brz', 'brz.dev']
0.217 encoding stdout as sys.stdout encoding 'utf-8'
[ 1521] 2019-10-09 19:00:30.441 WARNING: You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
10.501 Transferred: 346kB (36.0kB/s r:264kB w:81kB)
10.518 Traceback (most recent call last):
  File "/usr/lib64/python3.8/site-packages/breezy/builtins.py", line 1513, in run
    to_dir = br_from.controldir.sprout(
  File "/usr/lib64/python3.8/site-packages/breezy/bzr/bzrdir.py", line 380, in sprout
    return operation.run(
  File "/usr/lib64/python3.8/site-packages/breezy/cleanup.py", line 132, in run
    return _do_with_cleanups(
  File "/usr/lib64/python3.8/site-packages/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib64/python3.8/site-packages/breezy/bzr/bzrdir.py", line 435, in _sprout
    fetch_spec = fetch_spec_factory.make_fetch_spec()
  File "/usr/lib64/python3.8/site-packages/breezy/bzr/fetch.py", line 429, in make_fetch_spec
    return vf_search.NotInOtherForRevs(self.target_repo, self.source_repo,
  File "/usr/lib64/python3.8/site-packages/breezy/bzr/vf_search.py", line 375, in execute
    return self.to_repo.search_missing_revision_ids(
  File "/usr/lib64/python3.8/site-packages/breezy/repository.py", line 585, in search_missing_revision_ids
    return InterRepository.get(other, self).search_missing_revision_ids(
  File "/usr/l...

Read more...

Download full text (18.9 KiB)

You need to build the (optional) C extensions to reproduce the bug.

On 9 October 2019 17:32:04 CEST, Victor Stinner <email address hidden> wrote:
>I worked on testing Breezy on Python 3.8. I had issues to find how to
>run tests. And I failed to reproduce the bug.
>
>After many trial-and-error attempts, I found the following commands to
>run the test suite.
>
>Result: "FAILED (failures=6, errors=7, known_failure_count=66)".
>
>I had to fix 2 syntax errors and replace isAlive() with is_alive(). FYI
>is_alive() works since Python 2.6, so it's compatible with Python 2.7.
>
>My patch:
>================================================================
>diff --git a/breezy/bzr/smart/server.py b/breezy/bzr/smart/server.py
>index 837c103..ef23166 100644
>--- a/breezy/bzr/smart/server.py
>+++ b/breezy/bzr/smart/server.py
>@@ -267,7 +267,7 @@ class SmartTCPServer(object):
> still_active = []
> for handler, thread in self._active_connections:
> thread.join(timeout)
>- if thread.isAlive():
>+ if thread.is_alive():
> still_active.append((handler, thread))
> self._active_connections = still_active
>
>diff --git a/breezy/info.py b/breezy/info.py
>index 08e3e96..24fd81a 100644
>--- a/breezy/info.py
>+++ b/breezy/info.py
>@@ -113,7 +113,7 @@ def gather_location_info(repository=None,
>branch=None, working=None,
> if working_path == master_path_base:
> locs['checkout of co-located branch'] = params['branch']
> elif 'branch' in params:
>- locs['checkout of branch'] = "%s, branch %s" (
>+ locs['checkout of branch'] = "%s, branch %s" % (
> master_path_base, params['branch'])
> else:
> locs['checkout of branch'] = master_path
>diff --git a/breezy/patch.py b/breezy/patch.py
>index eee4fe2..446a570 100644
>--- a/breezy/patch.py
>+++ b/breezy/patch.py
>@@ -47,7 +47,7 @@ def write_to_cmd(args, input=""):
> stdout, stderr = process.communicate(input)
> status = process.wait()
> if status < 0:
>- raise Exception("%s killed by signal %i" (args[0], -status))
>+ raise Exception("%s killed by signal %i" % (args[0], -status))
> return stdout, stderr, status
>
>
>diff --git a/breezy/tests/test_server.py b/breezy/tests/test_server.py
>index 81c2c0f..3a357b0 100644
>--- a/breezy/tests/test_server.py
>+++ b/breezy/tests/test_server.py
>@@ -256,7 +256,7 @@ class TestThread(cethread.CatchingExceptionThread):
> serving a client connection is hung.
> """
> super(TestThread, self).join(timeout)
>- if timeout and self.isAlive():
>+ if timeout and self.is_alive():
> # The timeout expired without joining the thread, the thread is
> # therefore stucked and that's a failure as far as the test is
> # concerned. We used to hang here.
>================================================================
>
>Commands:
>=================================
>tar -xf breezy-3.0.1.tar.gz
>cd breezy-3.0.1/
>git apply ~/breezy-python38.patch
>find . -name '*_pyx.c' -exec rm \{\} \;
>python3.8 -m venv env
># the secret dependency ...

Victor Stinner (vstinner) wrote :

Oh, Launchpad corrupted my patch when pasted in a comment. So here it is as a patch file.

Victor Stinner (vstinner) wrote :

> You need to build the (optional) C extensions to reproduce the bug.

Oh, it seems like setup.py depends on Cython to build C extension, but it doesn't require it :-(

Workaround:

(env) vstinner@apu$ python -m pip install Cython

Victor Stinner (vstinner) wrote :

Ok, I managed to find the magic commands to reproduce the bug from the tarball on Fedora 30. Shell script:
---
set -x -e
ROOT=$(pwd)
DIR=$ROOT/brz
if [ -e $DIR ]; then
    echo "$DIR exists"
    exit 1
fi

tar -xf breezy-3.0.1.tar.gz
cd breezy-3.0.1/

# git init
# git add .
# git commit -a -m init ||:

git apply ../breezy-python38.patch
find . -name '*_pyx.c' -exec rm \{\} \;
python3.8 -m venv env

env/bin/python -m pip install python-subunit launchpadlib Cython
env/bin/python setup.py install

cd ..
BRZ=$ROOT/breezy-3.0.1/env/bin/brz

$BRZ init-repo $DIR
cd $DIR
$BRZ branch lp:brz brz.dev

# $PWD/env/bin/brz selftest --parallel=fork
---

It needs breezy-python38.patch that I attached to this bug.

Jelmer Vernooij (jelmer) wrote :

On 10 October 2019 09:12:34 CEST, Victor Stinner <email address hidden> wrote:
>> You need to build the (optional) C extensions to reproduce the bug.
>
>Oh, it seems like setup.py depends on Cython to build C extension, but
>it doesn't require it :-(
Yep. The C extensions are optional, breezy works fine without them.

Victor Stinner (vstinner) wrote :
Download full text (4.5 KiB)

Using Python 3.7, I get an error later when using python3.7 -bb.

Attached breezy-osutils.patch fix it.

brz: ERROR: BytesWarning: Comparison between bytes and string

Traceback (most recent call last):
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/commands.py", line 1016, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/commands.py", line 1202, in run_bzr
    ret = run(*run_argv)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/commands.py", line 759, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/commands.py", line 784, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/cleanup.py", line 137, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/builtins.py", line 1518, in run
    create_tree_if_local=not no_tree, source_branch=br_from)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/bzr/bzrdir.py", line 385, in sprout
    create_tree_if_local=create_tree_if_local)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/cleanup.py", line 133, in run
    self.cleanups, self.func, self, *args, **kwargs)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/bzr/bzrdir.py", line 458, in _sprout
    from_branch=result_branch)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/bzr/bzrdir.py", line 926, in create_workingtree
    accelerator_tree=accelerator_tree, hardlink=hardlink)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/bzr/workingtree_4.py", line 1566, in initialize
    delta_from_tree=delta_from_tree)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/transform.py", line 2563, in build_tree
    delta_from_tree)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib6...

Read more...

Victor Stinner (vstinner) wrote :
Victor Stinner (vstinner) wrote :
Download full text (5.3 KiB)

Oh wait, in fact, I get yet another error when using python3.7 with -bb + my patch: "sorry, '' not allowed in path" :-(

Command:

++ /home/vstinner/dev/breezy-3.0.1/env/bin/python -bb /home/vstinner/dev/breezy-3.0.1/env/bin/brz branch lp:brz brz.dev
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
brz: ERROR: sorry, '' not allowed in path

End of ~/.brz.log:

(...)
152.027 24 bytes left on the HTTP socket
152.204 24 bytes left on the HTTP socket
174.938 creating branch <breezy.bzr.branch.BzrBranchFormat7 object at 0x7fd55f901450> in file:///home/vstinner/dev/brz/brz.dev/
174.952 24 bytes left on the HTTP socket
175.133 created new branch BzrBranch7(file:///home/vstinner/dev/brz/brz.dev/)
175.143 trying to create missing lock '/home/vstinner/dev/brz/brz.dev/.bzr/checkout/dirstate'
175.154 opening working tree '/home/vstinner/dev/brz/brz.dev'
175.311 Transferred: 117189kB (670.3kB/s r:116751kB w:438kB)
175.314 Traceback (most recent call last):
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/commands.py", line 1016, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/commands.py", line 1202, in run_bzr
    ret = run(*run_argv)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/commands.py", line 759, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/commands.py", line 784, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/cleanup.py", line 137, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/builtins.py", line 1518, in run
    create_tree_if_local=not no_tree, source_branch=br_from)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/bzr/bzrdir.py", line 385, in sprout
    create_tree_if_local=create_tree_if_local)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/cleanup.py", line 133, in run
    self.cleanups, self.func, self, *args, **kwargs)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python3.7/site-packages/breezy-3.0.1-py3.7-linux-x86_64.egg/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/vstinner/dev/breezy-3.0.1/env/lib64/python...

Read more...

Victor Stinner (vstinner) wrote :

> brz: ERROR: sorry, '' not allowed in path

Oh, this issue is a regression introduced by my breezy-osutils.patch written to fix the python3 -bb error. I don't understand the bug, but you can ignore it ;-)

Victor Stinner (vstinner) wrote :

I removed all C exceptions but _simple_set_pyx.cpython-38-x86_64-linux-gnu.so & _static_tuple_c.cpython-38-x86_64-linux-gnu.so. With these 2 extensions, I still reproduce the issue. If I remove any of these 2 extensions, the bug goes way.

Without removing C extensions, if I modify breezy/static_tuple.py to disable "from ._static_tuple_c import StaticTuple" near the following code, the code also goes away.

try:
    from ._static_tuple_c import StaticTuple
except ImportError as e:
    from . import osutils
    osutils.failed_to_load_extension(e)
    from ._static_tuple_py import StaticTuple

It seems like _static_tuple_c is no longer compatible with Python 3.8.

Jelmer Vernooij (jelmer) wrote :

% python3.8 ./brz selftest -s bt.test__static_tuple
brz selftest: /home/jelmer/src/breezy.old/python3.8/brz
   /home/jelmer/src/breezy.old/python3.8/breezy
   bzr-3.1.0dev1 python-3.8.0rc1 Linux-5.2.0-3-amd64-x86_64-with-glibc2.29

FAIL: test__static_tuple.TestStaticTuple.test_hash(C)est_getitem(C)
    Empty attachments:
  log

Traceback (most recent call last):
  File "/home/jelmer/src/breezy.old/python3.8/breezy/tests/test__static_tuple.py", line 420, in test_hash
    self.assertEqual(hash(k), hash(('foo',)))
  File "/home/jelmer/src/breezy.old/python3.8/breezy/tests/__init__.py", line 1315, in assertEqual
    raise AssertionError("%snot equal:\na = %s\nb = %s\n"
AssertionError: not equal:
a = -8031425178284305495
b = 8409370440341685138

======================================================================ice(python)
FAIL: breezy.tests.test__static_tuple.TestStaticTuple.test_hash(C)
----------------------------------------------------------------------
Traceback (most recent call last):
testtools.testresult.real._StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/home/jelmer/src/breezy.old/python3.8/breezy/tests/test__static_tuple.py", line 420, in test_hash
    self.assertEqual(hash(k), hash(('foo',)))
  File "/home/jelmer/src/breezy.old/python3.8/breezy/tests/__init__.py", line 1315, in assertEqual
    raise AssertionError("%snot equal:\na = %s\nb = %s\n"
AssertionError: not equal:
a = -8031425178284305495
b = 8409370440341685138

----------------------------------------------------------------------
Ran 112 tests in 0.107s

FAILED (failures=1)
2 tests skipped
Missing feature 'meliae.scanner' skipped 4 tests.

Jelmer Vernooij (jelmer) wrote :

I've proposed a fix to address the statictuple issue. There are probably some other deprecation warnings that we need to fix as well.

Jelmer Vernooij (jelmer) on 2019-10-16
Changed in brz:
status: Triaged → Fix Committed
Miro Hrončok (churchyard) wrote :
Download full text (3.3 KiB)

I don't understand launchpad very much, but the proposed fix from https://code.launchpad.net/~jelmer/brz/python3.8-1/+merge/374051 does not solve the original issue:

$ brz init-repo brz && cd brz && brz -Derror branch lp:brz brz.dev
Shared repository with trees (format: 2a)
Location:
  shared repository: brz
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
brz: ERROR: breezy.errors.BzrCommandError: The branch lp:brz has no revision None.

Traceback (most recent call last):
  File "/usr/lib64/python3.8/site-packages/breezy/builtins.py", line 1513, in run
    to_dir = br_from.controldir.sprout(
  File "/usr/lib64/python3.8/site-packages/breezy/bzr/bzrdir.py", line 380, in sprout
    return operation.run(
  File "/usr/lib64/python3.8/site-packages/breezy/cleanup.py", line 132, in run
    return _do_with_cleanups(
  File "/usr/lib64/python3.8/site-packages/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib64/python3.8/site-packages/breezy/bzr/bzrdir.py", line 435, in _sprout
    fetch_spec = fetch_spec_factory.make_fetch_spec()
  File "/usr/lib64/python3.8/site-packages/breezy/bzr/fetch.py", line 429, in make_fetch_spec
    return vf_search.NotInOtherForRevs(self.target_repo, self.source_repo,
  File "/usr/lib64/python3.8/site-packages/breezy/bzr/vf_search.py", line 375, in execute
    return self.to_repo.search_missing_revision_ids(
  File "/usr/lib64/python3.8/site-packages/breezy/repository.py", line 585, in search_missing_revision_ids
    return InterRepository.get(other, self).search_missing_revision_ids(
  File "/usr/lib64/python3.8/site-packages/breezy/bzr/vf_repository.py", line 2429, in search_missing_revision_ids
    result = self._walk_to_common_revisions(revision_ids,
  File "/usr/lib64/python3.8/site-packages/breezy/bzr/vf_repository.py", line 2396, in _walk_to_common_revisions
    raise errors.NoSuchRevision(
breezy.errors.NoSuchRevision: CHKInventoryRepository('http://bazaar.launchpad.net/~brz/brz/trunk/.bzr/repository/') has no revision <email address hidden>'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.8/site-packages/breezy/commands.py", line 1016, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib64/python3.8/site-packages/breezy/commands.py", line 1202, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib64/python3.8/site-packages/breezy/commands.py", line 759, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib64/python3.8/site-packages/breezy/commands.py", line 784, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib64/python3.8/site-packages/breezy/cleanup.py", line 136, in run_simple
    return _do_with_cleanups(
  File "/usr/lib64/python3.8/site-packages/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, *...

Read more...

Jelmer Vernooij (jelmer) wrote :
Download full text (3.8 KiB)

Did you trigger a rebuild of the C extensions?

On 17 October 2019 10:54:17 BST, "Miro Hrončok" <email address hidden> wrote:
>I don't understand launchpad very much, but the proposed fix from
>https://code.launchpad.net/~jelmer/brz/python3.8-1/+merge/374051 does
>not solve the original issue:
>
>$ brz init-repo brz && cd brz && brz -Derror branch lp:brz brz.dev
>Shared repository with trees (format: 2a)
>Location:
> shared repository: brz
>You have not informed bzr of your Launchpad ID, and you must do this to
>write to Launchpad or access private data. See "bzr help
>launchpad-login".
>brz: ERROR: breezy.errors.BzrCommandError: The branch lp:brz has no
>revision None.
>
>
>Traceback (most recent call last):
>File "/usr/lib64/python3.8/site-packages/breezy/builtins.py", line
>1513, in run
> to_dir = br_from.controldir.sprout(
>File "/usr/lib64/python3.8/site-packages/breezy/bzr/bzrdir.py", line
>380, in sprout
> return operation.run(
>File "/usr/lib64/python3.8/site-packages/breezy/cleanup.py", line 132,
>in run
> return _do_with_cleanups(
>File "/usr/lib64/python3.8/site-packages/breezy/cleanup.py", line 166,
>in _do_with_cleanups
> result = func(*args, **kwargs)
>File "/usr/lib64/python3.8/site-packages/breezy/bzr/bzrdir.py", line
>435, in _sprout
> fetch_spec = fetch_spec_factory.make_fetch_spec()
>File "/usr/lib64/python3.8/site-packages/breezy/bzr/fetch.py", line
>429, in make_fetch_spec
> return vf_search.NotInOtherForRevs(self.target_repo, self.source_repo,
>File "/usr/lib64/python3.8/site-packages/breezy/bzr/vf_search.py", line
>375, in execute
> return self.to_repo.search_missing_revision_ids(
>File "/usr/lib64/python3.8/site-packages/breezy/repository.py", line
>585, in search_missing_revision_ids
> return InterRepository.get(other, self).search_missing_revision_ids(
>File "/usr/lib64/python3.8/site-packages/breezy/bzr/vf_repository.py",
>line 2429, in search_missing_revision_ids
> result = self._walk_to_common_revisions(revision_ids,
>File "/usr/lib64/python3.8/site-packages/breezy/bzr/vf_repository.py",
>line 2396, in _walk_to_common_revisions
> raise errors.NoSuchRevision(
>breezy.errors.NoSuchRevision:
>CHKInventoryRepository('http://bazaar.launchpad.net/~brz/brz/trunk/.bzr/repository/')
>has no revision
><email address hidden>'
>
>During handling of the above exception, another exception occurred:
>
>Traceback (most recent call last):
>File "/usr/lib64/python3.8/site-packages/breezy/commands.py", line
>1016, in exception_to_return_code
> return the_callable(*args, **kwargs)
>File "/usr/lib64/python3.8/site-packages/breezy/commands.py", line
>1202, in run_bzr
> ret = run(*run_argv)
>File "/usr/lib64/python3.8/site-packages/breezy/commands.py", line 759,
>in run_argv_aliases
> return self.run(**all_cmd_args)
>File "/usr/lib64/python3.8/site-packages/breezy/commands.py", line 784,
>in run
> return self._operation.run_simple(*args, **kwargs)
>File "/usr/lib64/python3.8/site-packages/breezy/cleanup.py", line 136,
>in run_simple
> ret...

Read more...

Miro Hrončok (churchyard) wrote :

I have rebuild the entire thing in a clear chroot. Can share the buildlogs if interested.

Miro Hrončok (churchyard) wrote :

BTW the change only changes breezy/osutils.py - no C extensions code. Is that correct?

Jelmer Vernooij (jelmer) wrote :

That's Victor's change. Mine is here: https://code.launchpad.net/~jelmer/brz/python3.8/+merge/374164

On 17 October 2019 11:32:25 BST, "Miro Hrončok" <email address hidden> wrote:
>BTW the change only changes breezy/osutils.py - no C extensions code.
>Is
>that correct?
>
>--
>You received this bug notification because you are a bug assignee.
>https://bugs.launchpad.net/bugs/1844684
>
>Title:
> Python 3.8: ERROR: The branch lp:brz has no revision None
>
>To manage notifications about this bug go to:
>https://bugs.launchpad.net/brz/+bug/1844684/+subscriptions

Miro Hrončok (churchyard) wrote :

Works. Thanks!

Vincent Ladeuil (vila) on 2019-11-19
Changed in brz:
milestone: 3.0.2 → none
Jelmer Vernooij (jelmer) on 2019-11-20
Changed in brz:
milestone: none → 3.0.2
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers