[issue23453] Opening a stream with tarfile.open() triggers a TypeError: can't concat bytes to str error

2015-02-12 Thread Carl Chenet

New submission from Carl Chenet:

I'm trying to use a tar stream to a Python tarfile object but each time I do 
have a  TypeError: can't concat bytes to str error

Here is my test:
-8-
#!/usr/bin/python3.4

import tarfile
import sys

tarobj = tarfile.open(mode='r|', fileobj=sys.stdin)
print(tarobj)
tarobj.close()
-8-


$ tar cvf test.tar.gz tests/
tests/
tests/foo1
tests/foo/
tests/foo/bar
$ tar -O -xvf test.tar | ./tarstream.py
tests/
tests/foo1
tests/foo/
tests/foo/bar
Traceback (most recent call last):
  File ./tarstream.py, line 6, in module
tarobj = tarfile.open(mode='r|', fileobj=sys.stdin)
  File /usr/lib/python3.4/tarfile.py, line 1578, in open
t = cls(name, filemode, stream, **kwargs)
  File /usr/lib/python3.4/tarfile.py, line 1470, in __init__
self.firstmember = self.next()
  File /usr/lib/python3.4/tarfile.py, line 2249, in next
tarinfo = self.tarinfo.fromtarfile(self)
  File /usr/lib/python3.4/tarfile.py, line 1082, in fromtarfile
buf = tarfile.fileobj.read(BLOCKSIZE)
  File /usr/lib/python3.4/tarfile.py, line 535, in read
buf = self._read(size)
  File /usr/lib/python3.4/tarfile.py, line 543, in _read
return self.__read(size)
  File /usr/lib/python3.4/tarfile.py, line 569, in __read
self.buf += buf
TypeError: can't concat bytes to str

Regards,
Carl Chenet

--
components: Library (Lib)
messages: 235808
nosy: chaica_
priority: normal
severity: normal
status: open
title: Opening a stream with tarfile.open() triggers a TypeError: can't concat 
bytes to str error
type: crash
versions: Python 3.4

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



[issue11296] Possible error in What's new in Python 3.2 : duplication of rsplit() mention

2011-02-22 Thread Carl Chenet

New submission from Carl Chenet cha...@ohmytux.com:

Hi,

Could the rsplit() method be mentioned mistakenly two times in the following 
sentence of the current What's new in Python 3.2 ?

The fast-search algorithm in stringlib is now used by the split(), rsplit(), 
splitlines() and replace() methods on bytes, bytearray and str objects. 
Likewise, the algorithm is also used by rfind(), rindex(), rsplit() and 
rpartition().

Regards,
Carl Chenet

--
assignee: docs@python
components: Documentation
messages: 129146
nosy: chaica_, docs@python
priority: normal
severity: normal
status: open
title: Possible error in What's new in Python 3.2 : duplication of rsplit() 
mention
versions: Python 3.2

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



[issue11234] Possible error in What's new Python3.2(rc3) documentation (sysconfig.get_config_var)

2011-02-17 Thread Carl Chenet

New submission from Carl Chenet cha...@ohmytux.com:

Hi,

It seems a mistake could be in the What's new in Python 3.2 (rc3) 
documentation in the sysconfig.get_config_var('SO') example :

 sysconfig.get_config_var('SO')   # find the full filename extension
'cpython-32mu.so'

On my system (Debian GNU/Linux, Python3.2rc3), the same command gives :
 
 sysconfig.get_config_var('SO')
'.cpython-32m.so'

A dot at the beginning of the string could be missing in the example of the 
current documentation. This dot also appears in the example of the PEP 3149.

Regards,
Carl Chenet

--
assignee: docs@python
components: Documentation
messages: 128747
nosy: chaica_, docs@python
priority: normal
severity: normal
status: open
title: Possible error in What's new Python3.2(rc3) documentation 
(sysconfig.get_config_var)
versions: Python 3.2

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



[issue9304] unreproducible example in the memoryview documentation

2010-07-19 Thread Carl Chenet

New submission from Carl Chenet cha...@ohmytux.com:

Hi,

In the current documentation at 
http://docs.python.org/library/stdtypes.html#memoryview, the first example 
announces : 

 v = memoryview('abcefg')
 v[1]
'b'
 v[-1]
'g'
 v[1:4]
memory at 0x77ab28
 str(v[1:4])
'bce'

Trying to reproduce this example I got : 

$ python
Python 2.7 (r27:82500, Jul 13 2010, 17:48:51) 
[GCC 4.4.1] on linux2
Type help, copyright, credits or license for more information.
 v = memoryview('abcefg')
 v[1]
'b'
 v[-1]
'g'
 v[1:4]
memory at 0xa2a510
 str(v[1:4])
'memory at 0xa2a5a8'

The last line of the example in the documentation is not reproducible. Hope 
it's only a documentation issue.

Bye,
Carl Chenet

--
assignee: d...@python
components: Documentation
messages: 110766
nosy: chaica_, d...@python
priority: normal
severity: normal
status: open
title: unreproducible example in the memoryview documentation
versions: Python 2.7

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



[issue7418] hashlib : the names of the different hash algorithms

2009-12-24 Thread Carl Chenet

Carl Chenet cha...@ohmytux.com added the comment:

Hi,

Maybe you have some ideas on this patch? I think it could be a nice
feature e.g in my app I need to support every hash algorithms available
so with optparse module it is possible to write something like :
 
for __hashtype in ('md5', 'sha1',
'sha224','sha256','sha384','sha512'):
__parser.add_option('--{}'.format(__hashtype), dest='hashtype',
action='store_const', const='{}'.format(__hashtype),
help='use the {} hash algorithm type'.format(__hashtype))
__options, _ = __parser.parse_args()

And it would be better if this tuple could be provided by the hashlib
module itself, making the code more evolutive.

--

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



[issue7418] hashlib : the names of the different hash algorithms

2009-12-02 Thread Carl Chenet

Carl Chenet cha...@ohmytux.com added the comment:

flox : You're right, sorry about that.

Here is a fixed patch.

--
Added file: 
http://bugs.python.org/file15437/algorithms_constant_value_in_hashlib_module.diff

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



[issue7418] hashlib : the names of the different hash algorithms

2009-12-02 Thread Carl Chenet

Changes by Carl Chenet cha...@ohmytux.com:


Removed file: 
http://bugs.python.org/file15437/algorithms_constant_value_in_hashlib_module.diff

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



[issue7418] hashlib : the names of the different hash algorithms

2009-12-02 Thread Carl Chenet

Carl Chenet cha...@ohmytux.com added the comment:

The fixed file :
algorithms_constant_attribute_in_hashlib_module_update1.diff

--
Added file: 
http://bugs.python.org/file15438/algorithms_constant_attribute_in_hashlib_module_update1.diff

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



[issue7418] hashlib : the names of the different hash algorithms

2009-12-01 Thread Carl Chenet

New submission from Carl Chenet cha...@ohmytux.com:

Hi,

The hashlib module could provide a tuple offering the names of the
different hash algorithms which are guaranteed to be supported.

The expected result: 

 import hashlib
 hashlib.algorithms
('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512')

Here is a patch to do so. It also provides an update for the hashlib
documentation and a test case.

Bye,
Carl Chenet

--
components: Library (Lib)
files: algorithms_constant_attribute_in_hashlib_module.diff
keywords: patch
messages: 95857
nosy: chaica_
severity: normal
status: open
title: hashlib : the names of the different hash algorithms
type: feature request
versions: Python 3.2
Added file: 
http://bugs.python.org/file15427/algorithms_constant_attribute_in_hashlib_module.diff

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