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

--debug leads to logging error after composing new entry #1496

Closed
micahellison opened this issue Jun 4, 2022 · 3 comments · Fixed by #1484
Closed

--debug leads to logging error after composing new entry #1496

micahellison opened this issue Jun 4, 2022 · 3 comments · Fixed by #1484
Labels
bug Something isn't working ready for pr Okay to start work. Feel free to ask questions.
Milestone

Comments

@micahellison
Copy link
Member

Bug Report

Environment

  • jrnl --diagnostic output:
jrnl: v2.8.4
Python: 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)]
OS: Windows 10
  • Install method: pipx

Current Behavior

Something is causing the debug logger to crash in write mode. It dumps a traceback. Originally reported in #1494 but this is a separate issue than that issue's primary issue.

Expected Behavior

The logger shouldn't crash on normal inputs.

Repro Steps

jrnl --debug this is a new entry

Other Information

Stack trace happens right after [Entry added to default journal]:

--- Logging error ---
Traceback (most recent call last):
  File "C:\Users\micah\.pyenv\pyenv-win\versions\3.9.7\lib\logging\__init__.py", line 1083, in emit
    msg = self.format(record)
  File "C:\Users\micah\.pyenv\pyenv-win\versions\3.9.7\lib\logging\__init__.py", line 927, in format
    return fmt.format(record)
  File "C:\Users\micah\.pyenv\pyenv-win\versions\3.9.7\lib\logging\__init__.py", line 663, in format
    record.message = record.getMessage()
  File "C:\Users\micah\.pyenv\pyenv-win\versions\3.9.7\lib\logging\__init__.py", line 367, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "C:\Users\micah\.pyenv\pyenv-win\versions\3.9.7\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\micah\.pyenv\pyenv-win\versions\3.9.7\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\micah\.local\bin\jrnl.exe\__main__.py", line 7, in <module>
    sys.exit(cli())
  File "C:\Users\micah\.local\pipx\venvs\jrnl\lib\site-packages\jrnl\cli.py", line 34, in cli
    return run(args)
  File "C:\Users\micah\.local\pipx\venvs\jrnl\lib\site-packages\jrnl\jrnl.py", line 69, in run
    write_mode(**kwargs)
  File "C:\Users\micah\.local\pipx\venvs\jrnl\lib\site-packages\jrnl\jrnl.py", line 149, in write_mode
    logging.debug("Write mode: completed journal.write()", args.journal_name, raw)
Message: 'Write mode: completed journal.write()'
Arguments: ('default', 'this is a new entry')
@micahellison micahellison added bug Something isn't working 🆕 New! labels Jun 4, 2022
@micahellison micahellison added this to the Backlog milestone Jun 4, 2022
@micahellison micahellison added ready for pr Okay to start work. Feel free to ask questions. and removed 🆕 New! labels Jun 4, 2022
@apainintheneck
Copy link
Contributor

I'm not able to reproduce this error on macOS.

@jonakeys
Copy link
Contributor

jonakeys commented Jun 9, 2022

This is already fixed with PR #1484

@micahellison micahellison linked a pull request Jun 11, 2022 that will close this issue
4 tasks
@micahellison
Copy link
Member Author

This is already fixed with PR #1484

Thanks @jonakeys for the heads up! I just double-checked and confirmed that it works on the develop branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready for pr Okay to start work. Feel free to ask questions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants