Skip to content

[Windows] make check issues #147

@greenozon

Description

@greenozon

There are some issues that stop running of TC under Windows

after fixing Access Denied one that was stopping TC run on a very early phase, there is another one now, that hits later on:

c:\Dev\python\python-xdis-orig>make check
python -m pytest pytest
========================================================================================= test session starts =========================================================================================
platform win32 -- Python 3.12.5, pytest-8.3.2, pluggy-1.5.0
rootdir: c:\Dev\python\python-xdis-orig
configfile: pyproject.toml
collected 35 items

pytest\test_bytecode.py ..                                                                                                                                                                       [  5%]
pytest\test_codetype.py .                                                                                                                                                                        [  8%]
pytest\test_cross_dis.py .                                                                                                                                                                       [ 11%]
pytest\test_disasm.py sssssssss                                                                                                                                                                  [ 37%]
pytest\test_instructions.py ..                                                                                                                                                                   [ 42%]
pytest\test_load_file.py s                                                                                                                                                                       [ 45%]
pytest\test_magic.py .                                                                                                                                                                           [ 48%]
pytest\test_opcode.py .                                                                                                                                                                          [ 51%]
pytest\test_stack_effect.py ..                                                                                                                                                                   [ 57%]
pytest\test_std.py ............s..                                                                                                                                                               [100%]

========================================================================================== warnings summary ===========================================================================================
pytest/test_codetype.py::test_codeType2Portable
  c:\Dev\python\python-xdis-orig\xdis\codetype\__init__.py:44: DeprecationWarning: co_lnotab is deprecated, use co_lines instead.
    line_table_field = "co_lnotab" if hasattr(code, "co_lnotab") else "co_linetable"

pytest/test_codetype.py::test_codeType2Portable
  c:\Dev\python\python-xdis-orig\xdis\codetype\__init__.py:45: DeprecationWarning: co_lnotab is deprecated, use co_lines instead.
    line_table = getattr(code, line_table_field)

pytest/test_std.py::test_write_bytecode_file
pytest/test_std.py::test_write_bytecode_bad_timestamp_type
  c:\Dev\python\python-xdis-orig\pytest\test_std.py:214: DeprecationWarning: co_lnotab is deprecated, use co_lines instead.
    fn_code.co_lnotab,  # In general, You should adjust this

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================= 24 passed, 11 skipped, 4 warnings in 0.29s ==============================================================================
make[1]: Entering directory '/c/Dev/python/python-xdis-orig/test'
python test_pyenvlib.py --simple
Sat Aug 17 17:01:27 2024
Processed 24 files, total
Sat Aug 17 17:01:27 2024
0.00500011 seconds
Sat Aug 17 17:01:27 2024
Processed 1 files, total
Sat Aug 17 17:01:27 2024
0.0120006 seconds
python test_pythonlib.py \
          --bytecode-1.0 --bytecode-1.1 --bytecode-1.2 --bytecode-1.3 \
                  --bytecode-1.4 --bytecode-1.5 --bytecode-1.6 \
          --bytecode-2.1 --bytecode-2.2 --bytecode-2.3 \
                  --bytecode-2.4 --bytecode-2.5 \
          --bytecode-2.5dropbox \
                  --bytecode-2.6 --bytecode-2.7 \
          --bytecode-3.0 --bytecode-3.1 \
                  --bytecode-3.2 --bytecode-3.3 \
                  --bytecode-3.4 --bytecode-3.5 \
          --bytecode-3.6 --bytecode-3.7 --bytecode-3.8 \
          --bytecode-3.9 --bytecode-3.10 \
          --bytecode-2.7pypy --bytecode-3.2pypy \
                  --bytecode-pypy35 --bytecode-pypy36 --bytecode-pypy37 --bytecode-pypy38
Sat Aug 17 17:01:27 2024
Source directory:  C:\Dev\python\python-xdis-orig\test\bytecode_1.0
Sat Aug 17 17:01:27 2024
Source directory:  C:\Dev\python\python-xdis-orig\test\bytecode_1.1
Sat Aug 17 17:01:27 2024
Source directory:  C:\Dev\python\python-xdis-orig\test\bytecode_1.2
Sat Aug 17 17:01:27 2024
Source directory:  C:\Dev\python\python-xdis-orig\test\bytecode_1.3
Sat Aug 17 17:01:28 2024
Source directory:  C:\Dev\python\python-xdis-orig\test\bytecode_1.4
Sat Aug 17 17:01:28 2024
Source directory:  C:\Dev\python\python-xdis-orig\test\bytecode_1.5
Sat Aug 17 17:01:28 2024
Source directory:  C:\Dev\python\python-xdis-orig\test\bytecode_1.6
Sat Aug 17 17:01:28 2024
Source directory:  C:\Dev\python\python-xdis-orig\test\bytecode_2.1
Sat Aug 17 17:01:28 2024
Source directory:  C:\Dev\python\python-xdis-orig\test\bytecode_2.2
Sat Aug 17 17:01:28 2024
Source directory:  C:\Dev\python\python-xdis-orig\test\bytecode_2.3
Traceback (most recent call last):
  File "C:\Dev\python\python-xdis-orig\test\test_pythonlib.py", line 292, in <module>
    do_tests(src_dir, pattern, target_dir, test_opts)
  File "C:\Dev\python\python-xdis-orig\test\test_pythonlib.py", line 210, in do_tests
    disassemble_file(infile, output)
  File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\xdis\disasm.py", line 371, in disassemble_file
    disco(
  File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\xdis\disasm.py", line 163, in disco
    real_out.write(format_code_info(co, version_tuple, is_graal=is_graal) + "\n")
  File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\encodings\cp1251.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\xe7' in position 216: character maps to <undefined>
make[1]: *** [Makefile:13: check] Error 1
make[1]: Leaving directory '/c/Dev/python/python-xdis-orig/test'
make: *** [Makefile:37: check] Error 2

My gut feeling is that there should be some treatment applied using the "utf-8" encoding
Yeah, I agree, it works out of the box under any Linux, but we are special guys, the WIndows ones :)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions