Comment 9 for bug 2037595

Revision history for this message
Chris Halse Rogers (raof) wrote :

ubuntu@sru-focal:~$ python3
Python 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gpg
>>> c = gpg.Context()
>>> list(c.keylist())
[]
>>> fs = []
>>> for i in range(1024):
... fs.append(open('/dev/null'))
...
>>> list(c.keylist())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/gpg/core.py", line 751, in keylist
    key = self.op_keylist_next()
  File "/usr/lib/python3/dist-packages/gpg/core.py", line 1195, in op_keylist_next
    raise excp
  File "/usr/lib/python3/dist-packages/gpg/core.py", line 1190, in op_keylist_next
    errorcheck(gpgme.gpgme_op_keylist_next(self.wrapped, ptr))
  File "/usr/lib/python3/dist-packages/gpg/errors.py", line 129, in errorcheck
    raise GPGMEError(retval, extradata)
gpg.errors.GPGMEError: GPGME: Too many open files
>>>

ubuntu@sru-focal:~$ sudo apt install -t focal-proposed libgpgme11
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:
  libgpgme11
1 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
Need to get 120 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 libgpgme11 amd64 1.13.1-7ubuntu2.2 [120 kB]
Fetched 120 kB in 1s (95.6 kB/s)
(Reading database ... 32247 files and directories currently installed.)
Preparing to unpack .../libgpgme11_1.13.1-7ubuntu2.2_amd64.deb ...
Unpacking libgpgme11:amd64 (1.13.1-7ubuntu2.2) over (1.13.1-7ubuntu2.1) ...
Setting up libgpgme11:amd64 (1.13.1-7ubuntu2.2) ...
Processing triggers for libc-bin (2.31-0ubuntu9.14) ...

ubuntu@sru-focal:~$ python3
Python 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gpg
>>> c = gpg.Context()
>>> list(c.keylist())
[]
>>> fs = []
>>> for i in range(1024):
... fs.append(open('/dev/null'))
...
>>> list(c.keylist())
[]
>>>