New submission from Baptiste Lepilleur:
Documentation states:
help( subprocess.check_output )
check_output(*popenargs, timeout=None, **kwargs)
Run command with arguments and return its output as a byte string.
But the most common usage is:
subprocess.check_output( 'echo test', shell=True
New submission from Baptiste Lepilleur:
It tooks me a while to figure out that using universal_newlines was the
solution to tell subprocess that I wanted text string output instead of byte
string.
A search on stackoverflow shows that this issue is common and the solution
nearly unknown
Hi,
I want to sub-class the datetime.timezone class, but when I derive from
datetime.timezone I get an error message TypeError: type
'datetime.timezone' is not an acceptable base type.
Why do I get this error? Is there something specific to do to avoid it?
Below is an example of code:
Python
New submission from Baptiste Lepilleur b...@users.sourceforge.net:
How to reproduce:
from logging.handlers import QueueListener
from multiprocessing import Queue
q = Queue(100)
l = QueueListener(q)
Traceback (most recent call last):
File stdin, line 1, in module
File C:\Python32\lib
Baptiste Lepilleur b...@users.sourceforge.net added the comment:
Forgot to give the precise python version:
Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on
win32
--
___
Python tracker rep...@bugs.python.org
http
Changes by Baptiste Lepilleur b...@users.sourceforge.net:
--
title: New QueueListener is unusable due to threading and queue import - New
QueueListener is unusable due to missing threading and queue import
___
Python tracker rep...@bugs.python.org
New submission from Baptiste Lepilleur b...@users.sourceforge.net:
When the code samples from the CHM documentation are displayed, if the lines
are too long, a scroll bar is added at the bottom which prevents reading the
last line of the code sample.
Usually this can be worked-around
New submission from Baptiste Lepilleur b...@users.sourceforge.net:
In section 14.4.3.6. type of the argparse module, the following code sample
is given:
parser = argparse.ArgumentParser()
parser.add_argument('foo', type=int)
parser.add_argument('bar', type=file)
parser.parse_args('2
Hi,
I'm trying to port a small library to Python 3.x, and I'm wondering what is
the best way to port statements such as the one belows that are frequently
found in network protocol implementation:
headerparts = (%s:%s\n % (key, value) for key, value in
headers.iteritems())
Hi,
I'm trying to port some network protocol library to Python 3.x, and it
defines many bytes literals as plain string.
How do you define bytes literals so that the library can be ported to Python
3.x using only 2to3? For example:
In python 2.x, I need:
self.buffer = '\n'
In python 3.x,
2011/1/1 Stefan Behnel stefan...@behnel.de
Terry Reedy, 01.01.2011 11:08:
On 1/1/2011 4:08 AM, Baptiste Lepilleur wrote:
Is there a way to mark string literals so that 2to3 automatically
prefixes them with 'b'? Is there a simpler trick?
Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46
2011/1/1 Stefan Behnel stefan...@behnel.de
Baptiste Lepilleur, 01.01.2011 10:01:
Hi,
I'm trying to port a small library to Python 3.x, and I'm wondering what
is
the best way to port statements such as the one belows that are
frequently
found in network protocol implementation
Hi,
I stumbled on a small bug with httplib2 that I reduced to the example below.
It seems that with Python 3, when an exception is handled it unbound the
previously declared local variable. This did not occurs with Python 2.5.
It is a Python 3 feature? I did not find anything in the what's news,
2010/2/24 Lars Gustäbel l...@gustaebel.de
On Wed, Feb 24, 2010 at 09:37:19AM +0100, Baptiste Lepilleur wrote:
I stumbled uppon this and find it somewhat odd: some class methods of
TarFile and TarInfo do not appears in either the online documentation or
search while they have a doc string
I stumbled uppon this and find it somewhat odd: some class methods of
TarFile and TarInfo do not appears in either the online documentation or
search while they have a doc string:
http://docs.python.org/search.html?q=gzopen
Hi,
I'm looking for the equivalent of the built-in chr(x) function that would
return a bytes type taking an integer as parameter.
The easiest way I found to do this is the function below, but there must be
some simpler way to do that and I must be overlooking something fairly
obvious...
def
Reading python io.IOBase class documentation, I'm kind of confused at the
expected behavior of operation on a closed file object.
The io.IOBase class doc says:
Note that calling any method (even inquiries) on a closed stream is
undefined. Implementations may raise
New submission from Baptiste Lepilleur b...@users.sourceforge.net:
The io.IOBase class doc says:
Note that calling any method (even inquiries) on a closed stream is
undefined. Implementations may raise IOError in this case.
But the io.IOBase.close() method document says:
Once the file is closed
Changes by Baptiste Lepilleur b...@users.sourceforge.net:
--
title: Behavio of operations on a closed file object is not documented
correctly - Behavior of operations on a closed file object is not documented
correctly
___
Python tracker rep
By adding a before the closing brace of the tuple. Python allow this to
disambiguate between braced expression and tuple
type( (1,) )
type 'tuple'
2009/12/4 Петров Александр gmdi...@gmail.com
How could I tell Python that (1) is not an integer, but an one-arity
tuple ?
Thank you,
By adding a before the closing brace of the tucomma after 1. Python allow
this to disambiguate between braced expression and tuple
type( (1,) )
type 'tuple'
2009/12/4 Петров Александр gmdi...@gmail.com
How could I tell Python that (1) is not an integer, but an one-arity
tuple ?
Thank
I think you can use python itself for pre-processing. Here is an
(shortened) example from PyPy RPython paper:
# operators: the docstrings contain the
# symbol associated with each operator
class Op_Add(BinaryExpr):
’+’
class Op_Sub(BinaryExpr):
’-’
# INIT-TIME only: build the table of
#
New submission from Baptiste Lepilleur b...@users.sourceforge.net:
The import hook demo in the source directory
Python-3.1.1\Demo\imputil\knee.py fails to run correctly:
Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
(Intel)] on win32
Type help, copyright, credits
After applying 2to3.py to port a 2.6 script to 3.1, I get the following
error when running my script:
File purekeyworddbtest.py, line 143, in __init__
f = codecs.open(EXCLUDED_KEYWORDS_FILE, 'rt', 'utf-8')
File c:\Python31\lib\codecs.py, line 870, in open
file = builtins.open(filename,
New submission from Baptiste Lepilleur b...@users.sourceforge.net:
PCBuild requires nasmw.exe but it no longer exists in the latest version
of nasm.
I had to rename nasm.exe to nasmw.exe. Would be nice to add this to the
readme to avoid confusion...
--
components: Build
files: nasm
I'm looking for a tool that could be used in a pre-commit step to check that
only features available in a old python version are used, say python 2.3
for example.
Does any one know of one ?
--
http://mail.python.org/mailman/listinfo/python-list
I activated httplib debug, and when trace are printed, a UnicodeError
exception is thrown. I have already set sys.stdout to use utf-8 encoding
(this removed the exception when *I* was printing unicode), but from the
stacktrace below, the encoding seems to magically have switched to 'ascii'
27 matches
Mail list logo