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
OLW won't open local drafts or published posts, throws an UnauthorizedAccessException #26
Comments
|
Same here miercuri, 9 decembrie 2015 20:58:28 Version: 0.5.0.0 OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1 Memory Load: 33% Unexpected Error Occurred OpenLiveWriter.PostEditor.PostEditorStorageException: Error Accessing Local Post - Unexpected error occurred while accessing local post (UnauthorizedAccessException) Access to the path 'C:\Users\vali\AppData\Local\Temp\OpenLiveWriter-1499964508\supfiles5CD581C\SpellingContext' is denied. |
|
I get this too. Have a post I wrote with WLW and realized OLW was seeing it so tried to open it. Got the same error. Post opens fine in WLW. Debugging this now and might have a PR to fix it later tonight. |
|
Hey @willduff just wondering on this. I have a quick fix but wanted to pass this by before submitting it. The root cause of the problem as @hmemcpy mentioned is line 130 in BlogPostSupportingFileStorage.cs. This tries to create a file in the dictionary path to copy the spelling context dictionary to the file storage. Not sure when opening an old post why it needs another dictionary but okay, let's go roll with that. Tracing it through it starts in PostEditorFile.cs at line 383 where it calls a method named ReadSpellingContextDictionary. That method (line 1008) doesn't just read the dictionary but also writes it to the supporting file storage. Its when it hits line 1017 it calls the WriteSpellingContextDictionary method on the filestorage. Without a CONTEXT_DICTIONARY_FILE name it's trying to write to a filename named as an empty string. This is where the exception happens. So easy solution I think to allow you to open WLW posts is to wrap WriteSpellingContextDictionary in a try/catch, it'll fail on the write, and move on. The effect (I think) is that the user won't have a dictionary to read from for that posts. I tried this out and it behaves fine but I'm not sure of the longer implications here, although this method is only used when loading posts from local storage. Thoughts on doing the fix this way and sending in a PR with it? Or... I think there's a bigger issue when I look at the ReadSpellingContextDictionary and WriteSpellingContextDictionary methods in PostEditorFile.cs (lines 1008 - 1030) and the same named methods in BlogPostSupportingFileStorage.cs (lines 127 - 143). They both do similar things but I think the naming is off (ReadSpellingContextDictionary in PostEditorFile.cs should maybe be called TransferSpellingContextDictionary as that's what it does and the 4 methods all do almost the same things but in slighty different ways. An alternate fix (which I tried and works as well) is to remove both ReadSpellingContextDictionary and WriteSpellingContextDictionary from PostEditorFile.cs and use the methods in BlogPostSupportingFileStorage.cs instead. Thanks |
|
One more update. Reading this code again now I realized what's going on. When loading a post it's reading the dictionary in the post and writes it to the (local) storage. When it saves the post it reads the dictionary from the storage and writes it back to the post again. I supposed this is so I can have a custom dictionary attached to each post? Without a spell checker right now maybe both of these methods just need to be either commented out/removed until a spell checker solution comes along? At least that would allow people to open WLW drafts and posts. |
|
Seeing the same issue. I think commenting out the code related to spell checker dictionaries makes sense now as it is not supported and once it is, this code most likely will have to be changed anyway |
|
Going to remove the code until a new spell checker comes along. There's a different registry error trying to save WLW posts but I'll file a different bug with that once this is in place. |
|
Got this Exception this morning, I haven't looked closely but looks very similar to one reported above Thursday, December 17, 2015 10:01:16 AM Version: 0.5.1.2 OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1 Memory Load: 37% Unexpected Error Occurred OpenLiveWriter.PostEditor.PostEditorStorageException: Error Accessing Local Post - Unexpected error occurred while accessing local post (UnauthorizedAccessException) Access to the path 'C:\Users\sbarrington\AppData\Local\Temp\OpenLiveWriter-466258407\supfiles3170AB9\SpellingContext' is denied. |
|
This is our top priority bug due to the number of hits we are seeing on this. I haven't had a chance to look through the discussion but will circle back as soon as I can! |
|
I opened pull request #211 to fix this. The root cause here is that we accidentally made a breaking change when we removed the spell checking logic. We changed the CONTEXT_DICTIONARY_FILE constant from "context.tlx" to string.Empty. That means in the WriteSpellingContextDictionary() and ReadSpellingContextDictionary() methods, we were resolving a dictionary path as Path.Combine(SpellingContextDirectory, string.Empty); and then tried to create a FileStream on a directory. The fix here is simple, just change the dictionary filename back to "context.tlx". |
|
Awesome! Thanks for the fix! |
Issue #26 - OLW won't open local drafts or published posts, throws an UnauthorizedAccessException
|
I've just come across the same error using version 0.6.2. I'm a very 'non technical' guy just looking for an easy blogging solution and WLR or OLW are perfect for me (I just can't get them to work). Anyone any suggestions? (for a non tech) |
I get this exception trying to open (Windows) Live Writer drafts, or already published posts. The exception is:
I traced the origin to these lines: https://github.com/OpenLiveWriter/OpenLiveWriter/blob/master/src/managed/OpenLiveWriter.PostEditor/BlogPostSupportingFileStorage.cs#L129-L130
It seems that
CONTEXT_DICTIONARY_FILEis currently set to an empty string (per @shanselman's post, spell checking is currently removed), which creates an invalid path and causesFileStreamto fail.I commented out this method for now, but I'm not sure that's a good PR to send.
The text was updated successfully, but these errors were encountered: