Skip to content

fix(python): Fixes for Python code scanning alerts #11668

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

lucasssvaz
Copy link
Collaborator

@lucasssvaz lucasssvaz commented Jul 29, 2025

Description of Change

This pull request fixes issues reported by CodeQL. Mostly files which are not closed if an exception occurs.

Requires #11676

Tested locally.

@lucasssvaz lucasssvaz self-assigned this Jul 29, 2025
@lucasssvaz lucasssvaz added the Area: Tools & Build System Issue is related to tools and/or the build system label Jul 29, 2025
@lucasssvaz lucasssvaz requested a review from me-no-dev as a code owner July 29, 2025 13:57
Copy link
Contributor

github-actions bot commented Jul 29, 2025

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "Fix for Python code scanning alerts":
    • summary looks empty
    • type/action looks empty
  • the commit message "fix(udp_server): Fix logs":
    • summary looks too short

Please fix these commit messages - here are some basic tips:

  • follow Conventional Commits style
  • correct format of commit message should be: <type/action>(<scope/component>): <summary>, for example fix(esp32): Fixed startup timeout issue
  • allowed types are: change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 10 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses the Conventional Precommit Linter).

Messages
📖 This PR seems to be quite large (total lines of code: 2282), you might consider splitting it into smaller PRs

👋 Hello lucasssvaz, we appreciate your contribution to this project!


📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- Addressing info messages (📖) is strongly recommended; they're less critical but valuable.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against b717988

Copy link
Contributor

