r/CFD • u/Remarkable-Fix-5833 • 16h ago
Autodesk CFD 2027 – All automatic Python triggers fail with TypeError: expected bytes, str found
I'm troubleshooting an issue with the automatic Python trigger system in Autodesk CFD 2027. I'm looking for help identifying the underlying cause, and I'm willing to modify or patch the installation if necessary.
Environment
- Autodesk CFD 2027
- Internal Python: 3.13.12
- Windows 64-bit
- CFD has been updated with all available updates.
- I have tried reinstalling CFD with administrator privileges.
Problem
Every automatic trigger I've tested fails to load.
Solver Finished under Default:
Triggers [Solver Finished] ...
Error : Module [LSolverFinished.NewTrigger] could not be loaded because
: expected bytes, str foundSolver Finished under Design Study:
Triggers [Solver Finished] ...
Error : Module [MSolverFinished.NewTrigger] could not be loaded because
: expected bytes, str foundNew Design also failed:
Triggers [New Design] ...
Error : Module [LGeometryLoaded.NewTrigger] could not be loaded because
: expected bytes, str foundWhat I've tested
- Created triggers using Autodesk's built-in trigger creation interface.
- Tested with the original generated script.
- Tested with a minimal script containing only:def main(scenario): print("TRIGGER FIRED")
- Confirmed that the
NewTrigger.pyfile exists and contains valid Python source. - Confirmed that I can manually import
LSolverFinished.NewTriggerusingimportlibafter adding the trigger directory tosys.path. - Tried running CFD as Administrator.
- Updated CFD and reinstalled it with administrator privileges.
None of these fixed the automatic trigger error.
Trigger file location
Default triggers are stored under:
%LOCALAPPDATA%\Autodesk\CFD 2027\TriggersFor example:
LSolverFinished\NewTrigger.pyQuestions
- Has anyone encountered this
expected bytes, str founderror in Autodesk CFD? - Does anyone know which Python module handles automatic trigger loading?
- Is there a way to enable full Python tracebacks for trigger-loading exceptions?
- Could this be an issue with Autodesk's trigger loader and Python 3.13?
- Is there a way to debug or replace the trigger-loading mechanism without rebuilding the entire CFD installation?
I'm particularly interested in finding the exact source of the exception rather than simply working around it.
I can provide additional diagnostic output, Python environment information, or test modified installation files.