libusb stress_mt.c conversion to pyusb

Today I am trying out using ChatGPT to convert libusb test/stress_mt.c to more portable codes.
One exercise is to convert it to pyusb.
Here is the converted code and it seems to run at the first try.
import threading
import usb.core
import usb.util

NUM_THREADS = 16
NUM_ITERATIONS = 10000

class MyThread(threading.Thread):
    def __init__(self, thread_id, dev):
        super().__init__()
        self.thread_id = thread_id
        self.dev = dev
        self.rc = 0

    def run(self):
        for i in range(NUM_ITERATIONS):
            try:
                usb.util.get_string(self.dev, 1)
            except usb.core.USBError as e:
                self.rc = e.errno
                break

    def get_rc(self):
        return self.rc

def main():
    dev = usb.core.find()
    if dev is None:
        print('No USB device found')
        return 1

    threads = []
    for i in range(NUM_THREADS):
        threads.append(MyThread(i, dev))

    for thread in threads:
        thread.start()

    for thread in threads:
        thread.join()
        if thread.get_rc() != 0:
            print(f'Thread {thread.thread_id} failed with error code {thread.get_rc()}')
            return 1

    print('All threads completed successfully')

if __name__ == '__main__':
    main()

I think it successfully runs, but there are a few  NotImplementedError: Operation not supported or unimplemented on this platform error messages under Windows.
@jonasmalacofilho
Are they real problems or not?
(py310x64venv) PS C:\work\libusb\libusb_test\stress_mt_python> python .\stress_mt_pyusb.py
libusb: info [winusbx_init] WinUSB DLL available (with isoch support)
libusb: info [windows_init] UsbDk backend is not available
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
Exception in thread Thread-3:
Traceback (most recent call last):
Exception in thread Thread-4:
Traceback (most recent call last):
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
Exception in thread Thread-6:
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
Exception in thread Thread-5:
    self.run()
Traceback (most recent call last):
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
Exception in thread Thread-9:
Traceback (most recent call last):
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
Exception in thread Thread-8:
Exception in thread Thread-7:
Traceback (most recent call last):
Exception in thread Thread-10:
Traceback (most recent call last):
Exception in thread Thread-14:
Traceback (most recent call last):
    self.run()
Exception in thread Thread-15:
Traceback (most recent call last):
Exception in thread Thread-12:
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
Traceback (most recent call last):
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
Exception in thread Thread-13:
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
    self.run()
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
Traceback (most recent call last):
Traceback (most recent call last):
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    usb.util.get_string(self.dev, 1)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
    usb.util.get_string(self.dev, 1)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
    self.run()
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
Exception in thread Thread-16:
Traceback (most recent call last):
    self.run()
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
Traceback (most recent call last):
    langids = dev.langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    self.run()
    self.run()
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
    self.run()
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
    langids = dev.langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
