Skip to content

Conversation

@StanFromIreland
Copy link
Contributor

@StanFromIreland
Copy link
Contributor Author

I've managed to install it, now I need to link it.

@StanFromIreland
Copy link
Contributor Author

It now builds successfully, but does not import.

@bodograumann
Copy link
Owner

Great progress!

@StanFromIreland
Copy link
Contributor Author

We can also try cache the dependency, so that we can skip the ~5 minute install step.

@StanFromIreland
Copy link
Contributor Author

Ok, I have now got it to the same failures as on the MacOS runner!

@StanFromIreland
Copy link
Contributor Author

Some progress has been made, it now builds on Windows and Mac alright, but it seems they don't provide all (and different) codecs:

 ======================================================================
ERROR: test_decode (test_iconvcodec.TestIconvcodecModule.test_decode)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/runner/work/python-iconv/python-iconv/test_iconvcodec.py", line 17, in test_decode
    string = b"Hallo".decode("T.61")
             ^^^^^^^^^^^^^^^^^^^^^^^
LookupError: unknown encoding: T.61

======================================================================
ERROR: test_encode (test_iconvcodec.TestIconvcodecModule.test_encode)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/runner/work/python-iconv/python-iconv/test_iconvcodec.py", line 8, in test_encode
    bytestring = "Hallo".encode("T.61")
                 ^^^^^^^^^^^^^^^^^^^^^^
LookupError: unknown encoding: T.61

======================================================================
ERROR: test_incremental_decode (test_iconvcodec.TestIconvcodecModule.test_incremental_decode)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/runner/work/python-iconv/python-iconv/test_iconvcodec.py", line 34, in test_incremental_decode
    decoder = codecs.getincrementaldecoder("UCS2")()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen codecs>", line 1013, in getincrementaldecoder
LookupError: unknown encoding: UCS2

======================================================================
ERROR: test_transliterate (test_iconvcodec.TestIconvcodecModule.test_transliterate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/runner/work/python-iconv/python-iconv/iconvcodec.py", line 13, in _iconv_encode_impl
    return encoder.iconv(msg, bufsize), len(msg)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
iconv.error: ('Illegal byte sequence', 92, 7, b'abc ss ')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/runner/work/python-iconv/python-iconv/test_iconvcodec.py", line 22, in test_transliterate
    bytestring = string.encode("ASCII//TRANSLIT")
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/runner/work/python-iconv/python-iconv/iconvcodec.py", line 96, in encode
    return _iconv_encode_impl(encoder, msg, errors)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/runner/work/python-iconv/python-iconv/iconvcodec.py", line 31, in _iconv_encode_impl
    raise UnicodeError(*e.args)
UnicodeError: ('Illegal byte sequence', 92, 7, b'abc ss ')
encoding with 'ASCII//TRANSLIT' codec failed

======================================================================
FAIL: test_encode_with_long_out (test_iconvcodec.TestIconvcodecModule.test_encode_with_long_out)
Edge case where output has more bytes than input as utf-8
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/runner/work/python-iconv/python-iconv/test_iconvcodec.py", line 14, in test_encode_with_long_out
    self.assertEqual(bytestring, b"(TM)")
AssertionError: b'TM' != b'(TM)'

@StanFromIreland
Copy link
Contributor Author

@pffang, maybe you could please shine some light onto this, why does libiconv-for-Windows provide different codecs?

@StanFromIreland StanFromIreland marked this pull request as ready for review November 1, 2025 21:46
@StanFromIreland
Copy link
Contributor Author

Patching tests, the CI is now fully green.

@bodograumann bodograumann merged commit 1a08330 into bodograumann:master Nov 1, 2025
19 checks passed
@StanFromIreland StanFromIreland deleted the windows-fix branch November 1, 2025 21:58
@pffang
Copy link

pffang commented Nov 24, 2025

Sorry for late to see this.
I didn't get your points. But if you want to make tests, it's better to read the test strings from independent txt files.
Because the string encoding in code sources always depends on the encoding of source files and the processing methods of code language.
The compiler or interpreter may make some conversion, it's difficult to keep the encoding as your imagine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants