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
qstrs behave differently between REPL and frozen modules -- demonstrated by network_wlan.c bugs. #8052
Comments
envirocoder
changed the title
freezing of network_wlan.c broken.
qstrs behave differently between REPL and frozen modules -- demonstrated by network_wlan.c broken.
Dec 1, 2021
envirocoder
changed the title
qstrs behave differently between REPL and frozen modules -- demonstrated by network_wlan.c broken.
qstrs behave differently between REPL and frozen modules -- demonstrated by network_wlan.c bugs.
Dec 1, 2021
Thanks for the report. This was previously an issue on esp8266 and was fixed on that port, see #3442 |
dpgeorge
added a commit
to dpgeorge/micropython
that referenced
this issue
Dec 10, 2021
Following on from a previous fix for the same problem made in 3a431fb. Fixes issue micropython#8052. Signed-off-by: Damien George <damien@micropython.org>
See #8077 for a fix. |
dpgeorge
added a commit
to dpgeorge/micropython
that referenced
this issue
Dec 14, 2021
Following on from a previous fix for the same problem made in 3a431fb. Fixes issue micropython#8052. Signed-off-by: Damien George <damien@micropython.org>
Fixed by 5adb1fa |
leifbirger
pushed a commit
to leifbirger/micropython
that referenced
this issue
Jun 14, 2023
Following on from a previous fix for the same problem made in 3a431fb. Fixes issue micropython#8052. Signed-off-by: Damien George <damien@micropython.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code doesn't work in _boot.py but does when run from the repl.
resulting in the error:
I think this is related to string interning. Looking in corresponding generated frozen_content.c:
It appears
MP_QSTR_mac
is treated differently than\x64\x68\x63\x70\x5f\x68\x6f\x73\x74\x6e\x61\x6d\x65
(dhcp_hostname).I think this means that the reference to
case QS(MP_QSTR_dhcp_hostname):
onmicropython/ports/esp32/network_wlan.c
Line 527 in de7e3cd
I found this when adding my own code to the network_wlan -- initially I thought it was my bug (see https://forum.micropython.org/viewtopic.php?f=3&t=11519) but I now think its something wider.
While, as was pointed out to me, only literals shorter than length 10 are supposed to be QSTRs, in this behaviour they're looked up from strings on the REPL but not from frozen.
The text was updated successfully, but these errors were encountered: