Sorry if this is an easy one, but I'm learning and I'm new to python. I have a textbox where you can input some text but I need to remove special characters as it seems to be gumming up some other operations. I've tried different ways of using .replace('"', '') but I'm just getting errors.
here's my code that grabs the textbox input
def setter(self):
self.url = self.url.get()
self.artist = self.artist.get()
self.album = self.album.get()
self.album_artist = self.album_artist.get()
self.genre = self.genre.get()
self.year = self.year.get()
self.textBox = self.textBox.get("1.0", END)
if self.artist or self.album or self.year:
self.folder_name = self.artist + " - " + self.album + " (" + self.year + ")"
The error
"Michael P. Shipley's" ETERNAL Mistake is processing.
Exception in Tkinter callback
Traceback (most recent call last):
File "tkinter\__init__.py", line 1883, in __call__
File "AlbumWindow.py", line 64, in <lambda>
File "AlbumWindow.py", line 93, in setEntries
File "AlbumWindow.py", line 203, in instructions
File "AlbumWindow.py", line 182, in trackSplitter
File "site-packages\pydub\audio_segment.py", line 780, in export
File "site-packages\pydub\utils.py", line 57, in _fd_or_path_or_tempfile
OSError: [Errno 22] Invalid argument: 'mick gordon - doom ost (2020)/"Michael P. Shipley\'s" ETERNAL Mistake.mp3'
Anything with quotes and some japanese characters are making it fail, I need to basically remove all special characters from self.textBox except for :
If I manually remove the " out of the textBox before I submit everything works fine.
Thanks!