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

cannot get nvpy to work in windows #215

Open
RosanneZe opened this issue Nov 5, 2020 · 7 comments
Open

cannot get nvpy to work in windows #215

RosanneZe opened this issue Nov 5, 2020 · 7 comments
Assignees
Labels
Milestone

Comments

@RosanneZe
Copy link

RosanneZe commented Nov 5, 2020

I succesfully installed nvpy on windows like this:

  • in powershell, type python, this prompts you to install python 3.8 in the windows store
  • install nvpy with pip install nvpy
  • run nvpy with python -m nvpy

I can start nvpy, but if I try to add a new note, it crashes, and after I closed it, it now crashes immediately on opening. It says "An error occured during housekeeping. list index out of range"

It gives this exception:

\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\nvpy\view.py", line 532, in append
    self.text.insert(tk.END, u'{0:<{w}}'.format(title[:cellwidth - 1], w=cellwidth), ("title,"))
TypeError: slice indices must be integers or None or have an __index__ method

and during the handling of that another exception occured (I cannot copy paste it, because it shows in a window and not in the terminal) in line 667 of view.py "IndexError: list index out of range"

I'm not sure what's going on here. I use nvpy without simplenote, but I've been able to do that without problems on Ubuntu for years.

ETA: I also got errors when I tried the zipped version, I think it was the same error, but I didn't write it down, so I'm not sure.

@yuuki0xff yuuki0xff self-assigned this Nov 5, 2020
@yuuki0xff
Copy link
Collaborator

yuuki0xff commented Nov 5, 2020

I'm trying to reproduce this issue, but I haven't got a clue yet. To investigate this issue, may I ask the following questions?

  1. What's the version and OS build number of your windows OS?
  2. What's the locale of your PC? It can display by the following command:
    systeminfo | findstr “Locale”
  3. Please execute validate.py and tell me the result. It validates the local database and reports corrupted notes. Note that it may display your private data. When pasting the result, you should mask private data.
  4. Please tell me info if you have any additional info you want to add.

@RosanneZe
Copy link
Author

Thanks for looking into it!

  1. Version 10.0.19042 Build 19042
  2. en-us;English (United States) (both System and Input)
  3. I started from a clean slate to check if the problem was in my linux notes, so no personal info here:
C:\Users\rosan/.nvpy\70087714138c54e6fe1caa3460ec61.json  Invalid
{'content': 'test notitie', 'modifydate': 1604578114.5335133, 'createdate': 1604578114.5335133, 'savedate': 0, 'syncdate': 0, 'tags': []}
Traceback (most recent call last):
  File ".\validate.py", line 18, in <module>
    assert 'key' in obj and type(obj['key']) == str
AssertionError


C:\Users\rosan/.nvpy\deaee939ed087942a3a1d29275cb33.json  Invalid
{'content': '', 'modifydate': 1604578165.942433, 'createdate': 1604578165.942433, 'savedate': 0, 'syncdate': 0, 'tags': []}
Traceback (most recent call last):
  File ".\validate.py", line 18, in <module>
    assert 'key' in obj and type(obj['key']) == str
AssertionError


Done.  Some notes are broken :-(
See above log for details.
  1. I played around a bit with the script, and key is actually not in the object for the newly saved notes. I decided to remove all the notes again, and copied over one of my linux notes. I had to transform createdate and modifydate to numbers instead of strings, but then the validation passed. So then I opened nvpy again, the window is still there, but in the powershell it gives the same slice indices TypeError that I mentioned above, and then drops into pdb. There are no notes visible in the nvpy window, and if I try to do anything, it's not responding.

@yuuki0xff
Copy link
Collaborator

I prepared the test environment and tried to reproduce this issue. But I found no issue. Could you tell me more detailed info?

  1. Did you still have problems even if reinstalling the Python?
  2. Is it work if you use the simplest configuration like this:
[nvpy]
simplenote_sync = 0
  1. Please tell me the contents of nvpy.cfg file.
  2. Can you take a dump about local variables when it crashes?

@RosanneZe
Copy link
Author

I started with the simple config file and then added in my settings one by one. The setting that crashes everything is layout = vertical. If I don't use that it works!

@yuuki0xff
Copy link
Collaborator

Thank you for your reply. I'm happy to nvpy works on your PC :-)
I rechecked in all test environments, but nvpy seems to work even if layout = vertical specified. If you want to continue the investigation, please take local variables dumps and tell it to me.

@RosanneZe
Copy link
Author

I think it's the combination of layout = vertical and print_columns = 1. Without the print_columns = 1, I can actually use the vertical layout, so I can use nvpy just the way I want.

@yuuki0xff
Copy link
Collaborator

yuuki0xff commented Nov 12, 2020

Thanks, @RosanneZe ! I succeeded in reproducing this issue. I will fix it at a later date.

# reproduce-issue-215.ps1

set-content -path ~/nvpy.cfg -value '
[nvpy]
simplenote_sync = 0
layout = vertical
print_columns = 1
'

rm -Recurse ~/.nvpy
mkdir ~/.nvpy

set-content -path ~/.nvpy/empty.json -value '
{"content": "", "modifydate": 1, "createdate": 1, "savedate": 0, "syncdate": 0, "tags": []}
'

python3 -m nvpy
cat ~/.nvpy/nvpy.log

@yuuki0xff yuuki0xff added this to the v2.4.0 milestone Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants