datalad / datalad-gooey

A graphical user interface for DataLad (datalad.org)
https://docs.datalad.org/projects/gooey
Other
4 stars 6 forks source link

History list does not handle encoding properly #375

Closed adswa closed 1 year ago

adswa commented 1 year ago

Example

image

adswa commented 1 year ago

Interesting: image

adswa commented 1 year ago

I think its an issue with the StdOutProtocol of core: If I specify this protocol, I can see the encoding issue, but not if I use it without a protocol specification


>>> from datalad.runner import GitRunner, StdOutCapture
>>> cmd = ["git", "log", "--pretty=format:%h%x00%D%x00%as%x00%aN%x00%aE%x00%s", "-n", "3", "--", "tools"]
>>> runner = GitRunner()
>>> runner.run(cmd)
69b5f08^@^@2022-10-14^@Christian Monch^@christian.moench@web.de^@use powershell in shortcut
1e88af2^@^@2022-10-14^@Christian Monch^@christian.moench@web.de^@make datalad-command available to datalad_gooey
0a3faf7^@^@2022-10-06^@Christian Mönch^@christian.moench@web.de^@add resources for windows installer building
{'stdout': '', 'stderr': ''}
>>> runner.run(cmd, protocol=StdOutCapture)
{'stdout': '69b5f08\x00\x002022-10-14\x00Christian Monch\x00christian.moench@web.de\x00use powershell in shortcut\n
1e88af2\x00\x002022-10-14\x00Christian Monch\x00christian.moench@web.de\x00make datalad-command available to datalad_gooey
\n0a3faf7\x00\x002022-10-06\x00Christian Mönch\x00christian.moench@web.de\x00add resources for windows installer building', 'stderr': ''}