BdR76 / CSVLint

CSV Lint plug-in for Notepad++ for syntax highlighting, csv validation, automatic column and datatype detecting, fixed width datasets, change datetime format, decimal separator, sort data, count unique values, convert to xml, json, sql etc. A plugin for data cleaning and working with messy data files.
GNU General Public License v3.0
151 stars 8 forks source link

CSVLint plug-in crashing when opening an SQL file (should not automatically parse non-CSV files) #90

Open DebbieKat opened 3 months ago

DebbieKat commented 3 months ago

I'm experiencing issues recently with the CSVLint plug-in crashing upon opening files (not necessarily files created using CSVLint either, just unrelated files being opened in Notepad++). When I open the file, it seems it's no longer supporting long file names either and reverting them to the old 8 character name/3 character extension limit. image image

Also, when I try to copy my original text from the file causing CSVLint to crash into a new file and attempt to save it, it's also defaulting to the 8.3 naming convention. It won't let me rename it to the complete name I had. I had to give it a different file name for it to save as expected.

BdR76 commented 3 months ago

Thanks for posting the issue, it's hard to say what's going wrong without knowing the N++/plugin version or seeing the actual files. If you have the latest Notepad++ and plugin installed, then my guess is that it has to do with the plugin parsing the content of the file.

Does the error appear immediately when opening the Notepad++, of when you open a certain file? If it's immediately, then try going to folder %USERPROFILE%\AppData\Roaming\Notepad++ and rename session.xml to "session.xml_OLD" or something, and then try to start Notepad++ again. If that fixed it, is it possible to send the contents of the old sessions.xml?

You say you have narrowed it down to a particular file, is it possible to send that file (if it doesn't contain any sesitive data) to my e-mail (see Notepad++ menu Plugins > CSV Lint > About ?

The 8.3 naming behaviour doesn't ring a bell, not sure if that is caused by the plugin.

DebbieKat commented 3 months ago

This occurs when opening specific files, not just Notepad++ in general. And the weird thing is these files were not used with the CSVLint plug-in.

I had deleted that file in particular, but just opened another one that it happened with. Here is the error it generated.

image

I'll also try renaming the xml file as you mentioned.

BdR76 commented 3 months ago

Thanks for the reply. In the first screenshot it's an SQL file, does it happen with a specific type of file maybe? Liek just SQL and not TXT?

Also, that error dialog doesn't give me much information, those hex-codes are also gibberish to me. Can you post what it says in Notepad++ under ? >Debug info ?

DebbieKat commented 3 months ago

I have other .sql files that it is not doing this with. It seems somewhat random.

Also, my organization has installations locked down and I don't seem to have access to the sessions.xml file. I can get access through the helpdesk here if we determine I should attempt to rename it at some point.

DebbieKat commented 3 months ago

Here is the information from the Debug window: Notepad++ v8.6.2 (64-bit) Build time : Jan 14 2024 - 02:16:00 Path : C:\Program Files\Notepad++\notepad++.exe Command Line : "C:\Users\dshapir2\OneDrive - Fred Hutchinson Cancer Research Center\Documents - Gateway Solutions Implementation-Data Availability Solution Implementation\Project Documents\Interim Solution Implementation\Data\poc_altpatientid.csv" Admin mode : ON Local Conf mode : OFF Cloud Config : OFF OS Name : Windows 10 Enterprise (64-bit) OS Version : 22H2 OS Build : 19045.4046 Current ANSI codepage : 1252 Plugins : ComparePlus (1.1) CSVLint (0.4.6.5) mimeTools (3) NppConverter (4.5) NppExport (0.4)

BdR76 commented 3 months ago

I don't think the sessions.xml is important for your issue. When Notepad++ crashes immediately when starting, then it sometimes helps to delete that file, but that's not what is happening here.

You've got CSV Lint version 0.4.6.5, but there is one newer 0.4.6.6 can you install that? Just to verify that it still happens in the latest version.

If it's possible, can you backup or send the file where this happens? I would make a backup copy of that file, open it, and if Notepad++ gives the error, then delete half of the text in the file, save it, close and open again. If the error doesn't happen anymore than it was probably something in the deleted text.

DebbieKat commented 3 months ago

Ok, I've just updated the plugin. I'm still experiencing the same behavior with the crash. I did make a copy of the file that is crashing and stored it in a local folder on my laptop and that one is not crashing CSVLint. I did not change anything in the copy of the file.

Notepad++ v8.6.2 (64-bit) Build time : Jan 14 2024 - 02:16:00 Path : C:\Program Files\Notepad++\notepad++.exe Command Line : Admin mode : ON Local Conf mode : OFF Cloud Config : OFF OS Name : Windows 10 Enterprise (64-bit) OS Version : 22H2 OS Build : 19045.4046 Current ANSI codepage : 1252 Plugins : ComparePlus (1.1) CSVLint (0.4.6.6) mimeTools (3) NppConverter (4.5) NppExport (0.4)

BdR76 commented 3 months ago

The plugin crashing when opening a file, and then it doesn't crash after making an exact copy of that file... That sounds like the same thing I've seen here. I was never able to figure out what was causing it though.

One thing that comes to mind, is that the CSV Lint plug-in currently always parses a file when it's opened, meaning it checks the entire text of the SQL file to see if it is a CSV data file. That could be causing this issue but idk

Still though, the plug-in really should do this parsing only for .csv files, or when the user explicitly presses the Detect columns button.