On 06. 07. 23 11:21, Ankur Sinha wrote:

Hi folks,

While looking into the vit FTI bug[1], I ran into this error in the
test:

======================================================================
ERROR: vit (unittest.loader._FailedTest.vit)
----------------------------------------------------------------------
ImportError: Failed to import test module: vit
Traceback (most recent call last):
   File "/usr/lib64/python3.12/unittest/loader.py", line 415, in _find_test_path
     package = self._get_module_from_name(name)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib64/python3.12/unittest/loader.py", line 325, in 
_get_module_from_name
     __import__(name)
   File "/builddir/build/BUILD/vit-2.3.0/vit/__init__.py", line 2, in <module>
     from .application import Application
   File "/builddir/build/BUILD/vit-2.3.0/vit/application.py", line 19, in 
<module>
     from vit.formatter_base import FormatterBase
   File "/builddir/build/BUILD/vit-2.3.0/vit/formatter_base.py", line 8, in 
<module>
     from vit import util
   File "/builddir/build/BUILD/vit-2.3.0/vit/util.py", line 7, in <module>
     from urwid.str_util import calc_width
ImportError: 
/usr/lib64/python3.12/site-packages/urwid/str_util.cpython-312-x86_64-linux-gnu.so:
 undefined symbol: PyUnicode_AS_UNICODE


A web search brought me here:
https://github.com/cython/cython/issues/5149

How would we fix this? Is this something that needs fixing in urwid?

I still see PyUnicode_AS_UNICODE used there:
https://github.com/search?q=repo%3Aurwid%2Furwid%20PyUnicode_AS_UNICODE&type=code

(and no issues filed about it yet).

This is https://peps.python.org/pep-0623/#python-3-12

I don't know what is the proper replacement. Either way, this needs to be fixed in python-urwid. It has tests ignored out, so the problem was masked away. It could at least use an import check.

It has this in the build.log:

gcc ... -fPIC -I/usr/include/python3.12 -c source/str_util.c -o build/temp.linux-x86_64-cpython-312/source/str_util.o
source/str_util.c: In function ‘Py_IsWideChar’:
source/str_util.c:484:16: warning: implicit declaration of function ‘PyUnicode_AS_UNICODE’; did you mean ‘PyUnicode_AsUCS4’? [-Wimplicit-function-declaration]
  484 |         ustr = PyUnicode_AS_UNICODE(text);
      |                ^~~~~~~~~~~~~~~~~~~~
      |                PyUnicode_AsUCS4
source/str_util.c:484:14: warning: assignment to ‘Py_UNICODE *’ {aka ‘int *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  484 |         ustr = PyUnicode_AS_UNICODE(text);
      |              ^
source/str_util.c: In function ‘Py_CalcWidth’:
source/str_util.c:663:14: warning: assignment to ‘Py_UNICODE *’ {aka ‘int *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  663 |         ustr = PyUnicode_AS_UNICODE(text);
      |              ^
source/str_util.c: In function ‘Py_CalcTextPos’:
source/str_util.c:749:14: warning: assignment to ‘Py_UNICODE *’ {aka ‘int *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  749 |         ustr = PyUnicode_AS_UNICODE(text);
      |              ^

--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
_______________________________________________
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to