Skip to content

[DRAFT] Initial Crash Test Script for Bidirectional Transpilation#63

Draft
shahrukhfu wants to merge 4 commits into
UniversalPython:mainfrom
shahrukhfu:test/bash-script-and-failure-logs
Draft

[DRAFT] Initial Crash Test Script for Bidirectional Transpilation#63
shahrukhfu wants to merge 4 commits into
UniversalPython:mainfrom
shahrukhfu:test/bash-script-and-failure-logs

Conversation

@shahrukhfu

Copy link
Copy Markdown

A script to identify crashes during the transpilation and reverse transpilation processes. As per @SaadBazaz 's guidance, I am starting with a barebone Bash script to understand the CLI behavior moving to a full pytest suite.

The script currently:

  • Validates Native to English transpilation.
  • Validates English to Native transpilation.
  • Captures and logs detailed Python tracebacks into test_failures.log for debugging.

Issues and observations:

  • The requirements.txt specifies PyYAML==5.4.1, which fails to build on Python 3.13 . Upgrading to the latest PyYAML resolves this.
  • After running the script, the transpiler "crashes" due to the following error:
Traceback (most recent call last):
  File "F:\UniversalPython\UniversalPython\universalpython\universalpython.py", line 210, in <module>
    sys.exit(main())
             ~~~~^^
  File "F:\UniversalPython\UniversalPython\universalpython\universalpython.py", line 207, in main
    return run_module(mode, code, args)
  File "F:\UniversalPython\UniversalPython\universalpython\universalpython.py", line 142, in run_module
    args['dictionary'] = determine_language(args, filename, code)
                         ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "F:\UniversalPython\UniversalPython\universalpython\universalpython.py", line 110, in determine_language
    detected_dictionary = DEFAULT_LANGUAGE_MAP.get(args['source_language'], {})['default']
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'default'

@SaadBazaz

Copy link
Copy Markdown
Collaborator

@shahrukhfu - Can you try a language other than German, for the test?

@shahrukhfu

shahrukhfu commented Mar 6, 2026

Copy link
Copy Markdown
Author

@SaadBazaz I have tested with a different language; french, and am getting the same error:

Traceback (most recent call last):
  File "F:\UniversalPython\universalpython\universalpython.py", line 210, in <module>
    sys.exit(main())
             ~~~~^^
  File "F:\UniversalPython\universalpython\universalpython.py", line 207, in main
    return run_module(mode, code, args)
  File "F:\UniversalPython\universalpython\universalpython.py", line 142, in run_module
    args['dictionary'] = determine_language(args, filename, code)
                         ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "F:\UniversalPython\universalpython\universalpython.py", line 110, in determine_language
    detected_dictionary = DEFAULT_LANGUAGE_MAP.get(args['source_language'], {})['default']
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'default'

@SaadBazaz

SaadBazaz commented Mar 8, 2026

Copy link
Copy Markdown
Collaborator

KeyError: 'default'

@shahrukhfu -
What do you think this error means? Can you explain?

It seems like you AI-generated all this but are not debugging it properly.

  1. Why did you write default?
  2. If you know why you did, what did you expect would happen?

@shahrukhfu

Copy link
Copy Markdown
Author

@SaadBazaz I have fixed the error, it was due to wrong initialization of the LANGUAGE variable in the bash script. There is no variable default in my script, it is an existing logic in universalpython.py, and the error occured because the code tried to access a dictionary which didn't exist (instead of "german" or "french" I was supposed to write the language code "de", "fr").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants