Bug introduced in 12.3, Resolved in 13.1
I am using Windows 10 and found a bug concerning NotebookDirectory
(and also NotebookInformation
) in 12.3.
It can be easily reproduced.
Create a new notebook and save it as notebook1
in a folder, lets say c:\folder1\notebook1
.
As expected, excecuting NotebookDirectory[]
gives
c:\folder1
Now save the notebook and copy it (using the Explorer) into another folder named c:\folder2
. Rename the copy to c:\folder2\notebook2.nb
and open it in Mathematica, such that now both notebooks are open. (There is no need to excecute notebook2.nb
, just open it)
The bug is, that re-excecuting NotebookDirectory[]
in notebook1.nb
gives:
c:\folder2
instead of again c:\folder1
:-(
This is of course not correct.
I tested this on two machines, and saw the bug on both. Also I assigned different kernels to the notebooks. It does not matter.
Also, after closing and reopening Mathematica: If I open notebook1
alone I get the correct notebook directory, if I also open notebook2
, I get for notebook1
the wrong directory.
With Mathematica 12.2 I had the problem not. However,I cannot exclude that the bug appeared with the latest Windows update.
Any ideas, what is going on?
NotebookDirectory[]
in the first file, I get an error: NotebookDirectory::nosv: The notebook NotebookObject[25501141-5cf3-49a4-916b-3b8b6fb97d14] is not saved. $\endgroup$