# square brackets bug

**URL:** <https://forum.djangoproject.com/t/square-brackets-bug/29632>\
**Category:** Mystery Errors\
**Created:** [March 29, 2024, 8:16pm UTC](https://forum.djangoproject.com/t/square-brackets-bug/29632 "2024-03-29T20:16:15Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![MrkGrgsn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mrkgrgsn/32/7901_2.png) [@MrkGrgsn](https://forum.djangoproject.com/u/MrkGrgsn)\
**Post date:** [June 20, 2024, 4:30am UTC](https://forum.djangoproject.com/t/square-brackets-bug/29632/13 "2024-06-20T04:30:37Z")

</div>

After poking around in Django core, I believe this issue is caused by this Python 3.12 bug relating to subinterpreters: [Weird `int. __str__ ` behaviour inside sub-interpreters · Issue #117482 · python/cpython · GitHub](https://github.com/python/cpython/issues/117482) I was able to reproduce the problem using a modified version of the test case.

```auto
import _xxsubinterpreters as interpreters

script = """
import django
from django.conf import settings
from django.forms.utils import ErrorList

settings.configure()
django.setup()

empty = ErrorList([])

print(str(empty))
"""

exec(script)
# Output: ""

interp_id = interpreters.create(isolated=False)
interpreters.run_string(interp_id, script)
# Output: []

```

---

_[View the full topic](https://forum.djangoproject.com/t/square-brackets-bug/29632)._
