I saw that too, and yet the logs have:
 import magic
  File "/usr/lib/python3/dist-packages/magic/__init__.py", line 361, in
<module>

That's a python3-magic file, so it exists.

However, a bit of googling showed up this [1] where due to the fact that
python3-magic uses ctype.util.find.library if the environment is "strange"
(e.g. in a snap) the load fails.
Possibly the reprotest environment qualifies as "strange" and the load line
is failing in an odd way?

   return ctypes.cdll.LoadLibrary(find_library('magic'))

Anyone else use python3-magic and reprotest? Does it work and why?

 - Craig


1: https://bugs.launchpad.net/snapcraft/+bug/1861026

On Fri, 29 Jan 2021 at 03:08, Emmanuel Arias <eam...@yaerobi.com> wrote:

> Seems that reprotest on salsa, is not installing the python3-magic.
>
> I don't think that can be a problem with cpython.
>
> On Thu, Jan 28, 2021 at 8:39 AM Håvard Flaget Aasen <
> haavard_aa...@yahoo.no> wrote:
>
>> tor. 28. jan. 2021 kl. 10:48 skrev Craig Small <csm...@debian.org>:
>> >
>> > Hi,
>> > I'm trying to understand why python3-mastodon fails the unit tests.
>>
>> I'm not sure what you found out so far. When I grepped the log you
>> linked, I  couldn't find python3-magic or libmagic. I believe the
>> packages isn't installed and the test therefore fails.
>> I'm guessing now, but I think this has to do with reproducible build in
>> salsa.
>>
>> >
>> > An example is at [1] and it seems that importing magic is enough to
>> trigger it. The compat line is to handle both python3-magic and a libmagic
>> module both wanting magic.
>> >
>> > Is this a cpython thing? I'm not sure what I can do to fix this.
>> >
>> >   File
>> "/tmp/reprotest.7a4W2G/build-experiment-1/build-experiment-1/.pybuild/cpython3_3.9_mastodon/build/mastodon/Mastodon.py",
>> line 55, in <module>
>> >     import magic
>> >   File "/usr/lib/python3/dist-packages/magic/__init__.py", line 361, in
>> <module>
>> >     add_compat(globals())
>> >   File "/usr/lib/python3/dist-packages/magic/__init__.py", line 325, in
>> add_compat
>> >     from magic import compat
>> >   File "/usr/lib/python3/dist-packages/magic/compat.py", line 61, in
>> <module>
>> >     _open = _libraries['magic'].magic_open
>> >   File "/usr/lib/python3.9/ctypes/__init__.py", line 387, in __getattr__
>> >     func = self.__getitem__(name)
>> >   File "/usr/lib/python3.9/ctypes/__init__.py", line 392, in __getitem__
>> >     func = self._FuncPtr((name_or_ordinal, self))
>> > AttributeError: python3.9: undefined symbol: magic_open
>> >
>> >
>> >
>> >
>> >
>> > 1:
>> https://salsa.debian.org/python-team/packages/mastodon/-/jobs/1312190
>> >
>>
>>

Reply via email to