Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python long filename support broken in Windows

I write Python script to copy files; unfortunately it keeps failing because filename is too long(>256). Is there anyway to deal with that problem?

I'm using Python 2.5.4 and Windows XP.

Cheers,

like image 823
Sophy Avatar asked Sep 02 '09 04:09

Sophy


People also ask

How do I fix Windows path too long and file name is too long?

If you are typing more than 260 characters, then you can either extract the file into the root folder to reduce the characters, or enable the long path support in the system via Registry Editor. You can also go for a third-party ZIP file extraction tool if the troubleshooting methods do not work.

How do I enable long path support in Windows?

Press Win + R keys on your keyboard and type gpedit. msc then press Enter. Group Policy Editor will be opened. Go to Local Computer Policy -> Computer Configuration -> Administrative Templates -> System -> Filesystem, then enable the Enable Win32 long paths option.


1 Answers

Use paths beginning with the string \\?\.

like image 144
bcat Avatar answered Nov 04 '22 03:11

bcat