Test failures on Windows
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with libarchive/write.py, especially ArchiveWrite.add_files, which the traceback shows failing while reading directory entries and opening archive source paths. Then inspect the failing tests tests/test_convert.py, tests/test_entry.py, and tests/test_rwx.py on Windows. Done means the six reported tests pass on Windows and archive writing works across the listed writer types.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
These tests fail for mysterious reasons.
They are all somehow related to writing archives.
I wonder why the new_archive_entry is reused in the paths loop when adding files rather than having a new entry? Nevertheless the failure might be due to the fact that somehow the file being added may be already opened for writing? Not sure. To investigate.. This could all be due to a single problem.
Possibly a build problem, though the built lib works rather well otherwise.
FWIW errno 22 is EINVAL
================================== FAILURES ===================================
________________________________ test_convert _________________________________
def test_convert():
# Collect information on what should be in the archive
tree = treestat('libarchive')
# Create an archive of our libarchive/ directory
buf = bytes(bytearray(1000000))
with memory_writer(buf, 'gnutar', 'xz') as archive1:
> archive1.add_files('libarchive/')
tests\test_convert.py:21:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
libarchive\write.py:61: in add_files
r = read_next_header2(read_p, entry_p)
libarchive\ffi.py:85: in check_int
raise archive_error(args[0], retcode)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
archive_p = 3609976, retcode = -25
def archive_error(archive_p, retcode):
msg = _error_string(archive_p)
> raise ArchiveError(msg, errno(archive_p), retcode, archive_p)
E ArchiveError: <unprintable ArchiveError object>
libarchive\ffi.py:69: ArchiveError
____________________________ test_entry_properties ____________________________
def test_entry_properties():
buf = bytes(bytearray(1000000))
with memory_writer(buf, 'gnutar') as archive:
> archive.add_files('README.rst')
tests\test_entry.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <libarchive.write.ArchiveWrite object at 0x03460150>
paths = ('README.rst',), write_p = 3609224, block_size = 10240
entry_p = 47076136
def add_files(self, *paths):
"""Read the given paths from disk and add them to the archive.
"""
write_p = self._pointer
block_size = ffi.write_get_bytes_per_block(write_p)
if block_size <= 0:
block_size = 10240 # pragma: no cover
with new_archive_entry() as entry_p:
entry = ArchiveEntry(None, entry_p)
for path in paths:
with new_archive_read_disk(path) as read_p:
while 1:
r = read_next_header2(read_p, entry_p)
if r == ARCHIVE_EOF:
break
entry.pathname = entry.pathname.lstrip('/')
read_disk_descend(read_p)
write_header(write_p, entry_p)
try:
> with open(entry_sourcepath(entry_p), 'rb') as f:
while 1:
E IOError: [Errno 13] Permission denied: '\\\\?\\c:\\w421\\python-libarchive-c\\README.rst'
libarchive\write.py:68: IOError
________________________________ test_buffers _________________________________
tmpdir = local('c:\\tmp\\pytest-49\\test_buffers0')
def test_buffers(tmpdir):
# Collect information on what should be in the archive
tree = treestat('libarchive')
# Create an archive of our libarchive/ directory
buf = bytes(bytearray(1000000))
with libarchive.memory_writer(buf, 'gnutar', 'xz') as archive:
> archive.add_files('libarchive/')
tests\test_rwx.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
libarchive\write.py:61: in add_files
r = read_next_header2(read_p, entry_p)
libarchive\ffi.py:85: in check_int
raise archive_error(args[0], retcode)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
archive_p = 3668736, retcode = -25
def archive_error(archive_p, retcode):
msg = _error_string(archive_p)
> raise ArchiveError(msg, errno(archive_p), retcode, archive_p)
E ArchiveError: H??????: Couldn't visit directory (errno=22, retcode=-25, archive_p=3668736)
libarchive\ffi.py:69: ArchiveError
___________________________________ test_fd ___________________________________
tmpdir = local('c:\\tmp\\pytest-49\\test_fd0')
def test_fd(tmpdir):
archive_file = open(tmpdir.strpath+'/test.tar.bz2', 'w+b')
fd = archive_file.fileno()
# Collect information on what should be in the archive
tree = treestat('libarchive')
# Create an archive of our libarchive/ directory
> with libarchive.fd_writer(fd, 'gnutar', 'bzip2') as archive:
archive.add_files('libarchive/')
tests\test_rwx.py:45:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
c:\Python27\Lib\contextlib.py:17: in __enter__
return self.gen.next()
libarchive\write.py:116: in fd_writer
ffi.write_open_fd(archive_p, fd)
libarchive\ffi.py:85: in check_int
raise archive_error(args[0], retcode)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
archive_p = 3669416, retcode = -30
def archive_error(archive_p, retcode):
msg = _error_string(archive_p)
> raise ArchiveError(msg, errno(archive_p), retcode, archive_p)
E ArchiveError: Failed to clean up compressor (errno=22, retcode=-30, archive_p=3669416)
libarchive\ffi.py:69: ArchiveError
_________________________________ test_files __________________________________
tmpdir = local('c:\\tmp\\pytest-49\\test_files0')
def test_files(tmpdir):
archive_path = tmpdir.strpath+'/test.tar.gz'
# Collect information on what should be in the archive
tree = treestat('libarchive')
# Create an archive of our libarchive/ directory
with libarchive.file_writer(archive_path, 'ustar', 'gzip') as archive:
> archive.add_files('libarchive/')
tests\test_rwx.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
libarchive\write.py:61: in add_files
r = read_next_header2(read_p, entry_p)
libarchive\ffi.py:85: in check_int
raise archive_error(args[0], retcode)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
archive_p = 3609400, retcode = -25
def archive_error(archive_p, retcode):
msg = _error_string(archive_p)
> raise ArchiveError(msg, errno(archive_p), retcode, archive_p)
E ArchiveError: Hibarchive/: Couldn't visit directory (errno=22, retcode=-25, archive_p=3609400)
libarchive\ffi.py:69: ArchiveError
_____________________________ test_custom_writer ______________________________
def test_custom_writer():
# Collect information on what should be in the archive
tree = treestat('libarchive')
# Create an archive of our libarchive/ directory
blocks = []
def write_cb(data):
blocks.append(data[:])
return len(data)
with libarchive.custom_writer(write_cb, 'zip') as archive:
> archive.add_files('libarchive/')
tests\test_rwx.py:97:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
libarchive\write.py:61: in add_files
r = read_next_header2(read_p, entry_p)
libarchive\ffi.py:85: in check_int
raise archive_error(args[0], retcode)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
archive_p = 3666496, retcode = -25
def archive_error(archive_p, retcode):
msg = _error_string(archive_p)
> raise ArchiveError(msg, errno(archive_p), retcode, archive_p)
E ArchiveError: 9: Couldn't visit directory (errno=22, retcode=-25, archive_p=3666496)
libarchive\ffi.py:69: ArchiveError
===================== 6 failed, 5 passed in 1.53 seconds ======================
- Lingua principale
- Python
- Stelle
- 84
- Fork
- 41
- Merge medio
- 6g 12h
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Changaco/python-libarchive-c
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 51/100
Changaco/python-libarchive-c#144 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
Changaco/python-libarchive-c#143 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
Changaco/python-libarchive-c#129 ·
-
Suggestion: Test fileAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
Changaco/python-libarchive-c#122 · 1 commento ·
-
Type checkingApertafeature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Changaco/python-libarchive-c#111 ·
Tutte le issue di Changaco/python-libarchive-c
Issue simili
-
area/profiles comp/cli P3 type/feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
NousResearch/hermes-agent#146372 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] OpenAI-compatible embedding model alias breaks embedder constructionForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistenciesForse già presa @github-actions l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
GeoSeries scale and skew tests fail with pytest 9.2.0Forse già presa @jiayuasu l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
admission-deferred priority: medium status: ready work-class: scoped
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
melodic-software/claude-code-plugins#10887 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno