I have a .Net 4.x WPF desktop solution that uses IronPython to run numerous scripts in the form of .py files. I've just finished migrating the solution to .Net 6, but I see this error when the software tries to run a particular script:
IronPython.Runtime.Exceptions.ValueErrorException: 'failed to parse CPython sys.version: '2.7.12 (2.7.12.1000)\n[.NETCoreApp,Version=v3.1 on .NET 6.0.6 (64-bit)]''
The .py file that fails simply displays the Python version:
import platform
...
print 'Using Python {0}'.format(platform.python_version())
How can I resolve this problem? Modifying the .py file is out of the question (at this stage), as we have a large customer base, all with the same script installed on their PCs.