[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2021-04-27 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2021-04-27 Thread miss-islington


miss-islington  added the comment:


New changeset 9aea31deddf7458be3546f72185740f3cd06687f by Anthony Sottile in 
branch 'master':
bpo-8978: improve tarfile.open error message when lzma / bz2 are missing 
(GH-24850)
https://github.com/python/cpython/commit/9aea31deddf7458be3546f72185740f3cd06687f


--
nosy: +miss-islington

___
Python tracker 

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



[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2021-03-15 Thread Anthony Sottile


Anthony Sottile  added the comment:

I took a stab at improving the error message (see the linked PR)

$ ./python -c 'import tarfile; tarfile.open("Lib/test/testtar.tar.xz")'
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/asottile/workspace/cpython/Lib/tarfile.py", line 1620, in open
raise ReadError(f"file could not be opened successfully:\n{error_msgs}")
tarfile.ReadError: file could not be opened successfully:
- method gz: ReadError('not a gzip file')
- method bz2: CompressionError('bz2 module is not available')
- method xz: CompressionError('lzma module is not available')
- method tar: ReadError('truncated header')

--

___
Python tracker 

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



[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2021-03-13 Thread Anthony Sottile


Change by Anthony Sottile :


--
nosy: +Anthony Sottile
nosy_count: 7.0 -> 8.0
pull_requests: +23611
pull_request: https://github.com/python/cpython/pull/24850

___
Python tracker 

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



[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2020-11-04 Thread Jordan Williams


Jordan Williams  added the comment:

This issue took me a long time to diagnose when attempting to decompress a 
bzip2-compressed tarball. This occurs with Python 3.9.0. Since I was using 
asdf, which uses Pyenv internally, to build and manage my Python version, I 
failed to notice it was missing development libraries. A slightly more 
informative message could easily have tipped me off to this in short order.

--
nosy: +jwillikers
type: behavior -> crash
versions: +Python 3.9 -Python 3.3

___
Python tracker 

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



[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2020-03-27 Thread Deep Sukhwani


Deep Sukhwani  added the comment:

Hello, I just observed this issue on Python 3.8.2 while running tests for 
Django project.

Example error
==
ERROR: test_extract_function (utils_tests.test_archive.TestArchive) 
[foobar.tar.xz]
--
Traceback (most recent call last):
...
raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully

Python version: 3.8.2
OS: macOS Catalina 10.15.4

This should be reopened?

--
nosy: +Deep Sukhwani

___
Python tracker 

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



[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2018-11-26 Thread Kevin Funk


Kevin Funk  added the comment:

(Sorry: I just noticed the Python 3.6 I'm using is /not/ from distro packages. 
The issue remains, though, the Python exception could be more descriptive.)

--

___
Python tracker 

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



[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2018-11-26 Thread Kevin Funk


Kevin Funk  added the comment:

It's Python 3.6 from CentOS 6. In my particular case I'm lacking the lzma 
module. But for figuring that out I had to add the explicit modes to the 
`tarfile.open` calls in my Python script.

--

___
Python tracker 

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



[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2018-11-26 Thread STINNER Victor


STINNER Victor  added the comment:

> I just ran into this, under Python 3.6.

How did you install Python? What is your OS?

--

___
Python tracker 

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



[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2018-11-26 Thread Kevin Funk


Kevin Funk  added the comment:

I just ran into this, under Python 3.6.

IMHO, the error message should be improved, even when the mode was not passed 
explicitly.

Can someone reopen this?

--
nosy: +kfunk

___
Python tracker 

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



[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2016-04-20 Thread Lars Gustäbel

Lars Gustäbel added the comment:

Closed after years of inactivity.

--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue8978] tarfile.ReadError: file could not be opened successfully if compiled without zlib

2011-02-08 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo
versions: +Python 3.3 -Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8978
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8978] tarfile.ReadError: file could not be opened successfully if compiled without zlib

2010-06-12 Thread Lars Gustäbel

Lars Gustäbel l...@gustaebel.de added the comment:

If you pass an explicit mode, the error message is more or less what you want:

 tarfile.open(uga.tgz, mode=r:gz)
[...]
tarfile.CompressionError: gzip module is not available

The way mode=r detects which compression format is used is to open the file 
with each open method (i.e. taropen, gzopen, bz2open) until one of them 
succeeds. If none of them matches it is impossible to say what the reason was.

As this would require more than just a simple one-line change, 2.7 is out of 
the question. But I see what I can do for 3.2.

--
versions:  -Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8978
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8978] tarfile.ReadError: file could not be opened successfully if compiled without zlib

2010-06-11 Thread Florent Xicluna

New submission from Florent Xicluna florent.xicl...@gmail.com:

When Python is compiled without zlib support, the error message is not very 
helpful when trying to untar an archive.

 tarfile.open('sample.tar.gz')
tarfile.ReadError: file could not be opened successfully

It happens when you run python distribute_setup.py, for example.
 ( http://s3.pixane.com/pip_distribute.png )

--
components: Extension Modules
messages: 107587
nosy: flox
priority: low
severity: normal
status: open
title: tarfile.ReadError: file could not be opened successfully if compiled 
without zlib
type: behavior
versions: Python 2.7, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8978
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8978] tarfile.ReadError: file could not be opened successfully if compiled without zlib

2010-06-11 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Which message do you suggest?

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8978
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8978] tarfile.ReadError: file could not be opened successfully if compiled without zlib

2010-06-11 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
assignee:  - lars.gustaebel
nosy: +lars.gustaebel

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8978
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8978] tarfile.ReadError: file could not be opened successfully if compiled without zlib

2010-06-11 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

something like :
  raise CompressionError(zlib module is not available)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8978
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8978] tarfile.ReadError: file could not be opened successfully if compiled without zlib

2010-06-11 Thread Florent Xicluna

Changes by Florent Xicluna florent.xicl...@gmail.com:


--
components: +Library (Lib) -Extension Modules

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8978
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com