Closed ernstki closed 11 months ago
This bug was caused by the Python 3 migration. Python 3 changes the behavior of the "/" operator. On Python 3 environment, cellwidth - 1
should be int or float type. title[:cellwidth - 1]
raises TypeError if cellwidth
is float type.
Python 3.11.5 (main, Aug 29 2023, 15:31:31) [GCC 13.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.9.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: 3/2
Out[1]: 1.5
In [2]: notes = []
In [3]: notes[:1.5]
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 notes[:1.5]
TypeError: slice indices must be integers or None or have an __index__ method
Thanks for the detailed report. Very helpful for debugging.
This bug was caused by the Python 3 migration. Python 3 changes the behavior of the "/" operator. On Python 3 environment,
cellwidth - 1
should be int or float type.title[:cellwidth - 1]
raises TypeError ifcellwidth
is float type.
Oh, that makes sense. Thank you!
Using Python 3.6.9 on elementaryOS 5.1 Hera (Ubuntu 18.04-based),
python3-tk
3.6.9-1~18.04 from the distro repositories; installednvpy
2.0.2 withpip install --user
by pointing directly at the GitHub repository about 30 minutes ago.I've got years worth of notes in my Simplenote account, many of which use Unicode characters, which is the only way I discovered issue #44, which gave me the idea of disabling
print_columns
in my config file. So that is a workaround, for now.With
layout = vertical
andprint_columns = 1
, however, I get this stacktrace immediately upon start. Hard for me to discern what it has to do with Unicode or columns, but here goes:Other threads appear to be busy syncing notes happily, but this one seems to be what crashes the UI.
I see these other exceptions in the log (
_tkinter.TclError: can't set "PY_VAR1"
andValueError: I/O operation on closed file.
), but can't be sure if they're related:Traceback:
_tkinter.TclError: can't set "PY_VAR1"
If anyone has ideas of how to narrow this down to which specific note(s) are causing the problem, I'd be happy to add extra detail to this issue. I'll even add a test to reproduce this behavior, if I had some idea where to start.