[issue37528] test_tarfile: test_extractall_symlinks() fails on Windows with: [WinError 206] The filename or extension is too long

2019-08-22 Thread STINNER Victor


STINNER Victor  added the comment:

Hum, tests are still failing, example on AMD64 Windows8.1 Non-Debug 3.x:
https://buildbot.python.org/all/#/builders/12/builds/2992

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37528] test_tarfile: test_extractall_symlinks() fails on Windows with: [WinError 206] The filename or extension is too long

2019-08-21 Thread Steve Dower


Steve Dower  added the comment:

I disabled the long path support on my own build and can reproduce this by 
passing a long path to --tempdir

Unfortunately, I'm not familiar enough with what tarfile is trying to do here - 
why is it recreating the entire directory structure within itself?

Browsing through lib/tarfile.py, I suspect it's the mix of "/" literals and 
os.path functions that's at fault here. It probably requires a much bigger job 
to go through and fix it up than simply fixing tests.

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37528] test_tarfile: test_extractall_symlinks() fails on Windows with: [WinError 206] The filename or extension is too long

2019-07-09 Thread Eryk Sun


Eryk Sun  added the comment:

If you want to harden the test for Windows, you could transform TEMPDIR
into an extended path. os.path._getfinalpathname always returns an extended 
path. For example:

>>> os.path._getfinalpathname('C:/Temp')
'?\\C:\\Temp'

>>> os.path._getfinalpathname('//localhost/C$/Temp')
'?\\UNC\\localhost\\C$\\Temp'

> windows.RtlAreLongPathsEnabled: 
> 
> RtlAreLongPathsEnabled() is not available on Windows 8.1. I don't 
> know if long paths support is enabled or not on this buildbot (I 
> guess that no, it isn't).

Normalized long paths are implemented in Windows 10 1607 and later. Previous 
versions do not have RtlAreLongPathsEnabled and cannot support normalized long 
paths. RtlAreLongPathsEnabled() will be true if, at process startup, the 
"LongPathsEnabled" policy is enabled in the registry and the application 
manifest claims to be "longPathAware". 

In all supported versions of Windows, long paths are supported by most 
filesystem functions if we use an extended path, i.e. a fully-qualified Unicode 
path that starts with the \\?\ prefix. This path type is not normalized in a 
create or open context, so it can only use backslash as the path separator, not 
forward slash. Also, the process working directory does not allow extended 
paths, so when using extended paths we have to manage our own working directory 
and manually resolve relative paths, including "." and ".." components (e.g. by 
calling GetFullPathNameW).

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37528] test_tarfile: test_extractall_symlinks() fails on Windows with: [WinError 206] The filename or extension is too long

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:

On this buildbot build, test_tarfile succeeded when run again. Likely because 
the test is run in the main regrtest process which doesn't have 
"test_python_worker_xxx" in its current working directory.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37528] test_tarfile: test_extractall_symlinks() fails on Windows with: [WinError 206] The filename or extension is too long

2019-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37528] test_tarfile: test_extractall_symlinks() fails on Windows with: [WinError 206] The filename or extension is too long

2019-07-09 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 Windows8.1 Non-Debug 3.x:
https://buildbot.python.org/all/#/builders/12/builds/2862

FAIL: test_extractall_symlinks (test.test_tarfile.Bz2WriteTest)
--
Traceback (most recent call last):
  File 
"D:\buildarea\3.x.ware-win81-release.nondebug\build\lib\test\test_tarfile.py", 
line 1312, in test_extractall_symlinks
tar.extractall(path=tempdir)
FileNotFoundError: [WinError 206] The filename or extension is too long: 
'D:\\buildarea\\3.x.ware-win81-release.nondebug\\build\\build\\test_python_3164\\test_python_worker_5512\\@test_5512_tmp-tardir\\testsymlinks\\buildarea\\3.x.ware-win81-release.nondebug\\build\\build\\test_python_3164\\test_python_worker_5512\\@test_5512_tmp-tardir'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"D:\buildarea\3.x.ware-win81-release.nondebug\build\lib\test\test_tarfile.py", 
line 1314, in test_extractall_symlinks
self.fail("extractall failed with symlinked files")
AssertionError: extractall failed with symlinked files


Extract of pythoninfo:

windows.RtlAreLongPathsEnabled: 

RtlAreLongPathsEnabled() is not available on Windows 8.1. I don't know if long 
paths support is enabled or not on this buildbot (I guess that no, it isn't).

I'm not sure why the test started to fail.

--
components: Tests
messages: 347549
nosy: vstinner, zach.ware
priority: normal
severity: normal
status: open
title: test_tarfile: test_extractall_symlinks() fails on Windows with: 
[WinError 206] The filename or extension is too long
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com