I am currently writing a program which involves putting paths into a mysql table, but i have discovered an issue of sorts, for some reason a chunk of the middle portion of the part is missing and in it's place is just white space. at first i assumed it was something to do with the path exceeding the length of the varchar value that i had put( i put the path column as varchar 100), but when i checked the length of every path in the folder that i was inputting, every path had only around 48-52 characters, and what's more, when i printed the same paths in vscode terminal, it prints normally, how do i resolve this issue such that the paths in the mysql table show up as normal. Here is how the path looks in the mySQL table,and here is how it looks in the vscode terminal. any and all suggestions are appreciated
Asked
Active
Viewed 24 times
0
-
The terminal is simply interpreting `\t` as a tab. It's just a visualization issue but if you parse your string correctly when you get it back from your program you shouldn't have any issue. In any case, you can try escaping it before inserting it in mysql. – Andrea Olivato Jul 18 '21 at 05:55
-
hmm, i guess that makes sense, however i did make the path as a string, and i still got the same result. also i didn't exactly get what you meant by escaping it lol, like could you perhaps be more specific as to what i should do/ – STAR PLATINUM Jul 18 '21 at 06:21
-
1It looks as if the paths are incorrect in the database because sequences like `\t` are no escaped properly. You need to make sure the paths are correctly escaped when you create them. See [Windows path in Python](https://stackoverflow.com/questions/2953834/windows-path-in-python) – snakecharmerb Jul 18 '21 at 07:13