gio transport doesn't work

Bug #1968415 reported by Flavio Barbara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Breezy
New
Undecided
Unassigned

Bug Description

brz init-shared-repo gio+dav:a_dav_url: Unable to import library "glib": No module named 'glib'

It seems that the interface to gio and glib modules is changed and
they can no more be imported in this way:

import glib
import gio

As I can see, something like

from gi.repository import Gio as gio

should be used, instead.
The whole interface has been modified since replacing the old
import statement an error is reported because of a wrong
initialization of the Gio.File.

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

Do you use the gio transport? Because it's been broken since breezy was created, I'm inclined to just remove it.

Revision history for this message
Apteryx (maxco) wrote :
Download full text (10.8 KiB)

If it was already broken, then yes it'd be better to remove it. Not only it breaks byte compiling tehpackage, it also breaks the test suite, even with the pull request fixing the build applied:

```
======================================================================
FAIL: breezy.tests.per_transport.TransportTests.test_has(GioTransport,GioLocalURLServer)
tags: worker-9
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/transport/gio_transport.py", line 212, in _create_connection
    connection = gio.File(self.url)
TypeError: GInterface.__init__() takes exactly 0 arguments (1 given)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/transport/gio_transport.py", line 309, in put_file
    f = self._get_GIO(tmppath)
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/transport/gio_transport.py", line 152, in _get_GIO
    connection, credentials = self._create_connection()
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/transport/gio_transport.py", line 230, in _create_connection
    except gio.Error as e:
  File "/gnu/store/44a8ghndc3p0c14jb65dgfr1mxblfm3m-python-pygobject-3.40.1/lib/python3.9/site-packages/gi/overrides/__init__.py", line 32, in __getattr__
    return getattr(self._introspection_module, name)
  File "/gnu/store/44a8ghndc3p0c14jb65dgfr1mxblfm3m-python-pygobject-3.40.1/lib/python3.9/site-packages/gi/module.py", line 123, in __getattr__
    raise AttributeError("%r object has no attribute %r" % (
AttributeError: 'gi.repository.Gio' object has no attribute 'Error'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/tests/per_transport.py", line 149, in test_has
    self.build_tree(files, transport=t)
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/tests/__init__.py", line 2937, in build_tree
    transport.put_bytes_non_atomic(urlutils.escape(name), content)
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/transport/__init__.py", line 898, in put_bytes_non_atomic
    self.put_file_non_atomic(relpath, BytesIO(raw_bytes), mode=mode,
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/transport/__init__.py", line 934, in put_file_non_atomic
    return self.put_file(relpath, f, mode=mode)
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/transport/gio_transport.py", line 322, in put_file
    except gio.Error as e:
  File "/gnu/store/44a8ghndc3p0c14jb65dgfr1mxblfm3m-python-pygobject-3.40.1/lib/python3.9/site-packages/gi/overrides/__init__.py", line 32, in __getattr__
    return getattr(self._introspection_module, name)
  File "/gnu/store/44a8ghndc3p0c14jb65dgfr1mxblfm3m-python-pygobject-3.40.1/lib/python3.9/site-packages/gi/module.py", line 123, in __getattr__
    raise AttributeError("%r object has no attribute %r" % (
AttributeError: 'gi.repository.Gio' object has no attribute 'Error'
============================...

Revision history for this message
Apteryx (maxco) wrote :

Oh, nevermind, I was missing this patch: https://bazaar.launchpad.net/~jelmer/brz/fix-gio/revision/7570.

Revision history for this message
Apteryx (maxco) wrote :
Download full text (3.8 KiB)

I have this test failure now:
```
running=PYTHONPATH=`pwd`:$PYTHONPATH BRZ_PLUGIN_PATH=-site:-user ./brz selftest --subunit2
======================================================================
FAIL: breezy.bzr.tests.test_read_bundle.TestReadMergeableBundleFromURL.test_read_fail(GioTransport,GioLocalURLServer)
tags: worker-0
----------------------------------------------------------------------
log: {{{
107.096 creating repository in file:///tmp/guix-build-breezy-3.2.2.drv-0/testbzr-7s_jteq5.tmp/breezy.bzr.tests.test_read_bundle.TestReadMergeableBundleFromURL.test_read_fail%28GioTransport%2CGioLocalURLServer%29/work/tree/.bzr/.
107.097 creating branch <breezy.bzr.branch.BzrBranchFormat7 object at 0x7fffd6983970> in file:///tmp/guix-build-breezy-3.2.2.drv-0/testbzr-7s_jteq5.tmp/breezy.bzr.tests.test_read_bundle.TestReadMergeableBundleFromURL.test_read_fail%28GioTransport%2CGioLocalURLServer%29/work/tree/
107.101 trying to create missing lock '/tmp/guix-build-breezy-3.2.2.drv-0/testbzr-7s_jteq5.tmp/breezy.bzr.tests.test_read_bundle.TestReadMergeableBundleFromURL.test_read_fail(GioTransport,GioLocalURLServer)/work/tree/.bzr/checkout/dirstate'
107.101 opening working tree '/tmp/guix-build-breezy-3.2.2.drv-0/testbzr-7s_jteq5.tmp/breezy.bzr.tests.test_read_bundle.TestReadMergeableBundleFromURL.test_read_fail(GioTransport,GioLocalURLServer)/work/tree'
107.107 preparing to commit
    INFO Committing to: /tmp/guix-build-breezy-3.2.2.drv-0/testbzr-7s_jteq5.tmp/breezy.bzr.tests.test_read_bundle.TestReadMergeableBundleFromURL.test_read_fail(GioTransport,GioLocalURLServer)/work/tree/
107.108 Selecting files for commit with filter None
    INFO added a
    INFO added subdir
    INFO Committed revision 1.
107.114 Committed revid b'commit-1' as revno 1.
    INFO Bundling 1 revision.
107.121 Put to: gio+file:///tmp/guix-build-breezy-3.2.2.drv-0/testbzr-7s_jteq5.tmp/breezy.bzr.tests.test_read_bundle.TestReadMergeableBundleFromURL.test_read_fail%28GioTransport%2CGioLocalURLServer%29/work/test_bundle
}}}

Traceback (most recent call last):
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/bzr/tests/test_read_bundle.py", line 98, in test_read_fail
    self.assertRaises(errors.NotABundle,
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/tests/__init__.py", line 1472, in assertRaises
    callableObj(*args, **kwargs)
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/bzr/tests/test_read_bundle.py", line 72, in read_mergeable_from_url
    return breezy.mergeable.read_mergeable_from_url(
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/mergeable.py", line 64, in read_mergeable_from_url
    mergeable, transport = read_mergeable_from_transport(transport, filename,
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/mergeable.py", line 82, in read_mergeable_from_transport
    bytef, transport = _mod_transport.do_catching_redirections(
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/transport/__init__.py", line 1613, in do_catching_redirections
    return action(transport)
  File "/tmp/guix-build-breezy-3.2.2.drv-0/breezy-3.2.2/breezy/mergeable.py", line 71, in get_bundle
    r...

Read more...

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.