8000 Comparing blueman-project:main...epilys:main · blueman-project/blueman · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: blueman-project/blueman
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: epilys/blueman
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Sep 12, 2024

  1. Rfcomm.py: convert port_id gdouble/float to int

    When connecting to a serial port from blueman the following exception is
    raised because port_id in OpenRFCOMM is passed as Glib.Variant gdouble `d`:
    
      Connection Failed: File "/usr/lib/python3/dist-packages/blueman/main/DbusService.py", line 154, in _handle_method_call
          method(*(args + (ok, lambda exception: self._return_dbus_error(invocation, exception))))
        File "/usr/lib/python3/dist-packages/blueman/plugins/applet/DBusService.py", line 93, in connect_service
          service.connect(reply_handler=lambda port: ok(), error_handler=err)
        File "/usr/lib/python3/dist-packages/blueman/services/meta/SerialService.py", line 104, in connect
          Mechanism().OpenRFCOMM('(d)', port_id)
        File "/usr/lib/python3/dist-packages/gi/overrides/Gio.py", line 349, in __call__
          result = self.dbus_proxy.call_sync(self.method_name, arg_variant,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      gi.repository.GLib.GError: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.Failed: Traceback (most recent call last):
        File "/usr/lib/python3/dist-packages/blueman/main/DbusService.py", line 156, in _handle_method_call
          ok(method(*args))
             ^^^^^^^^^^^^^
        File "/usr/lib/python3/dist-packages/blueman/plugins/mechanism/Rfcomm.py", line 14, in _open_rfcomm
          subprocess.Popen([RFCOMM_WATCHER_PATH, f"/dev/rfcomm{port_id:d}"])
                                                              ^^^^^^^^^^^
      ValueError: Unknown format code 'd' for object of type 'float'
       (0)
    
    Similar thing happens to CloseRFCOMM.
    
    Change the typing annotation to allow for Union of float+int and explicitly
    convert to int by calling int(port_id).
    
    Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
    epilys committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    78634c6 View commit details
    Browse the repository at this point in the history
Loading
0