github-actions bot commented Jul 29, 2025

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32C5💚 -4200💚 -0.040.00000.000.00
ESP32P4000.000.00000.000.00
ESP32S3💚 -3640💚 -0.040.00000.000.00
ESP32S2💚 -356⚠️ +268💚 -0.04⚠️ +0.03000.000.00
ESP32C3000.000.00000.000.00
ESP32C6💚 -4280💚 -0.040.00000.000.00
ESP32H2000.000.00000.000.00
ESP32💚 -96⚠️ +492💚 -0.03⚠️ +0.05000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32C5ESP32P4ESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
EEPROM/examples/eeprom_class00--💚 -960--000000💚 -960
EEPROM/examples/eeprom_extra00--💚 -960--000000💚 -960
EEPROM/examples/eeprom_write00--00--00000000
ESP32/examples/AnalogOut/LEDCFade00--00--00000000
ESP32/examples/AnalogOut/LEDCGammaFade00--------0000--
ESP32/examples/AnalogOut/LEDCSingleChannel00--00--00000000
ESP32/examples/AnalogOut/LEDCSoftwareFade00--00--00000000
ESP32/examples/AnalogOut/SigmaDelta000000--00000000
ESP32/examples/AnalogOut/ledcFrequency000000--00000000
ESP32/examples/AnalogOut/ledcWrite_RGB000000--00000000
ESP32/examples/AnalogRead000000--00000000
ESP32/examples/AnalogReadContinuous0000000000000000
ESP32/examples/ArduinoStackSize0000000000000000
ESP32/examples/CI/CIBoardsTest0000000000000000
ESP32/examples/ChipID/GetChipID0000💚 -960💚 -960000000💚 -960
ESP32/examples/DeepSleep/TimerWakeUp000000000000--00
ESP32/examples/FreeRTOS/BasicMultiThreading0000000000000000
ESP32/examples/FreeRTOS/Mutex0000000000000000
ESP32/examples/FreeRTOS/Queue0000000000000000
ESP32/examples/FreeRTOS/Semaphore0000000000000000
ESP32/examples/GPIO/BlinkRGB0000000000000000
ESP32/examples/GPIO/FunctionalInterrupt0000000000000000
ESP32/examples/GPIO/FunctionalInterruptLambda0000000000000000
ESP32/examples/GPIO/FunctionalInterruptStruct0000000000000000
ESP32/examples/GPIO/GPIOInterrupt0000000000000000
ESP32/examples/HWCDC_Events000000--000000--
ESP32/examples/MacAddress/GetMacAddress0000000000000000
ESP32/examples/RMT/Legacy_RMT_Driver_Compatible0000000000000000
ESP32/examples/RMT/RMTCallback0000000000000000
ESP32/examples/RMT/RMTLoopback0000000000000000
ESP32/examples/RMT/RMTReadXJT0000000000000000
ESP32/examples/RMT/RMTWrite_RGB_LED0000000000000000
ESP32/examples/RMT/RMT_CPUFreq_Test0000000000000000
ESP32/examples/RMT/RMT_EndOfTransmissionState0000000000000000
ESP32/examples/RMT/RMT_LED_Blink0000000000000000
ESP32/examples/ResetReason/ResetReason0000000000000000
ESP32/examples/ResetReason/ResetReason20000000000000000
ESP32/examples/Serial/BaudRateDetect_Demo0000000000000000
ESP32/examples/Serial/OnReceiveError_BREAK_Demo0000000000000000
ESP32/examples/Serial/OnReceive_Demo0000000000000000
ESP32/examples/Serial/RS485_Echo_Demo0000000000000000
ESP32/examples/Serial/RxFIFOFull_Demo0000000000000000
ESP32/examples/Serial/RxTimeout_Demo0000000000000000
ESP32/examples/Serial/Serial_All_CPU_Freqs0000000000000000
ESP32/examples/Serial/Serial_STD_Func_OnReceive0000000000000000
ESP32/examples/Serial/onReceiveExample0000000000000000
ESP32/examples/Template/ExampleTemplate0000000000000000
ESP32/examples/Time/SimpleTime000000000000--00
ESP32/examples/Timer/RepeatTimer0000000000000000
ESP32/examples/Timer/WatchdogTimer000000000000--00
ESP_I2S/examples/ES8388_loopback000000000000--00
ESP_I2S/examples/Simple_tone000000000000--00
ESP_NOW/examples/ESP_NOW_Broadcast_Master00--💚 -960💚 -9600000--💚 -960
ESP_NOW/examples/ESP_NOW_Broadcast_Slave00--💚 -960💚 -9600000--💚 -960
ESP_NOW/examples/ESP_NOW_Network00--💚 -960💚 -8800000--💚 -960
ESP_NOW/examples/ESP_NOW_Serial00--00000000--00
ESPmDNS/examples/mDNS-SD_Extended000000000000--00
ESPmDNS/examples/mDNS_Web_Server000000000000--00
Ethernet/examples/ETH_W5500_Arduino_SPI000000000000----
Ethernet/examples/ETH_W5500_IDF_SPI000000000000----
Ethernet/examples/ETH_WIFI_BRIDGE000000000000----
FFat/examples/FFat_Test000000000000----
FFat/examples/FFat_time000000000000----
HTTPClient/examples/Authorization000000000000----
HTTPClient/examples/BasicHttpClient00--00000000----
HTTPClient/examples/BasicHttpsClient00--00000000----
HTTPClient/examples/HTTPClientEnterprise00--💚 -960💚 -9600000----
HTTPClient/examples/ReuseConnection00--0000--00----
HTTPClient/examples/StreamHttpClient00--0000--00----
HTTPUpdate/examples/httpUpdate💚 -4200--💚 -3640💚 -3560--💚 -4280----
HTTPUpdate/examples/httpUpdateSPIFFS💚 -4200--💚 -3640💚 -3560--💚 -4280----
HTTPUpdate/examples/httpUpdateSecure💚 -4200--💚 -3440💚 -3320--💚 -4280----
HTTPUpdateServer/examples/WebUpdater💚 -3380----⚠️ +2680--💚 -3380----
Hash/examples/Hex----------------
Hash/examples/MD5----------------
Hash/examples/PBKDF2_HMAC----------------
Hash/examples/SHA1----------------
Hash/examples/SHA2----------------
Hash/examples/SHA3----------------
Hash/examples/SHA3Stream----------------
ESP32/examples/DeepSleep/TouchWakeUp--000000------00
ESP32/examples/TWAI/TWAIreceive--00000000000000
ESP32/examples/TWAI/TWAItransmit--00000000000000
ESP32/examples/Touch/TouchInterrupt--000000------00
ESP32/examples/Touch/TouchRead--000000------00
ESP_I2S/examples/Record_to_WAV--0000--------00
Ethernet/examples/ETH_TLK110--00------------
ESP32/examples/Camera/CameraWebServer (1)----0000------00
ESP32/examples/Camera/CameraWebServer (2)----0000------00
ESP32/examples/Camera/CameraWebServer (3)----00----------
ESP32/examples/DeepSleep/ExternalWakeUp----0000------00
ESP_SR/examples/Basic----00----------
BLE/examples/iBeacon--------00--00--
DNSServer/examples/CaptivePortal--------00----⚠️ +4920
BluetoothSerial/examples/DiscoverConnect--------------00
BluetoothSerial/examples/GetLocalMAC--------------00
BluetoothSerial/examples/SerialToSerialBT--------------00
BluetoothSerial/examples/SerialToSerialBTM--------------00
BluetoothSerial/examples/SerialToSerialBT_Legacy--------------00
BluetoothSerial/examples/SerialToSerialBT_SSP--------------00
BluetoothSerial/examples/bt_classic_device_discovery--------------00
BluetoothSerial/examples/bt_remove_paired_devices--------------00
ESP32/examples/DeepSleep/SmoothBlink_ULP_Code--------------00
Ethernet/examples/ETH_LAN8720--------------00

@lucasssvaz lucasssvaz requested review from SuGlider and a team as code owners August 1, 2025 16:42
Copy link
Contributor

github-actions bot commented Aug 1, 2025

Test Results

 76 files   76 suites   13m 10s ⏱️
 38 tests  38 ✅ 0 💤 0 ❌
241 runs  241 ✅ 0 💤 0 ❌

Results for commit b717988.

♻️ This comment has been updated with latest results.

@lucasssvaz lucasssvaz requested a review from P-R-O-C-H-Y August 1, 2025 22:33
@lucasssvaz lucasssvaz added the Status: Blocked upstream 🛑 PR is waiting on upstream changes to be merged first label Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Tools & Build System Issue is related to tools and/or the build system Status: Blocked upstream 🛑 PR is waiting on upstream changes to be merged first
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants