-
Notifications
You must be signed in to change notification settings - Fork 66
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
Token file sometimes malformed #91
Comments
Looks like this is specific to use of >>> with open("test.txt", "w") as f:
... f.write("11111111\n")
...
>>> with open("test.txt", "w") as f:
... f.write("2222\n")
...
>>> with os.fdopen(os.open("test-fd.txt", os.O_WRONLY | os.O_CREAT, 0o600), "w") as f:
... f.write("11111111\n")
...
>>> with os.fdopen(os.open("test-fd.txt", os.O_WRONLY | os.O_CREAT, 0o600), "w") as f:
... f.write("2222\n")
... $ cat test.txt
2222
$ cat test-fd.txt
2222
111 Adding a call to |
Oh nice; you were able to reproduce it.. |
It's been there since the beginning, so has most likely always been like this, though curiously I haven't come across it before. |
I meant python versions 😂 |
Well it happens on 3.6 and 2.7, so plausibly all versions. In any case, should be handled now. |
BTW... I think the reason might be that you "forgot" the |
Huh, yup, that'd do it too... |
I have a weird issue on one system where the token file is always malformed after login:
For some reason, it appends the last 4 chars of the last line in another new line:
This then results in the token file being unusable for the next start.
This only happens on one system (Debian 8, python 3.4, manually installed from repo).
It did not appear to happen, when SkPy is started with a correct token file.
It also isn't a new error; just one that can be avoided rather easily so I never really bothered.
Is this something known in any way?
The "w"-mode when writing that file should truncate it; could this nevertheless be a weird remainder in a buffer or something..? Any idea on how this could happen?
Do you think it might be worth it to just ignore excess lines when parsing the token file? (currently, excess lines fail parsing)
The text was updated successfully, but these errors were encountered: