Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: Unhandled exception "TypeError: 'str' object does not support item assignment" (#3a36fdbd) #978

Closed
commixreporter opened this issue Nov 7, 2024 · 2 comments

Comments

@commixreporter
Copy link

Commix version: 4.0-dev#106
Python version: 3.12.3
Operating system: posix
Command line: commix.py -r *************************** --all

Traceback (most recent call last):
  File \"commix.py", line 36, in <module>
    main()
  File \"commix.py", line 31, in main
    import src.core.main
  File \"main.py", line 899, in <module>
    main(filename, url, http_request_method)
  File \"main.py", line 560, in main
    controller.do_check(url, http_request_method, filename)
  File \"controller.py", line 743, in do_check
    perform_checks(url, http_request_method, filename)
  File \"controller.py", line 706, in perform_checks
    data_checks(url, http_request_method, filename, timesec)
  File \"controller.py", line 623, in data_checks
    if post_request(url, http_request_method, filename, timesec) is None:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"controller.py", line 598, in post_request
    found_parameter = parameters.do_POST_check(parameter, http_request_method)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"parameters.py", line 434, in do_POST_check
    parameter = json_int_check(parameter, value)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"parameters.py", line 277, in json_int_check
    parameter = unflatten_list(parameter)
                ^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"flatten_json.py", line 131, in unflatten_list
    unflattened_dict = unflatten(flat_dict, separator)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"flatten_json.py", line 111, in unflatten
    _unflatten(unflattened_dict, item.split(separator), flat_dict[item])
  File \"flatten_json.py", line 108, in _unflatten
    dic[keys[-1]] = value
    ~~~^^^^^^^^^^
TypeError: 'str' object does not support item assignment
@stasinopoulos
Copy link
Member

Verified via using the following nested JSON:

{ "count": 2, "results": [ { "test": 2, "related_object": { "happiness": { "assessment": "1", "assessment_verbose": "Neutral" } } } ] }

Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

This action has been performed automatically by a bot.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants