1

This just started happening today. I've been saving and accessing my Python Files to Network Drives for over a year without issues.

When I open a locally saved Python File I can see the contents. When I open a Python File saved to a Network Drive though I don't see the code. I swear it's actually there.enter image description here

When I go to a different machine on the network with a Python Installation I can open the files and see the code just fine.

I've tried rebooting the machine. Running IDLE as an administrator, going to the file through File Explorer and right clicking and selecting open with IDLE and even remapping the drives. Nothing has worked.

Does anyone have any idea what would cause this? It's driving me nuts.

Michael
  • 749
  • 1
  • 8
  • 22
  • It looks like there is text down the left side of that screen shot you posted, it looks like its maybe on the slidable divider/splitter thing. Is your window split somehow? – JJF Jun 21 '19 at 19:33
  • @JJF Sorry, bad snip. I've replaced it with a better one. After your comment though I made sure there was no split window or view option set. Didn't see an option for these anywhere. It lets me highlight the first line as shown in the snip. I tried pasting into notepad, but again it's just a blank line. This file is several pages of code. It runs every morning in task scheduler just fine and when accessed from python on another machine I can see it just fine. – Michael Jun 21 '19 at 19:44
  • First assume something is wrong with IDLE. Check the contents from the command line via `type "path/to/file"`. Or open it with notepad. Check the reported file size in Explorer and also from the command line via `dir "path/to/file"`. – Eryk Sun Jun 21 '19 at 20:46
  • @eryksun using type "path/to/file" gives me the contents of the file. Using dir whows 4,774 bytes. IDLE works fine to open Python Files which are saved locally to that machine. It is just those on the network. Tried rebooting the machine again. No luck yet. – Michael Jun 21 '19 at 21:19
  • Open python.exe from the command line and try `open('path/to/file').read()` and `os.stat('path/to/file')`. Also, if it's working, check `sys.executable` and confirm it's the same as in the IDLE shell. In IDLE it may be "pythonw.exe" in the same directory; if so run IDLE from the command line via `python.exe -m idlelib`. – Eryk Sun Jun 21 '19 at 21:35
  • The open command works and I see the content (code) in the file. However, when I run the os.stat command I receive a ---------- Traceback (most recent call last): File "", line 1, in os.stat(r"") PermissionError: [WinError 24] The program issued a command but the command length is incorrect: '' I tried googling around what the WinError 24 means, but can't find a precise answer yet. – Michael Jun 24 '19 at 20:34
  • 2
    Did you ever find a solution? Having the same problem – UpAllNight Feb 25 '21 at 19:18
  • 1
    @UpAllNight Not yet, but I haven't run into this recently. I'll test tomorrow at work (where the issue was occurring) and post an update. – Michael Feb 28 '21 at 13:46
  • 1
    @UpAllNight It is working now. I'm thinking this was resolved by a windows update or a configuration in our domain. Sorry I don't have a concrete answer for what the root cause was. – Michael Mar 01 '21 at 15:25

0 Answers0