Bug 2576595 - python-pypandoc fails to build with Python 3.16: test_sorting_rules_applied_for_multiple_files: TypeError: Expected str, bytes or None, not list
Summary: python-pypandoc fails to build with Python 3.16: test_sorting_rules_applied_f...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pypandoc
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zbigniew Jędrzejewski-Szmek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.16
TreeView+ depends on / blocked
 
Reported: 2026-11-19 13:09 UTC by Karolina Surma
Modified: 2026-11-19 13:09 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2026-11-19 13:09:16 UTC
python-pypandoc fails to build with Python 3.16.0a2.

__________ TestPypandoc.test_sorting_rules_applied_for_multiple_files __________

self = <tests.test_pypandoc.TestPypandoc testMethod=test_sorting_rules_applied_for_multiple_files>

    def test_sorting_rules_applied_for_multiple_files(self):
        with closed_tempfile(".md", prefix="1_", text="some title 1") as file_name1:
            with closed_tempfile(".md", prefix="2_", text="some title 2") as file_name2:
                expected = "<p>some title 2</p>\n<p>some title 1</p>"
>               received = pypandoc.convert_file(
                    [file_name2, file_name1], "html", sort_files=False
                )

tests/test_pypandoc.py:227: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pypandoc/__init__.py:171: in convert_file
    if _is_network_path(source_file):  # if the source_file is an url
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pypandoc/__init__.py:289: in _is_network_path
    result = urllib.parse.urlparse(source)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib64/python3.16/urllib/parse.py:483: in urlparse
    url, scheme, _coerce_result = _coerce_args(url, scheme)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (['/tmp/2_0mj6l2az.md', '/tmp/1_knw15s_d.md'], None)

    def _coerce_args(*args):
        # Invokes decode if necessary to create str args
        # and returns the coerced inputs along with
        # an appropriate result coercion function
        #   - noop for str inputs
        #   - encoding function otherwise
        str_input = None
        for arg in args:
            if not (arg is None or isinstance(arg, str) or hasattr(arg, 'decode')):
                if arg:
>                   raise TypeError("Expected str, bytes or None, "
                                    f"not {type(arg).__name__}")
E                   TypeError: Expected str, bytes or None, not list

/usr/lib64/python3.16/urllib/parse.py:130: TypeError

https://docs.python.org/3.16/whatsnew/3.16.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.16/fedora-rawhide-x86_64/11359685-python-pypandoc/

For all our attempts to build python-pypandoc with Python 3.16, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.16/package/python-pypandoc/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.16:
https://copr.fedorainfracloud.org/coprs/g/python/python3.16/

Let us know here if you have any questions.

Python 3.16 is planned to be included in Fedora 47.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.16.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.


Note You need to log in before you can comment on or make changes to this bug.