mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Mark calibre as long path aware on Windows
Python 3.8 is supposedly long path aware and calibre itself does not use MAX_PATH except in a few functions in the launcher/installer, and a couple in winutil. So hopefully this means we are long path capable.
This commit is contained in:
parent
fee0353451
commit
73df11e69e
@ -66,7 +66,7 @@ SUPPORTED_OS = {
|
||||
|
||||
EXE_MANIFEST = '''\
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
@ -75,14 +75,17 @@ EXE_MANIFEST = '''\
|
||||
</security>
|
||||
</trustInfo>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<supportedOS Id="{w7}"/>
|
||||
<supportedOS Id="{w8}"/>
|
||||
<supportedOS Id="{w81}"/>
|
||||
<supportedOS Id="{w10}"/>
|
||||
</application>
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<supportedOS Id="{w7}"/>
|
||||
<supportedOS Id="{w8}"/>
|
||||
<supportedOS Id="{w81}"/>
|
||||
<supportedOS Id="{w10}"/>
|
||||
<windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
|
||||
<ws2:longPathAware>true</ws2:longPathAware>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
||||
</assembly>
|
||||
'''.format(**SUPPORTED_OS)
|
||||
|
||||
|
||||
|
@ -351,12 +351,9 @@ winutil_username(PyObject *self) {
|
||||
|
||||
static PyObject *
|
||||
winutil_temp_path(PyObject *self) {
|
||||
wchar_t buf[MAX_PATH + 1] = {0};
|
||||
wchar_t buf[MAX_PATH + 8] = {0};
|
||||
DWORD sz = sizeof(buf)/sizeof(buf[0]);
|
||||
if (!GetTempPath(sz, buf)) {
|
||||
PyErr_SetFromWindowsErr(0);
|
||||
return NULL;
|
||||
}
|
||||
if (!GetTempPathW(sz, buf)) return PyErr_SetFromWindowsErr(0);
|
||||
return PyUnicode_FromWideChar(buf, -1);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user