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

Bug Report #1870

Closed
sopertob opened this issue Mar 21, 2024 · 1 comment
Closed

Bug Report #1870

sopertob opened this issue Mar 21, 2024 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@sopertob
Copy link

Diagnostic output

jrnl: v4.1
Python: 3.12.2 (main, Feb 6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)]
OS: Darwin 23.3.0

Current Behavior

When typing jrnl -n 10 OR jrnl -to today (or any other time designation) in the terminal, the following error shows: "'<' not supported between instances of 'str' and 'int'."

Expected Behavior

The terminal should show the entries in a jrnl file.

Repro Steps

Type jrnl -n 10 OR 'jrnl -to today` in the terminal.

Debug output

[14:43:48] DEBUG Logging start main.py:32
DEBUG Parsed args: main.py:42
Namespace(debug=True, preconfig_cmd=None,
postconfig_cmd=None, filename=None,
template=None, on_date=None,
today_in_history=False, month=None, day=None,
year=None, start_date=None, end_date=None,
contains=None, strict=False, starred=False,
tagged=False, limit=10, excluded=[], edit=False,
delete=False, change_time=None, export=False,
tags=False, short=False, config_override=[],
config_file_path='', text=[],
exclude_starred=False, exclude_tagged=False)
DEBUG Reading configuration from file install.py:91
/Users/FOLDER/.config/jrnl/jrnl.yaml
DEBUG Using configuration: install.py:117
"{
'colors': {
'body': 'none',
'date': 'black',
'tags': 'yellow',
'title': 'cyan'
},
'default_hour': 9,
'default_minute': 0,
'editor': '',
'encrypt': False,
'highlight': True,
'indent_character': '|',
'journals': {
'default':
'/Users/FOLDER/Dropbox/Drafts/Notes/thought
s/jrnl.md',
},
'linewrap': '79vv',
'tagsymbols': '#@',
'template': False,
'timeformat': '%F %r',
'version': 'v4.1'
}"
DEBUG Using journal name: default config.py:206
DEBUG Scoped config: config.py:120
{
'colors': {
'body': 'none',
'date': 'black',
'tags': 'yellow',
'title': 'cyan'
},
'default_hour': 9,
'default_minute': 0,
'editor': '',
'encrypt': False,
'highlight': True,
'indent_character': '|',
'journals': {
'default':
'/Users/FOLDER/Dropbox/Drafts/Notes/thoughts
/jrnl.md',
},
'linewrap': '79vv',
'tagsymbols': '#@',
'template': False,
'timeformat': '%F %r',
'version': 'v4.1',
'journal':
'/Users/FOLDER/Dropbox/Drafts/Notes/thoughts
/jrnl.md'
}
DEBUG open_journal 'default' Journal.py:473
DEBUG start BaseEncryption.py:16
DEBUG start NoEncryption.py:12
DEBUG decrypting BaseEncryption.py:29
DEBUG decrypting NoEncryption.py:19
DEBUG opened Journal with 21 entries Journal.py:136
DEBUG Search mode: starting controller.py:203
DEBUG Search mode: has search args controller.py:210
DEBUG count: 10 controller.py:253
DEBUG args.limit is true-ish controller.py:264
File "/usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/main.py", line 44, in run
status_code = controller.run(args)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/controller.py", line 94, in run
_display_search_results(**kwargs)
File "/usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/controller.py", line 408, in _display_search_results
print(journal.pprint())
^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/journals/Journal.py", line 208, in pprint
return "\n".join([e.pprint(short=short) for e in self.entries])
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/journals/Entry.py", line 131, in pprint
title = wrap_with_ansi_colors(
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/output.py", line 141, in wrap_with_ansi_colors
console.print(richtext, sep="", end="")
File "/usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/rich/console.py", line 1700, in print
extend(render(renderable, render_options))
File "/usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/rich/console.py", line 1305, in render
if _options.max_width < 1:
^^^^^^^^^^^^^^^^^^^^^^
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/main.py │
│ :44 in run │
│ │
│ 43 │ │ │
│ ❱ 44 │ │ status_code = controller.run(args) │
│ 45 │
│ │
│ /usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/control │
│ ler.py:94 in run │
│ │
│ 93 │ │ # display only occurs if no other action occurs │
│ ❱ 94 │ │ _display_search_results(**kwargs) │
│ 95 │
│ │
│ /usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/control │
│ ler.py:408 in _display_search_results │
│ │
│ 407 │ else: │
│ ❱ 408 │ │ print(journal.pprint()) │
│ 409 │
│ │
│ /usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/journal │
│ s/Journal.py:208 in pprint │
│ │
│ 207 │ │ """Prettyprints the journal's entries""" │
│ ❱ 208 │ │ return "\n".join([e.pprint(short=short) for e in self.entries] │
│ 209 │
│ │
│ /usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/journal │
│ s/Entry.py:131 in pprint │
│ │
│ 130 │ │ │ # Color date / title and bold title │
│ ❱ 131 │ │ │ title = wrap_with_ansi_colors( │
│ 132 │ │ │ │ date_str │
│ │
│ /usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/jrnl/output. │
│ py:141 in wrap_with_ansi_colors │
│ │
│ 140 │ with console.capture() as capture: │
│ ❱ 141 │ │ console.print(richtext, sep="", end="") │
│ 142 │ return capture.get() │
│ │
│ /usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/rich/console │
│ .py:1700 in print │
│ │
│ 1699 │ │ │ │ for renderable in renderables: │
│ ❱ 1700 │ │ │ │ │ extend(render(renderable, render_options)) │
│ 1701 │ │ │ else: │
│ │
│ /usr/local/Cellar/jrnl/4.1/libexec/lib/python3.12/site-packages/rich/console │
│ .py:1305 in render │
│ │
│ 1304 │ │ _options = options or self.options │
│ ❱ 1305 │ │ if _options.max_width < 1: │
│ 1306 │ │ │ # No space to render anything. This prevents potential re │
╰──────────────────────────────────────────────────────────────────────────────╯
TypeError: '<' not supported between instances of 'str' and 'int'
┏━ Error ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ TypeError ┃
┃ '<' not supported between instances of 'str' and 'int' ┃
┃ ┃
┃ This is probably a bug. Please file an issue at: ┃
https://github.com/jrnl-org/jrnl/issues/new/choose
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Other Information

No response

@sopertob sopertob added 🆕 New! bug Something isn't working labels Mar 21, 2024
@micahellison micahellison added duplicate This issue or pull request already exists and removed 🆕 New! labels Mar 24, 2024
@micahellison
Copy link
Member

Hi @sopertob, in your config, the linewrap value is 79vv, which isn't a number, so it's crashing. If you change it back to 79 it should work.

For anyone interested in fixing this, we have an open enhancement to resolve this kind of problem in #1682.

@micahellison micahellison closed this as not planned Won't fix, can't repro, duplicate, stale Mar 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 duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants