Often doesn't see absolute identity of path of edited files
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
Often after some programming session I have multiple
instances of an edited file in the windows list with
little differences in file name: Upper/lower case
differences, "programme/xy..." & "progra~1/xy" differences
somehow PythonWin doesn't see the identity of those
files. PyWin should maybe use
os.path.normcase(os.path.normpath(os.path.abspath(x)))
somewhere in the framework code ?
I rare cases edited code gets lost. But most times the
auto-reload feature prevents more severe losses (unless
I disable auto-reaload !)
Robert
Logged In: YES
user_id=14198
Can you please tell me how to reproduce this - I can not.
Whatever case I use to open the file, I never get the same
file opened twice.
I can reproduce the problem with "progra~1"
Logged In: YES
user_id=972995
I checked to reproduce:
I open a file - exited pywin - re-run - 1: select from
menu/file/history 2: open-context-edit the same file from
explorer => 2 windows
.py / Edit command in Explorer
C:\PYTHON23\pythonwin.exe "%1" (Uses DDE)
the file path of all the different window instances is
correctly always the same, but multiple windows with
described problem:
>>> a=win32ui.GetApp()
>>>
a.frame.MDIGetActive()[0].GetEditorView().GetDocument().GetPathName()
'C:\\devel\\TURBOM~1\\tea_dscore.py'
#switch to next window
>>>
a.frame.MDIGetActive()[0].GetEditorView().GetDocument().GetPathName()
'C:\\devel\\TURBOM~1\\tea_dscore.py'
#switch to next window
>>>
a.frame.MDIGetActive()[0].GetEditorView().GetDocument().GetPathName()
'C:\\devel\\TURBOM~1\\tea_dscore.py'
>>>
Logged In: YES
user_id=972995
Now its seems to be pinned down:
the problem is always with files where the file base name or
one or more folder names are longer than 8 characters and
when the file is opened twice or more by
explorer/right-click/Edit (DDE) . Maybe its a DDE only
problem. Yet opening form explorer is a main method for
opening . Also when explorer opend and then
Menu/File/<history> opened