Leading newline in multiline upload_port breaks device monitor port resolution
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Start by tracing how pio project config --json-output parses and resolves upload_port, then follow how pio device monitor -e rx receives monitor_port. Check the existing tests for multiline configuration values and single-value serial port options. Done when the indented value resolves to the same path as the inline value and the monitor can use it without a leading newline.
Written by the indexing model from the issue text.
Description
- PlatformIO Core
Configuration
- Operating system: macOS 26.6 (arm64)
- PlatformIO Core: 6.2.0
Steps to reproduce
Create a platformio.ini with a single serial port specified on an indented continuation line:
[env]
monitor_port = ${this.upload_port}
[env:rx]
platform = espressif32
board = seeed_xiao_esp32s3
framework = arduino
upload_port =
/dev/cu.usbmodem201301
; /dev/cu.usbmodem2011101
- Run
pio project config --json-output. No hardware is required for this step. - To see the runtime failure, substitute a connected device's serial port and run
pio device monitor -e rxdirectly in an interactive terminal, without a pipe.
Actual results
The resolved upload_port and monitor_port values both contain a leading newline ("\n/dev/cu.usbmodem201301"). The monitor passes that string to pySerial and fails to open the port with No such file or directory, even though the device exists. Stating the same value on the assignment line (upload_port = /dev/cu.usbmodem201301) works.
Expected results
For these single-value serial port options, ignore surrounding whitespace after resolving the INI value and interpolation. The indented form with one port should resolve to the same path as the inline form. This would preserve the behavior of other multiline options.
Additional information
Python's ConfigParser accepts the continuation syntax and preserves the leading newline.
- Dominant language
- Python
- Stars
- 9.6k
- Forks
- 916
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from platformio/platformio-core
-
Toolchain include order from DumpIntegrationIncludes depends on directory order (unsorted glob)Possibly taken @Leooo21 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
platformio/platformio-core#5555 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
platformio/platformio-core#5554 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
platformio/platformio-core#5551 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
platformio/platformio-core#5553 ·
Maintainers usually reply within 1 day
-
Feature suggestion: build_src_unflagsPossibly taken @hariomkhonde108 claimed this 8 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 62/100
platformio/platformio-core#5547 · 1 comment ·
Maintainers usually reply within 1 day
All issues in platformio/platformio-core
Similar issues
-
docs(contributing): the two things that silently block a PRPossibly taken A pull request linked to this issue is open or already merged. Openavailable documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Nixitov/Riptide-Native#944 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
JTHCode/secretguard#24 ·
Maintainers usually reply within 1 day
-
area: middleware documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainers usually reply within 1 day