how do i fix this invalid arguement error

eryk sun eryksun at gmail.com
Sun Nov 27 09:59:20 EST 2016


On Sat, Nov 26, 2016 at 5:55 PM, Dennis Lee Bieber
<wlfraed at ix.netcom.com> wrote:
> On Sat, 26 Nov 2016 08:12:46 -0800 (PST), junkone1 at gmail.com declaimed the
> following:
>
>> with open('\\192.168.0.1\fe18cb0618cabd41\ninjatrader$EURUSDTestRun
>> 2016-11-25-11-11.csv','r') as f:
>
> Second... does Python open() accept web addresses? What is at
> 192.168.0.1 that you don't have some more sensible path to it? 192.168.0.1
> is a private local network address. You are on a Windows machine so if the
> file is available on a local network node you can probably mount that node
> (Computer/Map Network Drive) and access the file as something like
> Z:/ninjatrader...

r"\\192.168.0.1\fe18..." is a UNC (Universal Naming Convention) path,
as defined by [MS-DTYP], Windows Data Types [1].

[1]: https://msdn.microsoft.com/en-us/library/gg465305

On Windows, open() calls CreateFile, which first translates DOS paths
to native paths that the kernel understands. UNC paths are converted
to the form r"\??\UNC\<Server>\<Share>\<Path>".

In kernel mode, the object manager resolves the virtual r"\??"
directory by checking for a "UNC" object in either the logon-session
DosDevices directory of the calling process/thread or the r"\GLOBAL??"
directory. r"\??\UNC" should almost always resolve to
r"\GLOBAL??\UNC". This is an object symbolic link to the native MUP
device (Multiple UNC Provider) [2], so the final path is
r"\Device\Mup\<Server>\<Share>\<Path>".

[2]: https://msdn.microsoft.com/en-us/library/ff556761

MUP resolves the <Server>\<Share> prefix to a registered provider
device, such as LanmanRedirector (SMB/CIFS), MailslotRedirector,
WebDavRedirector, RdpDr (RDP device redirector), or Csc (client-side
caching / offline files). If you're running Windows as a VirtualBox
guest, then your system may also have a VboxMiniRdr provider for
accessing folders shared by the host OS.

As to mount points, for many years Windows has provided flexible
alternatives to classic drive-letter (i.e. logical) mount points. I
prefer to mount UNC paths as symbolic links via `mklink /d` and local
volumes as junctions via `mountvol`.



More information about the Python-list mailing list