Exception in thread Thread-11:
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
    self.run()
    usb.util.get_string(self.dev, 1)
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    usb.util.get_string(self.dev, 1)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
    usb.util.get_string(self.dev, 1)
    self.run()
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
Traceback (most recent call last):
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
    usb.util.get_string(self.dev, 1)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
    self.run()
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
    self._langids = util.get_langids(self)
    langids = dev.langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
    usb.util.get_string(self.dev, 1)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
    self.run()
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
    usb.util.get_string(self.dev, 1)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
    usb.util.get_string(self.dev, 1)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
    langids = dev.langids
    self._langids = util.get_langids(self)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
    self.run()
    usb.util.get_string(self.dev, 1)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
    langids = dev.langids
    usb.util.get_string(self.dev, 1)
    langids = dev.langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    usb.util.get_string(self.dev, 1)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
    self._langids = util.get_langids(self)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
    langids = dev.langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    usb.util.get_string(self.dev, 1)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    langids = dev.langids
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
    langids = dev.langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    langids = dev.langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    self.run()
  File "C:\work\libusb\libusb_test\stress_mt_python\stress_mt_pyusb.py", line 18, in run
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
    usb.util.get_string(self.dev, 1)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
    desc = dev.ctrl_transfer(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
    langids = dev.langids
    usb.util.get_string(self.dev, 1)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
    langids = dev.langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    langids = dev.langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    self._langids = util.get_langids(self)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
    usb.util.get_string(self.dev, 1)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 311, in get_string
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    desc = dev.ctrl_transfer(
    self._langids = util.get_langids(self)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
    self._langids = util.get_langids(self)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
    desc = dev.ctrl_transfer(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
    self._langids = util.get_langids(self)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
    self._langids = util.get_langids(self)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
    self._ctx.managed_open()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    self._langids = util.get_langids(self)
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
    self._langids = util.get_langids(self)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
    langids = dev.langids
    self._langids = util.get_langids(self)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
    self._langids = util.get_langids(self)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
    self._ctx.managed_open()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    self._langids = util.get_langids(self)
    return f(self, *args, **kwargs)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    langids = dev.langids
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
    desc = dev.ctrl_transfer(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
    desc = dev.ctrl_transfer(
    self._ctx.managed_open()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
    desc = dev.ctrl_transfer(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
    desc = dev.ctrl_transfer(
    self.handle = self.backend.open_device(self.dev)
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
    desc = dev.ctrl_transfer(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
    return f(self, *args, **kwargs)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
    langids = dev.langids
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    self._langids = util.get_langids(self)
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
    self._ctx.managed_open()
    desc = dev.ctrl_transfer(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
    self.handle = self.backend.open_device(self.dev)
    desc = dev.ctrl_transfer(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 851, in langids
    desc = dev.ctrl_transfer(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
    self._ctx.managed_open()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    self._langids = util.get_langids(self)
    return f(self, *args, **kwargs)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
    desc = dev.ctrl_transfer(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
    self._langids = util.get_langids(self)
    self._ctx.managed_open()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    self._ctx.managed_open()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    self._ctx.managed_open()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    desc = dev.ctrl_transfer(
    self._ctx.managed_open()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    self._ctx.managed_open()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
    return _DeviceHandle(dev)
    self._ctx.managed_open()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    self._ctx.managed_open()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
    return f(self, *args, **kwargs)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
  File "C:\work\python\py310x64venv\lib\site-packages\usb\util.py", line 266, in get_langids
    return f(self, *args, **kwargs)
    return _DeviceHandle(dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
    return f(self, *args, **kwargs)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
    return f(self, *args, **kwargs)
    self.handle = self.backend.open_device(self.dev)
    self.handle = self.backend.open_device(self.dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    self._ctx.managed_open()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
    desc = dev.ctrl_transfer(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    self.handle = self.backend.open_device(self.dev)
    self.handle = self.backend.open_device(self.dev)
    self.handle = self.backend.open_device(self.dev)
    return f(self, *args, **kwargs)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
    self.handle = self.backend.open_device(self.dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    return f(self, *args, **kwargs)
    return _DeviceHandle(dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    self.handle = self.backend.open_device(self.dev)
    return f(self, *args, **kwargs)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
    self.handle = self.backend.open_device(self.dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    return _DeviceHandle(dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    self._ctx.managed_open()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    desc = dev.ctrl_transfer(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
    self.handle = self.backend.open_device(self.dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    buf = get_descriptor(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\control.py", line 172, in get_descriptor
    return _DeviceHandle(dev)
    return _DeviceHandle(dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
    raise NotImplementedError(_strerror(ret))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    return _DeviceHandle(dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
    return _DeviceHandle(dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
NotImplementedError: Operation not supported or unimplemented on this platform
    return _DeviceHandle(dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
    return _DeviceHandle(dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
    self.handle = self.backend.open_device(self.dev)
    return f(self, *args, **kwargs)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
    self._ctx.managed_open()
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
    return _DeviceHandle(dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    desc = dev.ctrl_transfer(
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    raise NotImplementedError(_strerror(ret))
    raise NotImplementedError(_strerror(ret))
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    self.handle = self.backend.open_device(self.dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    return f(self, *args, **kwargs)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
    raise NotImplementedError(_strerror(ret))
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
    raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
    raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
NotImplementedError: Operation not supported or unimplemented on this platform
    self.handle = self.backend.open_device(self.dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    self.handle = self.backend.open_device(self.dev)
    raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
    return _DeviceHandle(dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
    return _DeviceHandle(dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
    raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
NotImplementedError: Operation not supported or unimplemented on this platform
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 1071, in ctrl_transfer
NotImplementedError: Operation not supported or unimplemented on this platform
    raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
    raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
    return _DeviceHandle(dev)
    return _DeviceHandle(dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
    self._ctx.managed_open()
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 113, in wrapper
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    return f(self, *args, **kwargs)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\core.py", line 131, in managed_open
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    raise NotImplementedError(_strerror(ret))
    raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
    self.handle = self.backend.open_device(self.dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 804, in open_device
    raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
    raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
NotImplementedError: Operation not supported or unimplemented on this platform
    return _DeviceHandle(dev)
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 652, in __init__
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
    raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
All threads completed successfully

Original pthread based C code.
https://github.com/libusb/libusb/blob/master/tests/stress_mt.c
Discussion:

https://github.com/libusb/libusb/issues/1128

This is what ChatGPT says about the error messages.

It's possible that there is an issue with the PyUSB codes or the PyUSB library itself, but it's also possible that the issue is related to the platform you are running the code on. The error message "Operation not supported or unimplemented on this platform" suggests that there may be some limitations or compatibility issues with the USB backend being used by PyUSB.
You can try checking the PyUSB documentation or contacting the developers to see if there are any known issues or workarounds for the error message you're seeing. Additionally, you may want to try running the code on a different platform or with a different USB device to see if the issue persists.

No issues under Linux. I need to use sudo though to avoid permission errors like ValueError: The device has no langid (permission issue, no string descriptors supported or device error).
mcuee@UbuntuSwift3:~/build/python/stress_mt_python$ sudo python3 stress_mt_pyusb.py
All threads completed successfully

No issues under macOS with my Mac Mini M1.
(py310venv) mcuee@mcuees-Mac-mini stress_mt_python % python stress_mt_pyusb.py
All threads completed successfully

Let me start by saying that discussing ChatGPT-suggested code here (or elsewhere) is usually unproductive:

its bugs are nonsensical;
it isn't actually reasoning anything;

Proposing the inclusion of such code in PyUSB would, on top of those concerns, also be unacceptable due to copyright issues. (And I suspect that the common argument that it's "just like a compiler" will fail miserably once actually tested in court... as it's not a compiler, but rather a copyright laundering machine).

With that out that the way, you mention in the libusb issue that you're actually using ChatGPT here more or less like a fuzzer. That's interesting, and it may turn out to be a productive use of ChatGPT. (But let's evaluate that later).
So, the first thing is to ignore any pseudo-justification provided by ChatGPT: in the best case it's just noise, and in the worst it's noise that will also point us in the wrong direction. I rather not even see it. There's no reasoning behind it, it's just a (large) predictive text language model. Honestly, it doesn't even make any sense to ask it to reason about anything, much less something it generated, where it might tend to keep the coherence, which is actually very bad when the generated thing was wrong to start with.
Next, can you get some thread IDs on to those messages (whenever threading is in use)? That's necessary to accurately reason about errors in multi-threaded code, except in a few cases (like when there's really only one thread that could be involved in the causing that type of error).
Now, on to the errors on Windows: at a glance, libusb_open doesn't support the first device returned dev.find(), which is the one the test always picks. Maybe it's a root hub or protected for some other reason? Either way, you'll probably want to find a suitable device in the system before running the stress part of the test on it...
Which brings me a more important observation: the code generated by ChatGPT doesn't resemble anything like the original!
While stress_mt.c is a test "that creates and destroys contexts repeatedly", what ChatGPT generated tries to read the string descriptor with id 1  from whatever happens to be the first device found by PyUSB. (For compleness: it tries to read that descriptor 160000 times—16 threads × 10000 iterations/thread).

P.S. I think you'll agree that, at this point, the ChatGPT-as-a-sort-of-a-fuzzer experiment isn't off to a good start. But feel free to try a few more times if you want.

the code generated by ChatGPT doesn't resemble anything like the original!

You are absolutely right. And it admited the mistake.

Yes, the Python code using pyusb does not exactly match the function of the original C code. The C code creates multiple threads, each of which repeatedly calls libusb_get_device_list to obtain a list of all the USB devices attached to the system. The Python code using pyusb, on the other hand, only opens a USB device and sends a control message to it.
If you would like to use pyusb to implement a similar functionality as the C code, you could modify the Python code to create multiple threads and have each thread repeatedly call the pyusb equivalent of libusb_get_device_list. Here is an example of how you could modify the code:

import threading
import usb.core
import usb.util

NUM_THREADS = 16
NUM_ITERATIONS = 10000

def thread_func(thread_id):
    dev = usb.core.find(find_all=True)
    for i in range(NUM_ITERATIONS):
        devs = list(dev)
        if len(devs) == 0:
            print("Thread {} found no devices".format(thread_id))
        else:
            print("Thread {} found {} devices".format(thread_id, len(devs)))

threads = []
for i in range(NUM_THREADS):
    threads.append(threading.Thread(target=thread_func, args=(i,)))

for thread in threads:
    thread.start()

for thread in threads:
    thread.join()

print("All threads completed successfully")

This modified code creates NUM_THREADS threads, each of which repeatedly calls usb.core.find to obtain a list of all the USB devices attached to the system. Note that the find_all parameter is set to True to ensure that all devices are returned. The list of devices is then printed to the console.

Just want to state what I want to achieve through the chatgpt experiment.

Not to generate codes which will be merged -- only for testing purpose. This should avoid copyright concerns.
Reuse test cases across libusb and the two python bindings -- pyusb and python-libusb1
Test method -- to verify the test results across Windows, macOS and Linux to see if there are potential problems. For example, if the results under Linux and macOS are the same, but there is a problem under Windows, then there is a potential problems under Windows.

Specifically to the stress_mt.c tests, I suspect there is an issue with the libusb Windows backend when it comes to ref count. The converted C++11 codes seem to be able to expose the problem (to be confirmed).

The generate pyusb code may still not match the intention to be a test "that creates and destroys contexts repeatedly". But it seems to me that there is a potential issue with Windows. Or is it the code is again not valid?
Run log with NUM_THREADS = 4 and NUM_ITERATIONS = 4
(py310x64venv) PS C:\work\libusb\libusb_test\stress_mt_python> python .\stress_mt_pyusb_1.py
Thread 3 found 7 devices
Thread 3 found no devices
Thread 3 found no devices
Thread 3 found no devices
Thread 1 found 7 devices
Thread 0 found 7 devices
Exception ignored in: <function _AutoFinalizedObjectBase.__del__ at 0x0000026865EE0E50>
Thread 2 found 7 devices
Traceback (most recent call last):
  File "C:\work\python\py310x64venv\lib\site-packages\usb\_objfinalizer.py", line 86, in __del__
Exception ignored in: <function _AutoFinalizedObjectBase.__del__ at 0x0000026865EE0E50>
Traceback (most recent call last):
  File "C:\work\python\py310x64venv\lib\site-packages\usb\_objfinalizer.py", line 86, in __del__
Exception ignored in: <function _AutoFinalizedObjectBase.__del__ at 0x0000026865EE0E50>
Traceback (most recent call last):
    self.finalize()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\_objfinalizer.py", line 146, in finalize
    self.finalize()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\_objfinalizer.py", line 146, in finalize
  File "C:\work\python\py310x64venv\lib\site-packages\usb\_objfinalizer.py", line 86, in __del__
    self._finalizer()
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\weakref.py", line 591, in __call__
    self._finalizer()
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\weakref.py", line 591, in __call__
    self.finalize()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\_objfinalizer.py", line 146, in finalize
    return info.func(*info.args, **(info.kwargs or {}))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\_objfinalizer.py", line 106, in _do_finalize_object_ref
    return info.func(*info.args, **(info.kwargs or {}))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\_objfinalizer.py", line 106, in _do_finalize_object_ref
    self._finalizer()
  File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\weakref.py", line 591, in __call__
    obj._do_finalize_object()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\_objfinalizer.py", line 73, in _do_finalize_object
    obj._do_finalize_object()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\_objfinalizer.py", line 73, in _do_finalize_object
    return info.func(*info.args, **(info.kwargs or {}))
  File "C:\work\python\py310x64venv\lib\site-packages\usb\_objfinalizer.py", line 106, in _do_finalize_object_ref
    self._finalize_object()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 613, in _finalize_object
    self._finalize_object()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 613, in _finalize_object
    obj._do_finalize_object()
  File "C:\work\python\py310x64venv\lib\site-packages\usb\_objfinalizer.py", line 73, in _do_finalize_object
    _lib.libusb_unref_device(self.devid)
    _lib.libusb_unref_device(self.devid)
OSError: exception: access violation reading 0x0000000000000200
Thread 1 found no devices
    self._finalize_object()
Thread 1 found no devices
  File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 613, in _finalize_object
Thread 1 found no devices
OSError: exception: access violation reading 0x0000000000000200
Thread 0 found no devices
    _lib.libusb_unref_device(self.devid)
Thread 0 found no devices
OSError: exception: access violation reading 0x0000000000000200
Thread 0 found no devices
Thread 2 found no devices
Thread 2 found no devices
Thread 2 found no devices
All threads completed successfully

I'm sorry, but as an AI language model, I don't have access to any specific
code or run logs that you may be referring to.
However, if you're running a PyUSB stress test with multiple threads and
iterations on a Windows system, there may be some potential issues to
consider, such as differences in USB drivers, device settings, or system
resources.
To help troubleshoot any issues that you may be experiencing, you may want
to:

Review the PyUSB documentation and forums to ensure you're following
best practices for stress testing USB devices using PyUSB.
2.
Review any error messages or logs generated by your stress test to
identify any specific issues or errors that may be occurring.
3.
Consider testing your code on multiple systems (both Linux and Windows)
to ensure it works correctly across different platforms.
4.
Consider running your stress test with different settings (such as
different thread and iteration counts) to see if the issue is related to
the specific test configuration.
5.
Consider using additional tools or utilities (such as USB sniffers or
debuggers) to help diagnose any issues that may be occurring at a lower
level.
By reviewing your code and logs, testing on multiple systems, and using
additional tools, you may be able to identify and resolve any issues that
may be occurring during your PyUSB stress test.
On Sat, Feb 25, 2023 at 8:01 PM mcuee @.***> wrote:

The generate pyusb code may still not match the intention to be a test
"that creates and destroys contexts repeatedly". But it seems to me that
there is a potential issue with Windows. Or is it the code is again not
valid?
Run log with NUM_THREADS = 4 and NUM_ITERATIONS = 4
(py310x64venv) PS C:\work\libusb\libusb_test\stress_mt_python> python .\stress_mt_pyusb_1.py
Thread 3 found 7 devices
Thread 3 found no devices
Thread 3 found no devices
Thread 3 found no devices
Thread 1 found 7 devices
Thread 0 found 7 devices
Exception ignored in: <function _AutoFinalizedObjectBase.del at 0x0000026865EE0E50>
Thread 2 found 7 devices
Traceback (most recent call last):
File "C:\work\python\py310x64venv\lib\site-packages\usb_objfinalizer.py", line 86, in del
Exception ignored in: <function _AutoFinalizedObjectBase.del at 0x0000026865EE0E50>
Traceback (most recent call last):
File "C:\work\python\py310x64venv\lib\site-packages\usb_objfinalizer.py", line 86, in del
Exception ignored in: <function _AutoFinalizedObjectBase.del at 0x0000026865EE0E50>
Traceback (most recent call last):
self.finalize()
File "C:\work\python\py310x64venv\lib\site-packages\usb_objfinalizer.py", line 146, in finalize
self.finalize()
File "C:\work\python\py310x64venv\lib\site-packages\usb_objfinalizer.py", line 146, in finalize
File "C:\work\python\py310x64venv\lib\site-packages\usb_objfinalizer.py", line 86, in del
self._finalizer()
File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\weakref.py", line 591, in call
self._finalizer()
File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\weakref.py", line 591, in call
self.finalize()
File "C:\work\python\py310x64venv\lib\site-packages\usb_objfinalizer.py", line 146, in finalize
return info.func(*info.args, **(info.kwargs or {}))
File "C:\work\python\py310x64venv\lib\site-packages\usb_objfinalizer.py", line 106, in _do_finalize_object_ref
return info.func(*info.args, **(info.kwargs or {}))
File "C:\work\python\py310x64venv\lib\site-packages\usb_objfinalizer.py", line 106, in _do_finalize_object_ref
self._finalizer()
File "C:\Users\xiaof\AppData\Local\Programs\Python\Python310\lib\weakref.py", line 591, in call
obj._do_finalize_object()
File "C:\work\python\py310x64venv\lib\site-packages\usb_objfinalizer.py", line 73, in _do_finalize_object
obj._do_finalize_object()
File "C:\work\python\py310x64venv\lib\site-packages\usb_objfinalizer.py", line 73, in _do_finalize_object
return info.func(*info.args, **(info.kwargs or {}))
File "C:\work\python\py310x64venv\lib\site-packages\usb_objfinalizer.py", line 106, in _do_finalize_object_ref
self._finalize_object()
File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 613, in _finalize_object
self._finalize_object()
File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 613, in _finalize_object
obj._do_finalize_object()
File "C:\work\python\py310x64venv\lib\site-packages\usb_objfinalizer.py", line 73, in _do_finalize_object
_lib.libusb_unref_device(self.devid)
_lib.libusb_unref_device(self.devid)
OSError: exception: access violation reading 0x0000000000000200
Thread 1 found no devices
self._finalize_object()
Thread 1 found no devices
File "C:\work\python\py310x64venv\lib\site-packages\usb\backend\libusb1.py", line 613, in _finalize_object
Thread 1 found no devices
OSError: exception: access violation reading 0x0000000000000200
Thread 0 found no devices
_lib.libusb_unref_device(self.devid)
Thread 0 found no devices
OSError: exception: access violation reading 0x0000000000000200
Thread 0 found no devices
Thread 2 found no devices
Thread 2 found no devices
Thread 2 found no devices
All threads completed successfully
—
Reply to this email directly, view it on GitHub
https://github.com/pyusb/pyusb/issues/472#issuecomment-1445238979, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AA6AKOQZYLN6AXXOQJ2O6MTWZKTP7ANCNFSM6AAAAAAVHZGULQ
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

I asked ChatGPT to create the code to match the intention of stress_mt.c, but generated pyusb code does not work at all.
I will pause for a while with the pyusb experiment.
import threading
import time
import usb.core

NUM_THREADS = 16
NUM_ITERATIONS = 10000

def thread_func(thread_id):
    for i in range(NUM_ITERATIONS):
        try:
            dev = usb.core.find()
        except usb.core.USBError as e:
            print(f"Thread {thread_id}: error finding device: {e}")
            return

        time.sleep(0.001)

    usb.util.dispose_resources()

threads = []
for i in range(NUM_THREADS):
    t = threading.Thread(target=thread_func, args=(i,))
    threads.append(t)
    t.start()

for t in threads:
    t.join()

print("All threads completed successfully")

@rabryan
If you want to continue the experiment, please help to create a version which matches the intention of stress_mt.c. Thanks.
I know too little about the topic of Python threading to be able to carry forward with the experiment for now.

FYI, the generated code below for python-libusb1 seems to match stress_mt.c and runs fine under Windows.

https://github.com/vpelletier/python-libusb1/issues/87#issuecomment-1445244595

@mcuee,

Just want to state what I want to achieve through the chatgpt experiment.

Not to generate codes which will be merged -- only for testing purpose. This should avoid copyright concerns.

Reuse test cases across libusb and the two python bindings -- pyusb and python-libusb1. In this example, the libusb C code is the start. But often it may be easier to write a test case in Python than C.

Except that this would be code that would be merged, conflicting with (1).
More importantly, test code needs to be reliable.

Test method -- to verify the test results across Windows, macOS and Linux to see if there are potential problems. For example, if the results under Linux and macOS are the same, but there is a problem under Windows, then there is a potential problems under Windows. It may well be there is a valid reason why Windows performs different but it may also be possible that there is a real problem under Windows.

Yeah, I had already seen you mention this intent in the libusb issue.
And this was the potentially interesting use case of GPT I meant by "more or less like a fuzzer".

rabryan
If you want to continue the experiment, please help to create a version which matches the intention of stress_mt.c. Thanks.
I know too little about the topic of Python threading to be able to carry forward with the experiment for now.

We need to accept that the experiment has already gone awry:

even as a fuzzer ChatGPT hasn't performed well;
since I and other maintainers, i.e. humans, are part of that fuzzing loop, that's too high a cost (usually fuzzers only waste CPU time);
and in less than 24 hours we already have someone casually pasting ChatGPT output in a conversation (with nothing else added); they showed a total disregard for our time, for open-source in general, and for basic community building and fostering.

For the same reasons, I propose we ban ChatGPT (and, for that matter, Copilot) output from PyUSB, whether in issues, discussions, PRs or in any other PyUSB-related context (including contacting us personally).
P.S. This issue will now be locked and comments restricted to us/maintainers.

@jonasmalacofilho
Thanks.
When I say "reuse test cases` -- that does not mean to merge the test codes.
But I agree I have not been able to get ChatGPT to create a meaningful equivalent of stress_mt.c with pyusb. So I will stop this experiment for a while.

When I say "reuse test cases` -- that does not mean to merge the test codes.

Well, not necessarily, but we generally want to keep (useful) tests in the repository.
Even in this specific example: it would make sense to, just like libusb has stress_mt.c, have our own stress_mt.py in this repository.
Maybe it would not do the exact same thing as the libusb one, but it could do something else that's relevant to a MT stress test case scenario for PyUSB. Regardless, it would make sense to keep it in the repository, so that we (and others) could use it regularly.

Ah, you have a good point here. Now I agree it is better to avoid ChatGPT for this use case.


Implement data-once

Added support for "data-once" to only run the request once.

Thanks man, everything is fine though I changed the default for once to false


SQS Queue URL Output

Is your request related to a new offering from AWS?

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue#attributes-reference
Is your request related to a problem? Please describe.
I'm always frustrated when I need to use data sources for resources created in the same terraform script. Thanks for maintaining great AWS modules :0
Describe the solution you'd like.
Add Queue Url from resource output as module output
Describe alternatives you've considered.
Use SQS data source to retrieve URL

There is already sqs_queue_id output returned by this module which is the same as url. https://github.com/terraform-aws-modules/terraform-aws-sqs/blob/master/outputs.tf#L1-L10


sql start time per run

Two changes:

record sql last start time only on successful query execution. Mostly affected if scheduler is enabled that pulls latest updates based on the last start run. In case if query fails, current updates should be included with the next run
flush last start time after each query execution. Handy to trace the last time query has been executed

https://github.com/logstash-plugins/logstash-input-jdbc/issues/93

Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then  say 'jenkins, test it'.

@a-k- nice! this is a good tweak. Can you please add a test for this?

great , tests have been added

Tests pass
Run options: exclude {:redis=>true, :socket=>true, :performance=>true, :couchdb=>true, :elasticsearch=>true, :elasticsearch_secure=>true, :export_cypher=>true, :integration=>true, :windows=>true}
......................

Finished in 10.65 seconds (files took 1.32 seconds to load)
22 examples, 0 failures

Randomized with seed 54389

LGTM

@a-k- can you address 2 minor style issues and we can merge this.

sure, updated

@a-k- thanks, can you rebase please :)

@suyograo , done

@suyograo , done


Introduce GetInstanceFull

Let's make use of the new ?recursion=1 that @presztak introduced recently and make some of our CLI tools significantly faster in the process :)

Fixed!

Thanks


Examples use case - verify signature

Description
https://github.com/onflow/flow-go-sdk/tree/master/examples/verify_signature
Verify signature

Sign an arbitrary user message
Sign an arbitrary user message and verify it by using the public keys on an account respecting the weights of each key
Sign an arbitrary user message and verify it by using the public keys on an account. Return success if any public key on the account can sign the message

For contributor use:

[ ] Targeted PR against master branch
[ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
[ ] Code follows the standards mentioned here.
[ ] Updated relevant documentation
[ ] Re-reviewed Files changed in the Github PR explorer
[ ] Added appropriate labels

@tarakby yes, I actually thought the same when going through these; in the end I decided to just include all of them for now for consistency with the Go examples. Thank you!


Hiding a copy stake banner when no old delegations available

Hide the copy stake banner when no delegations are available on the old token stake contracts. We do not want to confuse users with displaying them a banner when they don't have any old delegations in the first place.

@r-czajkowski I've tested your code where we are not displaying already copy-staked delegation. It looked good.


Unable to proxy stream with authentication/URL params, 401 (Unauthorized)

Which version are you using?
Docker Hub Latest - 0.9.11
Describe the problem
I am trying to proxy some RTSP stream generated by some AXIS CCTV cameras, they require basic auth, as well as some parameters in the URL to config the correct stream profile. It seems that the URL is causing issues with the server, as it's reporting a 401 error when trying to connect.
Here's the startup, and failure log captured from Docker.
2020/08/29 10:02:37 [0/0/0] rtsp-simple-server v0.9.11
2020/08/29 10:02:37 [0/0/0] [UDP/RTP listener] opened on :8050
2020/08/29 10:02:37 [0/0/0] [UDP/RTCP listener] opened on :8051
2020/08/29 10:02:37 [0/0/0] [TCP listener] opened on :8554
2020/08/29 10:03:55 [1/0/0] [client <IP_ADDRESS>:61819] connected
2020/08/29 10:03:55 [1/0/0] [client <IP_ADDRESS>:61819] OPTIONS
2020/08/29 10:03:55 [1/0/0] [client <IP_ADDRESS>:61819] DESCRIBE
2020/08/29 10:03:55 [1/0/0] [source shutter] starting on demand
2020/08/29 10:03:55 [1/0/0] [source shutter] started
2020/08/29 10:03:55 [1/0/0] [source shutter] connecting
2020/08/29 10:03:55 [1/0/0] [source shutter] ERR: DESCRIBE: bad status code: 401 (Unauthorized)
2020/08/29 10:04:00 [2/0/0] [client <IP_ADDRESS>:61824] connected
2020/08/29 10:04:00 [2/0/0] [client <IP_ADDRESS>:61824] SETUP
2020/08/29 10:04:00 [2/0/0] [client <IP_ADDRESS>:61824] ERR: the path must contain a base path and a control path (shutter)
2020/08/29 10:04:00 [1/0/0] [client <IP_ADDRESS>:61824] disconnected
2020/08/29 10:04:00 [2/0/0] [client <IP_ADDRESS>:61825] connected
2020/08/29 10:04:00 [2/0/0] [client <IP_ADDRESS>:61825] OPTIONS
2020/08/29 10:04:00 [2/0/0] [client <IP_ADDRESS>:61825] ERR: path must begin with a slash
2020/08/29 10:04:00 [1/0/0] [client <IP_ADDRESS>:61825] disconnected
2020/08/29 10:04:00 [1/0/0] [source shutter] connecting
2020/08/29 10:04:00 [1/0/0] [source shutter] ERR: DESCRIBE: bad status code: 401 (Unauthorized)
2020/08/29 10:04:01 [2/0/0] [client <IP_ADDRESS>:61826] connected
2020/08/29 10:04:01 [2/0/0] [client <IP_ADDRESS>:61826] OPTIONS
2020/08/29 10:04:01 [2/0/0] [client <IP_ADDRESS>:61826] DESCRIBE
2020/08/29 10:04:02 [2/0/0] [client <IP_ADDRESS>:61826] ERR: publisher of path 'shutter' has timed out
2020/08/29 10:04:02 [1/0/0] [client <IP_ADDRESS>:61826] disconnected
2020/08/29 10:04:02 [2/0/0] [client <IP_ADDRESS>:61819] ERR: publisher of path 'shutter' has timed out
2020/08/29 10:04:02 [0/0/0] [client <IP_ADDRESS>:61819] disconnected
2020/08/29 10:04:02 [1/0/0] [client <IP_ADDRESS>:61827] connected
2020/08/29 10:04:02 [1/0/0] [client <IP_ADDRESS>:61827] SETUP
2020/08/29 10:04:02 [1/0/0] [client <IP_ADDRESS>:61827] ERR: the path must contain a base path and a control path (shutter)
2020/08/29 10:04:02 [0/0/0] [client <IP_ADDRESS>:61827] disconnected
2020/08/29 10:04:02 [1/0/0] [client <IP_ADDRESS>:61828] connected
2020/08/29 10:04:02 [1/0/0] [client <IP_ADDRESS>:61828] OPTIONS
2020/08/29 10:04:02 [1/0/0] [client <IP_ADDRESS>:61828] ERR: path must begin with a slash
2020/08/29 10:04:02 [0/0/0] [client <IP_ADDRESS>:61828] disconnected
2020/08/29 10:04:02 [1/0/0] [client <IP_ADDRESS>:61829] connected
2020/08/29 10:04:02 [1/0/0] [client <IP_ADDRESS>:61829] OPTIONS
2020/08/29 10:04:02 [1/0/0] [client <IP_ADDRESS>:61829] DESCRIBE
2020/08/29 10:04:05 [1/0/0] [source shutter] connecting

and here's my docker-compose.yml
version: '3.8'

services:
  rtsp-proxy:
    image: aler9/rtsp-simple-server:latest
    volumes:
      - $PWD/rtsp-simple-relay/rtsp-simple-server.yml:/rtsp-simple-server.yml
    network_mode: "host"

and my rtsp-simple-server.yml
writeTimeout: 5s

paths:
  shutter:
    source: "rtsp://cctv:shh57@<IP_ADDRESS>:554/axis-media/media.amp?videocodec=h264&camera=5&fps=15"
    sourceProtocol: tcp
    sourceOnDemand: yes
  goodsinout:
    source: "rtsp://cctv:shh57@<IP_ADDRESS>:554/axis-media/media.amp?videocodec=h264&camera=6&fps=15"
    sourceProtocol: tcp
    sourceOnDemand: yes
  warehousemiddle:
    source: "rtsp://cctv:shh57@<IP_ADDRESS>:554/axis-media/media.amp?videocodec=h264&camera=6&fps=15"
    sourceProtocol: tcp
    sourceOnDemand: yes
  mezupper:
    source: "rtsp://cctv:shh57@<IP_ADDRESS>:554/axis-media/media.amp?videocodec=h264&camera=6&fps=15"
    sourceProtocol: tcp
    sourceOnDemand: yes

Did you attach a network dump?
no

Hello, i'm using rtsp-simple-server to interact with an Axis server too, and everything works normally:
paths:
  proxied:
    source: rtsp://user:pass@10.xx.xx.xx/axis-media/media.amp?videocodec=h264&audio=0&color=1&fps=5&compression=0&videobitrate=50

Please:

check if username and password are correct (error 401 usually means that one of them is wrong), by using another software to interact with the cameras (vlc)
attach a network dump

to generate a network dump:

Download wireshark (https://www.wireshark.org/)
Start capturing on the interface used for exchanging RTSP (if the server and the target software are both installed in your pc, the interface is probably "loopback", otherwise it's the one of your network card)
Start the server and replicate the issue
Stop capturing, save the result in .pcap format
Attach

Thanks for the swift reply.
I have tried the same URL in VLC and it connects without issue.
Attached is a network dump from the docker host, it is filtered to only show traffic to the camera as their is some other slightly more sensitive stuff on the host, but there is definitely traffic to/from the camera IP address in the capture.
Let me know if I can provide anything else to help, I'm guessing this has to be something stupid at this end if it's working for you with the same scenario, I just can't work out what it it 👍
Thanks!
Gareth
axis_camera.pcap.zip

Hi, the network dump you attached only includes packets sent from your pc, and not the replies from the cameras. I think this bug can be solved rapidly and the network dump is the key to this process; i need:

a network dump with packets exchanged between rtsp-simple-server and the camera, with the 401 error
a network dump with packets exchanged between vlc and the camera, with a successful handshake

Ah yes, doh, sorry.
tcpdump attached for the server, that doesn't work (axis_camera_server.pcap), and local VLC that does work, (axis_camera_local.pcap).
Again, thanks for the help!
Archive.zip

I'm facing the same issue as reported by @gazzer82 . The stream works perfectly in VLC, but prints bad status code 401 Unauthorized when trying to proxy

Hello, i've uploaded a possible fix, please try the nightly release attached below and let me know if it worked.
rtsp-simple-server_v0.9.11-8-g476262e_darwin_amd64.tar.gz
rtsp-simple-server_v0.9.11-8-g476262e_linux_amd64.tar.gz
rtsp-simple-server_v0.9.11-8-g476262e_windows_amd64.zip

Cannot test since I'm on ARMv7, btw I tried with an older version and the problem still occurs.

rtsp-simple-server_v0.9.11-8-g476262e_linux_arm7.tar.gz

It works, but after a few seconds an error message occurs:
2020/08/29 18:04:54 [1/0/1] [client <IP_ADDRESS>:60311] ERR: read tcp <IP_ADDRESS>:8554-><IP_ADDRESS>:60311: use of closed network connection
2020/08/29 18:04:54 [0/0/0] [client <IP_ADDRESS>:60311] disconnected

2020/08/29 18:05:10 [0/0/0] [source cam2] ERR: stream is dead
2020/08/29 18:05:10 [0/0/0] [source cam2] not ready

@AngeloAvv this is probably another bug, but

try increasing the readTimeout parameter in the configuration
try switching to udp and see if the issue is still present
attach a full log

thanks

@AngeloAvv or try switching to TCP if you were using UDP (sorry but there are two people in the conversation)

Wow amazingly quick response, will try the bug fix tomorrow. Do you have your docker build file so I can build a new container version as this is running on docker?
Thanks
Gareth

Ok tell me if you rather prefer I open another issue.
So I tried increasing the readTimeout to 30 seconds but the problem still occurs, by switching the protocols from [udp,tcp] to [tcp] only, a crash event is printed:
pi@raspberrypi:~ $ ./rtsp-simple-server
2020/08/29 18:25:15 [0/0/0] rtsp-simple-server v0.9.11-8-g476262e
2020/08/29 18:25:15 [0/0/0] [UDP/RTP listener] opened on :8000
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xc pc=0x3ad8c4]

goroutine 20 [running]:
main.(*serverUdp).run(0x0)
        /s/server-udp.go:67 +0xc4
created by main.newProgram
        /s/main.go:288 +0xdcc

Also tried as a sudoer but it's the same
Thank you how fast you are replying to us

@AngeloAvv i meant try changing the sourceProtocol parameter, not the protocols parameter.

the sourceProtocol parameter dictates the protocol of the source
the  protocols parameter dictates the protocol of the server and is not the probem

Since you're using a source, a proper configuration could be:
paths:
  proxied:
    source: rtsp://url
    sourceProtocol: tcp

I want you to do this since the default protocol is udp, and it requires no firewall between the source and the server, while tcp always works.

@aler9 sorry it might have got missed in the messages, do you have the dockerfile you use to build the releases so I can test this fix on my docker server?

FROM golang:1.14-alpine3.12
RUN apk add --no-cache git
RUN git clone https://github.com/aler9/rtsp-simple-server \
&& cd rtsp-simple-server \
&& go build -o /out .
ENTRYPOINT [ "/out" ]

Thanks, was able to build a new container from the latest code, unfortunately it hasn't solved the problem.
It does seems to have fixed a load of the path errors, but I'm still getting a 401 on startup.
2020/08/30 10:56:46 [0/0/0] rtsp-simple-server v0.9.11
2020/08/30 10:56:46 [0/0/0] [UDP/RTP listener] opened on :8000
2020/08/30 10:56:46 [0/0/0] [UDP/RTCP listener] opened on :8001
2020/08/30 10:56:46 [0/0/0] [TCP listener] opened on :8554
2020/08/30 10:56:46 [0/0/0] [source proxied] started
2020/08/30 10:56:46 [0/0/0] [source proxied] connecting
2020/08/30 10:56:46 [0/0/0] [source proxied] ERR: DESCRIBE: bad status code: 401 (Unauthorized)
2020/08/30 10:56:51 [0/0/0] [source proxied] connecting
2020/08/30 10:56:51 [0/0/0] [source proxied] ERR: DESCRIBE: bad status code: 401 (Unauthorized)
2020/08/30 10:56:56 [0/0/0] [source proxied] connecting
2020/08/30 10:56:56 [0/0/0] [source proxied] ERR: DESCRIBE: bad status code: 401 (Unauthorized)
2020/08/30 10:57:01 [0/0/0] [source proxied] connecting
2020/08/30 10:57:01 [0/0/0] [source proxied] ERR: DESCRIBE: bad status code: 401 (Unauthorized)
2020/08/30 10:57:06 [0/0/0] [source proxied] connecting
2020/08/30 10:57:06 [0/0/0] [source proxied] ERR: DESCRIBE: bad status code: 401 (Unauthorized)

Hello @gazzer82, from the log you posted i can see you're using the old version, since the first log line is
2020/08/30 10:56:46 [0/0/0] rtsp-simple-server v0.9.11

While the nightly release generates:
2020/08/30 10:56:46 [0/0/0] rtsp-simple-server v0.0.0

Since the binary outside docker works fine, i think the bug is solved at 99%.
I'm releasing v0.9.12, please test it and let me know.

I can confirm the nightly fixed the problem for me.

You are entirely correct, was using the wrong container image, rebuilt with the correct version and it does indeed work as expected. So confirmed working here too, thanks!
Sent from my iPhone

On Aug 31, 2020, at 15:14, Angelo Cassano<EMAIL_ADDRESS>wrote:

I can confirm the nightly fixed the problem for me.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.


http scheme is used for https  authorized redirect URIs

I had configured https Authorized redirect URIs at google console. But http scheme is used when I try to login.

So long as you have a https:// URI in the redirectUri setting, then the package will use https. There is nothing in this package that forces insecure URLs.


fix(designer): Support for dark mode in html editor

Please check if the PR fulfills these requirements

[x] The commit message follows our guidelines
[x] Tests for the changes have been added (for bug fixes/features)
[x] Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
bug fix

What is the current behavior? (You can also link to an open issue here)
no dark mode in HTML editor

What is the new behavior (if this is a feature change)?
dark mode is now supported in HTML editor

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
no

Please Include Screenshots or Videos of the intended change:

Is the contrast good enough for the toolbar items? I couldnt figure out what is written there first because it looks like disabled text

Is the contrast good enough for the toolbar items? I couldnt figure out what is written there first because it looks like disabled text

^ This, the contrast seems really low and that's going to cause some a11y issues

I've gone ahead an increased the contrast


Add version 1.7.1

@phemmylintry also please fix ARG syntax, which was broken #44 and slipped the review, but fixed in https://github.com/withlogicco/docker-poetry/pull/46.


TypeScript plugin not generating the JS output file

I have version 1.4.0.v20150129-2147 of the TypeScript plugin and am using STS version 3.6.3.  I have noticed the plugin seems to have issues building the JS output file for all my TS files.  I have gotten it to work with a small set of TS files (so I know it works sometimes) but when I have all my TS files in my project it doesn't build the JS file at all.  Quite honestly it doesn't even look like it runs during that scenario.  What is puzzling for me is that I had setup an external builder in STS to run the tsc command to generate the JS file and that works just fine.  I can also properly generate a JS file by directly executing the tsc command from the command prompt.  The fact that I can successfully generate the JS file using two other means is leading me to believe that there is something going on with the plugin.  I've had coworker test it out for me as well and he gets the exact same results.
Has anyone encountered a similar issue or know of some kind of logging that can be turned on for the TypeScript plugin?  I would prefer to just use the plugin itself for all of my compilation/transpiling needs but if the external builder I setup is the only convenient way I can get a successful JS file to be written then I will continue to use that and just wait and see if future versions of the plugin manage to fix the issue.

Hmm, that sounds bad - do you see any errors in the error log? Have you configured the project builder for TypeScript? Can you share the project configuration settings?

Thanks for the reply Derek.  No, unfortunately I don't see any errors in the log which is why I was wondering if there was some kind of option to turn logging on for it.
In regards to your second question are you talking about the Configure -> Enable TypeScript Builder option that you can get to by right clicking on the project?  If so then yes I have that configured.
I also wasn't 100% sure which project configuration settings you wanted but if you were referring to the settings for the com.palantir.typescript.prefs file they are as follows:
build.path.exportedFolder=
build.path.sourceFolder=WebContent/static/typescript/myApp
compiler.codeGenTarget=ECMASCRIPT5
compiler.compileOnSave=true
compiler.generateDeclarationFiles=false
compiler.mapSourceFiles=true
compiler.moduleGenTarget=UNSPECIFIED
compiler.noImplicitAny=true
compiler.noLib=false
compiler.outputDirOption=WebContent/static/typescript/js
compiler.outputFileOption=Trips.js
compiler.removeComments=true
eclipse.preferences.version=1
Also, I don't know if it helps any for comparison purposes but when I run it from the command line (which works for me) this is all I put on the command line:
tsc @ts-files.txt --target ES5 --sourceMap --removeComments --out ..\js\App.js
The ts-files.txt just contains the list of all the TS files that are used for my project.
Oh, and just a heads up, I am at the end of my work day so will not have a chance to check back on this until tomorrow.

Thanks for the details. Looking at your settings, it looks like files will only be compiled if they are contained within "WebContent/static/typescript/myApp" (only files in this directory will be compiled) and then they will be output as a single file "Trips.js" to "WebContent/static/typescript/js". Is that what you expect? (it seems to differ from the command line for example)
To be honest, the single-file output mode isn't very well tested so its very possible that is the issue. Maybe try the multiple file output and see if that helps?

Derek, yeah sorry about that.  The command line version I gave you should have ended with Trips.js not App.js.  It is doing the same thing that we're trying to get the plugin to do and that is (as you noted) compile all the TS files in the myApp folder and any subdirectory into one concatenated JS file.  Like I had mentioned earlier I have gotten the plugin to work before but it seems to be very picky about when it does.  For example, I have 7 subdirectories within the myApp folder and have noticed that if I randomly remove some folders it will build the concatenated JS file properly but if I keep all the subdirectories in then it won't build the JS file.
I have also noticed that it's not really specific to any kind of folder structure as I had tested it by using just one folder and putting all my TS files from the other subdirectories into that one folder and then compiling that one folder.  I ran into the same problem doing that (and also the same random quirk where if I remove some random files it will generate the concatenated JS file otherwise it won't generate the JS file).  For my single folder test I was also still able to generate what I wanted straight from the command line or using the external builder I had setup.  It just seems to be the plugin.
The multiple file option that you suggested has not been an issue for me and has always worked.  It just seems to be something quirky with compiling into one concatenated JS file.  For the project that I'm working at we have decided to use the one concatenated file approach which is the only reason why we're looking for a way to do that successfully within the plugin.

Ah ok, so it most likely all ties back to the single file output it seems. If you can come up with a small repro I could try out and debug I could look into this more but I'm afraid at present there likely isn't much further I can do since we don't use the single file output. I have no trouble believing it could be somewhat flaky given that it is somewhat untested.

Ok, I created a repo of what isn't working for me.  I hope that right since I've never used/created a git repo before.
The files that are up there are actually supposed to reside in a parent folder called TestProject2 which is the name of my workspace in STS (I mention this because I believe I screwed that part up trying to upload my files to github).  If you need me to redo it just let me know and I'll give it another shot.

Cool, thanks - I'm going to take a look this weekend.

Thanks Derek.  If you find that it just "works" for you don't be too surprised.  I used those same files to create multiple copies of that project to narrow down the problem and noticed that sometimes the concatenated JS file just plain worked despite me making no changes whatsoever whereas other times it wouldn't.  The copy I uploaded is the one test project that I've been consistently able to get to not work correctly (at least for my machine and one of my coworkers machines).
Out of curiosity since you mentioned you guys don't use the single file output what do you use as far as concatenation goes for a single JS file?  Or do you only deal with many smaller individual JS files?  And would you happen to know if the feature to concatenate all the individual JS files into a single JS file is going to become "official" (and by default fully tested)?  If it's going to be a feature that won't be fully tested for a while maybe it would make sense to temporarily remove it until it has been fully tested.  If nothing else it would prevent people like me from bugging you.  :)

Thanks for the great repro - I think I was able to figure out what was going on and fix the issue. The update with a fix should be out shortly (within 15 mins). Please let me know if it works.

Hey thanks a lot Derek!  I'll check it out when I'm back in the office on Monday and let you know.  Now stop working and enjoy your weekend.  :)

:)

Hi Derek.  I just downloaded your update and checked it out here at the office.  It's working great!  Thanks a lot!  I really appreciate all the work you put into fixing that issue for me.

Awesome, glad to hear it worked out! Sorry for the inconvenience of having to deal with that in the first place.


Showing error page instead of loading page

Hi Acouvreur,
Great service. Love the plugin and the service. I do however have a problem, that the plugin loads the error page every time, instead of the loading page.
Setup. I start all my services using a .sh script, calling docker compose files. Therefore using docker classic...
Error:
Error loading Who am I.

There was an error loading your instance.
Get "http://ondemand:10000?name=who&timeout=1m0s": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

The service does seem to respond correctly:
09/23/2022 8:37:11 AM
time="2022-09-23T08:37:11+02:00" level=info msg="Scaling up who to 1"
09/23/2022 8:38:27 AM
time="2022-09-23T08:38:27+02:00" level=info msg="Scaling down who to 0"

Below snippets from dynamic-conf in Traefik. (http/services/middlewares are missing. This is only snippets of the specific conf.)
    chain-who:
      chain:
        middlewares:
          - odm-who
          - chain-default

    odm-who:
      plugin:
        traefik-ondemand-plugin:
          serviceUrl: http://ondemand:10000
          name: who
          displayname: "Who am I"
          timeout: 1m
          waitui: true

    who:
      loadBalancer:
        servers:
        - url: "http://who:80"

    who:
      rule: Host("who.domain.tld")
      entryPoints:
        - "websecure"
      middlewares:
        - chain-who
      service: "who"
      tls: true

I have tried adding below to  my static conf.
      - "--serversTransport.forwardingTimeouts.dialTimeout=30s"
      - "--serversTransport.forwardingTimeouts.idleConnTimeout=30s"

But this didnt make any difference. Do you have any idea what might be causing the client time-out? All my trafik is sent through cloudflare argo tunnels, but this seems to be happening only server-side?

Hi, I'd need a closer look at your complete docker-compose file.
Because all that matters is if you can reach the ondemand service.
Configured by: serviceUrl: http://ondemand:10000
You have to be sure that both, traefik and the ondemand service, are on the same network, then you have to ensure that the fqdn you're using is valid.
Here, your service must be named ondemand.


Run TPM mgr as a service agent

This is required to anchor keys mgmt/rotation, certs mgmt, attestation publishing etc
This is also required to publish TPM operational info via pubsub. (Today zedagent directly calls tpmmgr APIs)
This is the initial commit, will follow it up with more content for certs creation etc
Right now it is not watchdog enabled. Will enable it once we have reasonable content added.

Hey @cshari-zededa -- looks like you need to re-base manually and resubmit the PR before I can pull it in.

Closing this PR as I deleted the branch by mistake. Will raise a new PR, pointing to this, for history of comments.


Unable to build on M1

When trying to build the website on an M1 MacBook it fails. For some reason, this does not appear to be the case for other contributors.

Node version: v18.12.1
npm version: 8.19.2
<EMAIL_ADDRESS>
When I run npm run build the following error occurs:
[23:17:04] TypeError in plugin "gulp-imagemin"
Message:
    function_ is not a function
Details:
    fileName: /Users/lars/Documents/GitHub/cwa-website/src/assets/img/App_Store_Badge_DE.svg
    domainEmitter: [object Object]
    domainThrown: false

When I run npm run dev the following error occurs:
[23:16:39] Error in plugin "gulp-webp"
Message:
    spawn Unknown system error -86
Details:
    errno: -86
    code: Unknown system error -86
    syscall: spawn
    fileName: /Users/lars/Documents/GitHub/cwa-website/src/assets/img/app-mockup.png
    domainEmitter: [object Object]
    domainThrown: false

As discovered by @MikeMcC399 in https://github.com/corona-warn-app/cwa-website/issues/3100#issuecomment-1305831728, I'm not the only one who has encountered this issue so far. The TypeError for gulp-imagemin was already reported in its repository at https://github.com/sindresorhus/gulp-imagemin/issues/373.
If anyone is able to reproduce this, feel free to comment below. It is of great interest for us to make this project work on M1 devices.

@larswmh
I assume you already restarted your machine & tried if completely removing the local copy of this repo and re-adding it fixes the issue?

@larswmh
I found some reports related to the error messages which sounded like npm modules for the wrong architecture were installed.
You might try deleting the node_modules folder and then running npm ci to reinstall exactly what is defined in package-lock.json.
I'm guessing that this might have something to do with mixed up emulation, but I have no experience on Macs, so that is just a wild guess!

@larswmh

@Ein-Tim

I assume you already restarted your machine & tried if completely removing the local copy of this repo and re-adding it fixes the issue?

Yes, did that but that unfortunately didn't fix it
@MikeMcC399

You might try deleting the node_modules folder and then running npm ci to reinstall exactly what is defined in package-lock.json.

This also sadly did not fix the issue. Thank you both for your advice though!

I'm guessing that this might have something to do with mixed up emulation, but I have no experience on Macs, so that is just a wild guess!

I don't really have experience either, I rarely use it but thought it might be useful for our Mac testing. I have never done anything with emulation on this, the device is still pretty much like how it came out of the box

@larswmh
Could you try removing the repo, switching the terminal to use Rosetta II emulation (as explained here: https://support.presonus.com/hc/en-us/articles/4407850496141-How-to-switch-from-native-Apple-Silicon-support-to-Rosetta-mode), installing the repo & then executing the commands in the terminal which now uses Rosetta II?
This way we could find out if this is an issue with the emulation.

I will prepare a pull request to adjust the README.md accordingly

@larswmh

I will prepare a pull request to adjust the README.md accordingly

Great suggestion!
Your results suggest that parts of the build process including npm modules are not fully compatible with the M1 ARM hardware architecture if it works by installing the Rosetta 2 emulation.
You didn't mention which version of macOS you are using. I don't know if that makes any difference.
When I Googled about Rosetta the results said that it was not installed by default.

@MikeMcC399 @Ein-Tim

You didn't mention which version of macOS you are using. I don't know if that makes any difference.

It's the latest version 13.0 (22A380).
Anyway, thank you both for your extensive help on this issue!

@larswmh
It looks like using Rosetta 2 is the only available workaround at this time. Deep down in the npm dependencies there are some binaries called up and for instance there is an old version of cwebp-bin (5.1.0) being used (latest is 8.0.0).
The version of gulp-webp (4.0.1) is the latest, although it is 4 years old. This is using imagemin-webp 5.1.0 released 3 years ago, and the current version is 7.0.0.
The latest gulp version (4.0.2) itself is also 4 years old, so it seems we have to workaround whatever shortcomings are surfacing. I don't expect much gulp update activity to occur. I guess a new project would prefer other tool / framework options?

Also I found that there are no GitHub runners for Apple M1 (see https://github.com/actions/runner-images and issue 2187) so this is a barrier to automated (CI) testing of npm packages.


Migration engine gets killed when running prisma2 dev

Running prisma2 dev in preview 15 returns following error. I tried to remove node_modules and reinstall, but it did not help
Error: Command failed: /Users/**/Sites/**/**/backend/node_modules/prisma2/migration-engine cli --datasource postgresql://**:**@localhost/** --can_connect_to_database

How did you create your project?
Can you share your schema.prisma or the relevant parts of it?

I updated from Prisma preview 14.2, it is a project in development since preview 8. This is the schema.prisma config
datasource db {
  provider = "postgresql"
  url      = "postgresql://usr:pass@localhost:5433/db"
}

generator photon {
  provider = "photonjs"
}

I am unable to reproduce this.
Can you please tell me the details about your operating system?

I run macOS Catalina 10.15 Beta

I no longer have that issue running Prisma preview-016


Button with icon: Icon sizing and space between icon off

Description

The Icons used are smaller than those from the icons site. The spacing between the icons and the text is also too close when compared to the designs.
I have taken a screenshot and recreated how the buttons should actually look in Xd.
Steps to reproduce

Go to http://opensource.corp.adobe.com/spectrum-css/
Click on ...
Observe ...

Expected behavior

Screenshots

Environment

Spectrum CSS version:
Browser(s) and OS(s):
Found in https://reactspectrum.blob.core.windows.net/reactspectrum/20e5131cfc8f65620868f16dc32defaedd215aaf/index.html?path=/story/button--variant-cta

Chrome on MacOS Catalina
Additional context

@JacobDFrank can you please verify this against http://spectrum-css-archives.s3-website.us-east-2.amazonaws.com/2.15.1/docs/button-primary.html#variants ?

the labels are one pixel lower than they should be on desktop and all the labels are two pixels lower

Seems to be a react-spectrum rather than a css one.


Implement loading indicator while blocks load

With the new react editor the blocks now load asynchronously. While they load we need a loading indicator.

FYI the admin module has a Loading component that can be rendered while the loading prop is true (GraphQL HOCs update this prop as necessary on the components that they are bound to).
Should be an easy fix.

@clarkepaul can you please check there is a loading indicator in the style guide or pattern library to use for this?

Yup will sort @brynwhyman

Loading indicator (React component in admin) from pattern library:

We use that for entire page loads but I'm not sure if its as practical for sections of UI, will confirm with Jared.

@clarkepaul (cc @newleeland) we're already using this component for loading in sections of the UI, sometimes with multiple sections in one browser window at once. It's cool if that needs to change, perhaps we could create a new loading indicator for UI panels and mark this one as only to be used for full windows

It would be good to modernize the loading indicator but I think as long as we don't have 3+ loading indicators appearing per the loading of a view it should be fine.

In order to prevent a complex UI from having its subcomponents use the Loading component when loading async data, the component would need to share state between its child components somehow to tell them whether they're allowed to render their loading components or not.
I think this should be raised in core, and asset admin would be a good place to start (open the detail view for a file and refresh the page to see two loading indicators at the same time).

I had a chat the other day with @newleeland about loading indicators. There are five or six varieties in the CMS at the moment, so we decided to use the Loading React component which ships in the admin module (shown in screenshot above) for now and raise a core issue (TBC) to assess and consolidate loading indicators across the CMS.

PR at https://github.com/dnadesign/silverstripe-elemental/pull/316


Allow modules and nodelist of a test to be logged

This is a custom change introduced to @ZQyou's fork.

Perhaps a more general solution to log any attribute of the RegressionTest would cover this and any future case.

In addition to being able to log any attribute of a test, it would make sense to allow logging of arbitrary information per test basis. That could happen through another test field dedicated to this.


Migration automation to enable automatic conversion of CRDs

Goal
Automagically migrate KeptnEvaluationProvider from lifecycle to metric API group.
Technical Details

Name & Namespace must be preserved
Shell scripts / stand-alone tools are fine

DoD

[ ] Documentation is updated with this breaking change and how to migrate

Dependency

https://github.com/keptn/lifecycle-toolkit/issues/848

Leaving this open, as we still need to document this


Deprecate

This project is not in use at Mapbox anymore and not actively maintained. I think we should mark that in the readme and archive this repository.
@emilymcafee @rclark ?

:+1: Yep

I'm curious what are you guys using these days?

Hi @cristim -- to react to spot termination notifications we've moved to a system that listens to EC2 Spot Instance Interruption Warning events from CloudWatch Events, and a Lambda function that takes appropriate action.
We track metrics in CloudWatch for the number of instance type / availability zone combinations ( or "spot pools") that we are trying to run spot EC2s in, and compare that to the number of spot pools where EC2s are actually running. If that drops below a threshold, we launch on-demand instances to compensate.

Is this code open source? I would like to have a look if it's public, maybe I can 'steal' some ideas from it.
I'm also running a project in this space that's using a different approach to achieve a similar result. You can check it out at github.com/AutoSpotting/AutoSpotting

Sorry @cristim, the code is not open source. The concept though, really is no more complicated than I described above. Really the challenge is in determining appropriate thresholds for your system/application.

Thanks!


Not working with PostCSS 8 / Webpack 4 / TailwindCSS

I can't get this to work with the latest PostCSS and Webpack 4.
postcss.config.js
module.exports = {
  plugins: [
    require('tailwindcss'),
    require('postcss-preset-env'),
    require('flex-gap-polyfill')(),
  ],
};

I get the following error:
JisonLexerError: Lexical error on line 1: Unrecognized text.

  Erroneous area:
1: -auto * var(--fgp-gap_percentage-decimal_row)
^...^

Hi, thanks for raising this issue. Admittedly I've not had chance to try this with PostCSS 8. I'll investigate this issue shortly.

@lewebsimple I just want to check something. Are you by any chance using margin: auto; with the gap' property in any way? This might be a bug/limitation which I'm recently become aware of but not had chance to make better. It shouldn't be causing it to error but PostCSS 8 might have some stricter linting rules. I will investigate it further when I get chance. For now if it is related to that, you might have to use margin: auto` on a separate wrapper container if possible.

Hi @yoanmalie. Thanks for this. I'll take a look at it this weekend. I think the issue might be being caused by the use of percentage gaps and possibly the container has a width of auto.  The polyfill uses the width set on the container to help aid in calculating the correct gap spacing. It might be in this case that a fallback might be required, but I'll investigate it further at the weekend or the end of this week.

Ok I think I know what the issue is, hoping to have a fix ready by the end of the week.
Basically the plugin is generating invalid CSS in certain scenarios when `width: auto' exists in the stylesheet but I didn't spot this before PostCSS 8.

Hi @yoanmalie @lewebsimple I've published a minor fix which I hope will resolve the error you're seeing. Please update to version 1.0.4 and let me know if it resolves the issue you are experiencing.

Closing this issue now as should be fixed in 2.0.1.

Closing this issue now as should be fixed in 2.0.1.


Fix version number in metadata files

The version in the metadata files does not match the published version.
The 2.0.2 tag should probably be fixed after applying this.

2.1.0 was properly released so closing.


Add CCS variables by carbon source

This PR adds variables for CCS by source as requested by @strefler.

Right, there are currently three separate PRs:

CCS by source (biomass, fossil, industrial process) (this PR)
Capture by source along the energy supply chain #230
Capture from energy demand in industry by source #231


Comment Edits aren’t federating

Quick summary
See https://mediaformat.org/wordress-activitypub/signature-verification-in-wordpress/#comment-752 on the web vs in another Fediverse app
Steps to reproduce

Reply to your own blog post
Edit the comment and save

What you expected to happen
Comments should be editable
What actually happened
Comment edit not federating
Impact
All
Available workarounds?
No but the platform is still usable
Logs or notes
No response

I believe I saw this, too. Didn't dig any further because I've been changing so many things at once. :-D

Did a tiny bit of digging. The activity gets sent out, servers respond with 200 or 202. (That doesn't necessarily mean anything, they typically respond this way.)
When I pull up the comment's ActivityPub representation in my browser (using ?activitypub&c=id), it shows the updated version just fine.
It looks like edits for posts still work.
I don't see a lot of incoming GET requests in my server logs, like I do after a post gets boosted or so.
I guess that means that Mastodon and other AP servers verify the edit using a public key they've cached someplace (this part of AP is still a bit of a mystery to me).
So it looks like something in the update activity, be it a signature or an ID or another kind of property that Mastodon parses or expects to be there ... is "wrong"?

Another thing: when I search for the comment I used to test (https://jan.boddez.net/?c=1874), in Mastodon, it finds it OK (e.g., https://indieweb.social/@jan@jan.boddez.net/111725404913235167).
But when I hover over Mastodon's "Open original page" link for the comment it shows me, the address is https://jan.boddez.net/notes/363e425922#comment-1874 (which is correct, but that URL's AP representation will not return the comment, as pointed out before).
(I don't know if it could mean anything.)

Another thing I think I saw (but I don't know if it means anything, I'm guessing it doesn't), is that comments aren't included in a user's outbox ...

Ah, I think it's the issue that the updated date does not differ from the published date?!? Will check that tomorrow!

Yes, there MUST be a newer updated date!

Also while we're on the topic of comment edits, I do think Edits should be transparent to users.
My original PR used a filter to mention the Edit time/date.
I think we may also need a site setting for sending remote Edits back to moderation.

@mediaformat do you want to make a PR to re-add the "mention the Edit time/date."


Cleanup email clients page

Description
Resolves: #1707
Resolves: #1248
Resolves: #1643
Check List

[x] I understand that by not opening an issue about a software/service/similar addition/removal, this pull request will be closed without merging.

[x] I have read and understand the contributing guidelines.

Netlify preview for the mainly edited page: https://deploy-preview-1990--privacytools-io.netlify.app/software/email/

I'm thinking we might have a sub category for Mobile clients.. Android and iOS, because on mobile platform things like this are never multi platform.
We should also look into some iOS clients that support PGP. Realistically we should be only recommending clients that can do PGP. Tutanota being the only exception, but that's not really a client, it's a service (so I wouldn't be recommending their app on this page).

I'm thinking Letterbox is probably a bit too experimental at the moment to be added. I'd probably add https://canarymail.io though, and yes I'm aware it's closed source, but you have a lot less options on iOS anyway.

I think swapping letterbox for Canary Mail works, and maybe letterbox could be put under worth mentioning (unless we are trying to get rid of that)?

I think swapping letterbox for Canary Mail works, and maybe letterbox could be put under worth mentioning (unless we are trying to get rid of that)?

This might be a good idea, we may make an exception here to the worth mentioning rule as it's something we want to keep an eye on.

Do we want to create a "Testing tools" section as mentioned in the issue? Or should that be something for the wiki/blog?

Do we want to create a "Testing tools" section as mentioned in the issue? Or should that be something for the wiki/blog?

We could have a heading maybe instead of "worth mentioning" something like "Future items to be considered:" or something to that effect.

Hmmm, but should we try and distinguish between email clients that could be consdered, like tools such as Email Privacy Tester or some of the other things currently under Worth Mentioning?

We don't have to mention Enigmail anymore https://blog.thunderbird.net/2020/07/whats-new-in-thunderbird-78/

We don't have to mention Enigmail anymore

I would still mention it, because OpenPGP support is not there yet: "Thunderbird 78.2, due out in the coming months, will offer a new feature that allows you to end-to-end encrypt your email messages via OpenPGP."

I would still mention it, because OpenPGP support is not there yet: "Thunderbird 78.2, due out in the coming months, will offer a new feature that allows you to end-to-end encrypt your email messages via OpenPGP."

ah this is true, and you need that for card reader support.

Mailvelope doesn't really deserve to be delisted I don't think. Could be but under "worth mentioning" or the proposed "Future items to be considered:" area.

I don't think Mailvelope deserves to be delisted. Could be but under "worth mentioning" or the proposed "Future items to be considered:" area perhaps?

I'd suggest it under the desktop section actually. It underwent an audit a while back https://www.mailvelope.com/en/blog/mailvelope-4.0
https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/Publications/Studies/Mailvelope_Extensions/Mailvelope_Extensions_pdf.pdf?__blob=publicationFile&v=3

Something about having Mailvelope amongst the other email clients seems odd, perhaps we could create a sepeate section for extensions? Seeing as it isn't an email client, it feels weird that it is in with email clients, or maybe thats just me.

I'm also not opposed to adding https://neomutt.org down the bottom under worth mentioning maybe.
It is a multi platform, and I'm not against TUI clients like https://aerc-mail.org or https://meli.delivery in the future, if they gain some stability.

I'd be ok with that. notmuchmail could also be worth considering.

We should probably add a criteria, most likely just a copypasta of the email one but adapted for clients.

I think this is looking pretty good now.

@dngray same, however it would be good to create a criteria surely?

@dngray same, however it would be good to create a criteria surely?

The issue I have with a criteria is, we test these products. Generally I don't like recommending closed source products, but we sometimes make an exception ie with CanaryMail for example.
I think the main thing we would require is that the client have support for PGP encryption, I think that's really all we can put there.

@dngray perhaps we should include this somewhere on the page, otherwise I think we're pretty much done here!

@dngray perhaps we should include this somewhere on the page, otherwise I think we're pretty much done here!
Also, I think we could put Enigmail under worth mentioning for desktop?

I'm pretty sure that Enigmail is going to reach EOL somewhere this year since Thunderbird is adding its built in PGP support.

I'm pretty sure that Enigmail is going to reach EOL somewhere this year since Thunderbird is adding its built in PGP support.

Redirected from Will OpenPGP cards be supported for private key storage ?:
How to use Thunderbird 78 with smartcards

Thunderbird 78 does NOT use GnuPG by default. Instead, it uses the RNP library. The RNP library does NOT yet support the use of smartcards for secret keys.

We should verify this works first.

I've verified this with 78.5 and this works quite nicely. There is a wizard that helps with conversion.
These releases included OpenPGP fixes, so it's being made 1st class:

https://www.thunderbird.net/en-US/thunderbird/78.1.1/releasenotes/
https://www.thunderbird.net/en-US/thunderbird/78.2.0/releasenotes/
https://www.thunderbird.net/en-US/thunderbird/78.2.1/releasenotes/
https://www.thunderbird.net/en-US/thunderbird/78.2.2/releasenotes/
https://www.thunderbird.net/en-US/thunderbird/78.3.0/releasenotes/
https://www.thunderbird.net/en-US/thunderbird/78.3.2/releasenotes/
https://www.thunderbird.net/en-US/thunderbird/78.3.3/releasenotes/
https://www.thunderbird.net/en-US/thunderbird/78.5.0/releasenotes/

Okay, so it looks like you've removed the repo that this PR merges from.
We will need another PR later to, so I'll unlink these issues from this PR.

Criteria, which really at this point can only contain OpenPGP support. Ideally I'd like to make sure things are cross-platform and open source, but that narrows the page down significantly further than what we've got. CanaryMail is closed source and MacOS only, but on Apple/iOS devices it is likely to provide the most native experience. Therefore I'm thinking we won't add a criteria as such, as it is a general guide.
We should evaluate https://github.com/privacytools/privacytools.io/issues/1248 as a possible alternative to k-9 mail, I've not used this.
https://github.com/privacytools/privacytools.io/issues/2120
https://github.com/privacytools/privacytools.io/issues/2133

For some reason this didn't end up merging with master, even though the status says it did, https://github.com/privacytools/privacytools.io/pull/2142 should fix that.