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

Avoid WindowsPath errors for 'qmk format-text' #24905

Merged
merged 1 commit into from
Feb 8, 2025

Conversation

zvecr
Copy link
Member

@zvecr zvecr commented Feb 8, 2025

Description

qmk format-text /c/Users/treyw/qmk_firmware/keyboards/cloud_macro/readme.md
<class 'TypeError'>expected string or bytes-like object, got 'WindowsPath'
Traceback (most recent call last):
  File "C:/QMK_MSYS/mingw64/lib/python3.11/site-packages/milc/milc.py", line 604, in call
    return self.call()
           ^^^^^^^^^^^^^^^
  File "C:/QMK_MSYS/mingw64/lib/python3.11/site-packages/milc/milc.py", line 609, in call
    return self._subcommand(self)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:/Users/treyw/qmk_firmware/lib/python/qmk/cli/format/text.py", line 57, in format_text
    return dos2unix_run(files)
           ^^^^^^^^^^^^^^^^^^^
  File "C:/Users/treyw/qmk_firmware/lib/python/qmk/cli/format/text.py", line 22, in dos2unix_run
    dos2unix = cli.run(['dos2unix', *chunk])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:/QMK_MSYS/mingw64/lib/python3.11/site-packages/milc/milc.py", line 168, in run
    safecmd = ' '.join(map(shlex.quote, command))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:/QMK_MSYS/mingw64/lib/python3.11/shlex.py", line 329, in quote
    if _find_unsafe(s) is None:
       ^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'WindowsPath'

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added python cli qmk cli command labels Feb 8, 2025
@zvecr zvecr added the bug label Feb 8, 2025
@zvecr zvecr merged commit 2699e2f into qmk:master Feb 8, 2025
5 checks passed
@zvecr zvecr deleted the format_text_windows branch February 8, 2025 12:17
TinfoilSubmarine pushed a commit to TinfoilSubmarine/qmk_firmware that referenced this pull request Feb 13, 2025
TinfoilSubmarine pushed a commit to TinfoilSubmarine/qmk_firmware that referenced this pull request Feb 13, 2025
TinfoilSubmarine pushed a commit to TinfoilSubmarine/qmk_firmware that referenced this pull request Feb 14, 2025
TinfoilSubmarine pushed a commit to TinfoilSubmarine/qmk_firmware that referenced this pull request Feb 14, 2025
TinfoilSubmarine pushed a commit to TinfoilSubmarine/qmk_firmware that referenced this pull request Feb 14, 2025
TinfoilSubmarine pushed a commit to TinfoilSubmarine/qmk_firmware that referenced this pull request Feb 14, 2025
TinfoilSubmarine pushed a commit to TinfoilSubmarine/qmk_firmware that referenced this pull request Feb 14, 2025
TinfoilSubmarine pushed a commit to TinfoilSubmarine/qmk_firmware that referenced this pull request Feb 14, 2025
TinfoilSubmarine pushed a commit to TinfoilSubmarine/qmk_firmware that referenced this pull request Feb 14, 2025
artlugovoy pushed a commit to artlugovoy/qmk_firmware that referenced this pull request Feb 16, 2025
le4ker pushed a commit to le4ker/lily58-firmware that referenced this pull request Feb 18, 2025
haxwagon pushed a commit to haxwagon/qmk_firmware that referenced this pull request Feb 19, 2025
slotThe pushed a commit to slotThe/qmk_firmware that referenced this pull request Feb 24, 2025
apollovy pushed a commit to apollovy/qmk_firmware that referenced this pull request Feb 24, 2025
dslittle22 pushed a commit to dslittle22/qmk_firmware that referenced this pull request Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cli qmk cli command python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants