Bug 408174

Summary: fish:// and sftp:// opens a non-existing folder fish://<previous folder>/<current file>/
Product: [Frameworks and Libraries] kio-extras Reporter: Toralf Förster <toralf.foerster>
Component: FISHAssignee: Plasma Bugs List <plasma-bugs>
Status: REOPENED ---    
Severity: normal CC: asturm, chawise, cullmann, shimi.chen
Priority: NOR    
Version: 19.08.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:

Description Toralf Förster 2019-06-01 09:27:32 UTC
SUMMARY


STEPS TO REPRODUCE
1. open the file setup_img.sh of the folder fish://tfoerste@mr-fox/opt/tb/bin/
2. press Ctrl-O
3. 

OBSERVED RESULT
fish://tfoerste@mr-fox/opt/tb/bin/setup_img.sh/

EXPECTED RESULT
fish://tfoerste@mr-fox/opt/tb/bin/

SOFTWARE/OS VERSIONS
Gentoo KDE 5.57 / 5.12.3 / 5.15.5 / 18.12.3

ADDITIONAL INFORMATION
Comment 1 Andreas Sturmlechner 2019-06-01 09:34:48 UTC
Reproducible here as well. The important bit here is to open the file first using the File open dialog inside e.g. kate (not via dolphin), then observe the error on second File open:

'The file or folder sftp://...blabla.../distfile.py does not exist.'

Operating System: Gentoo 
KDE Plasma Version: 5.15.90
KDE Frameworks Version: 5.58.0
Qt Version: 5.12.3
Kernel Version: 5.0.10-gentoo

Also happened on an opensuse TW laptop.
Comment 2 Shimi Chen 2019-09-07 20:52:13 UTC
I can confirm this on Arch Linux using version 19.08.1. It occurs both in Kate and KWrite, but not in okular or ark.
Steps to reproduce:
1. Using the Kate "Open File" dialog (ctrl+o or File->Open...) open a text file located on an sftp server.
2. Go to File->Open.. or File->Save As...

Expected result:
The application will open the directory in which the file is saved in order to select another file in it (or save the file in another name at the same place).

Actual result:
The application attempts to browse the opened file itself as a directory, which produces an error (as indeed there is no directory with the same name as the opened file).

Bug 320319 may be related, however it is in Windows.
It seems that this issue already existed around 2016 on linux, but was twice reported as fixed at that time (bug 352490, comment 2 and bug 363365, comment 2).
Comment 3 Christoph Cullmann 2020-05-09 11:21:56 UTC
Fixed in master

https://invent.kde.org/kde/kate/-/merge_requests/44#note_46292
Comment 4 Christoph Cullmann 2020-05-09 11:22:19 UTC
Upsa, only for KWrite/Kate, thought.
Didn't see this is a more generic bug.