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

Error: 'str' object cannot be interpreted as an integer #1911

Open
prabindm opened this issue Aug 14, 2024 · 1 comment
Open

Error: 'str' object cannot be interpreted as an integer #1911

prabindm opened this issue Aug 14, 2024 · 1 comment
Labels
bug Something isn't working needs more info Further information is requested

Comments

@prabindm
Copy link

prabindm commented Aug 14, 2024

Diagnostic output

jrnl: v4.1
Python: 3.12.5 (main, Aug  6 2024, 19:08:49) [Clang 15.0.0 (clang-1500.3.9.4)]
OS: Darwin 23.6.0

Current Behavior

This input is generating an error:

jrnl today: updated R 
┏━ Error ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃  TypeError                                           ┃
┃  'str' object cannot be interpreted as an integer    ┃
┃                                                      ┃
┃  This is probably a bug. Please file an issue at:    ┃
┃  https://github.com/jrnl-org/jrnl/issues/new/choose  ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Expected Behavior

jrnl should accept today/yesterday as time points.

Repro Steps

write: jrnl today: updated R

Debug output

File "/opt/homebrew/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/main.py", line 44, in run
    status_code = controller.run(args)
                  ^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/controller.py", line 79, in run
    append_mode(**kwargs)
  File "/opt/homebrew/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/controller.py", line 168, in append_mode
    journal.new_entry(raw)
  File "/opt/homebrew/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/journals/Journal.py", line 360, in new_entry
    date = time.parse(
           ^^^^^^^^^^^
  File "/opt/homebrew/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/time.py", line 80, in parse
    date = datetime.datetime(  # Use the default time
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /opt/homebrew/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/main.py:44 in run        │
│                                                                                                  │
│   43 │   │                                                                                       │
│ ❱ 44 │   │   status_code = controller.run(args)                                                  │
│   45                                                                                             │
│                                                                                                  │
│ /opt/homebrew/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/controller.py:79 in run  │
│                                                                                                  │
│    78 │   if _is_append_mode(**kwargs):                                                          │
│ ❱  79 │   │   append_mode(**kwargs)                                                              │
│    80 │   │   return                                                                             │
│                                                                                                  │
│ /opt/homebrew/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/controller.py:168 in     │
│ append_mode                                                                                      │
│                                                                                                  │
│   167 │   )                                                                                      │
│ ❱ 168 │   journal.new_entry(raw)                                                                 │
│   169 │   if args.journal_name != DEFAULT_JOURNAL_KEY:                                           │
│                                                                                                  │
│ /opt/homebrew/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/journals/Journal.py:360  │
│ in new_entry                                                                                     │
│                                                                                                  │
│   359 │   │   │   if colon_pos > 0:                                                              │
│ ❱ 360 │   │   │   │   date = time.parse(                                                         │
│   361 │   │   │   │   │   raw[:colon_pos],                                                       │
│                                                                                                  │
│ /opt/homebrew/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/time.py:80 in parse      │
│                                                                                                  │
│    79 │   if hasDate and not hasTime:                                                            │
│ ❱  80 │   │   date = datetime.datetime(  # Use the default time                                  │
│    81 │   │   │   *date[:3],                                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: 'str' object cannot be interpreted as an integer
┏━ Error ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃  TypeError                                           ┃
┃  'str' object cannot be interpreted as an integer    ┃
┃                                                      ┃
┃  This is probably a bug. Please file an issue at:    ┃
┃  https://github.com/jrnl-org/jrnl/issues/new/choose  ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Other Information

No response

@prabindm prabindm added 🆕 New! bug Something isn't working labels Aug 14, 2024
@micahellison
Copy link
Member

Thanks for filing this issue, @prabindm.

So far, we haven't been able to reproduce this issue, whether installed via pipx or brew or on Mac, Windows, or Linux.

To help us narrow it down, could you try rerunning this with --debug and paste the whole output here? Like so:

jrnl today: updated R --debug

@micahellison micahellison added needs more info Further information is requested and removed 🆕 New! labels Aug 24, 2024
@wren wren changed the title Bug Report Error message: 'str' object cannot be interpreted as an integer Aug 24, 2024
@wren wren changed the title Error message: 'str' object cannot be interpreted as an integer Error: 'str' object cannot be interpreted as an integer Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs more info Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants