[issue45053] MD5SumTests.test_checksum_fodder fails on Windows

Nikita Sobolev report at bugs.python.org
Fri Sep 3 15:51:55 EDT 2021


Nikita Sobolev <mail at sobolevn.me> added the comment:

Yes, it was encodings problem :)

This line solved it (here: https://github.com/python/cpython/blob/6f8bc464e006f672d1aeafbfd7c774a40215dab2/Tools/scripts/md5sum.py#L69):

```python
out.write('%s %s\n' % (m.hexdigest(), filename.encode(
        sys.getfilesystemencoding(),
    ).decode(sys.stdout.encoding)))
```

> The simplest way to "fix" the test is using TESTFN_ASCII instead of TESTFN.

I haven't changed this, because right now it should work for non-ASCII symbols as well. I can even add an explicit ASCII test if needed.

Shouldn't https://github.com/python/cpython/pull/28060 be merge before I submit a new PR, so we can be sure that test now works? In the current state it will be just ignored.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45053>
_______________________________________


More information about the Python-bugs-list mailing list