Don't crash when trying to save to a FIFO or other special file
When giving the path to a FIFO or other special file qutebrowser would completely hang, and has to be killed. Tested: - Asks for overwrite: file, symlink to file - Saves in dir: dir, symlink to dir - Aborts: block dev, char dev, fifo, socket, and a symlink to all of these
This commit is contained in:
parent
839d2b1cbe
commit
9df5a89037
@ -446,6 +446,13 @@ class DownloadItem(QObject):
|
||||
# The file already exists, so ask the user if it should be
|
||||
# overwritten.
|
||||
self._ask_overwrite_question()
|
||||
# FIFO, device node, etc. Don't even try.
|
||||
elif (os.path.exists(self._filename) and not
|
||||
os.path.isdir(self._filename)):
|
||||
self.cancel(False)
|
||||
message.error(self._win_id, "The file {} already exists, and is a "
|
||||
"special file. Aborting.".format(
|
||||
self._filename))
|
||||
else:
|
||||
self._create_fileobj()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user