Erick added the comment:
It also occurs to me that even if `concurrent.futures` adopted an alternative
Thread class, it would still be preferable to allow for composition in the
manner that was originally proposed.
--
___
Python tracker
<ht
Erick added the comment:
> What are examples of your some_important_context()? Is it important to call
> some code before destroying the thread?
To be honest, pulled a context manager example out of thin air to illustrate
the point. But sure, I want to allocate a resource before the
Erick added the comment:
> Can you apply some custom logic by specifying the initializer?
Not sure that I follow; how would I use a context manager with the initializer?
Of course this is just one example. In the `threading` docs, the second
sentence in the description of the `Thread.
New submission from Erick :
Currently the only way to use a class other than `threading.Thread` with
`concurrent.futures.ThreadPoolExecutor` is to extend `ThreadPoolExecutor` and
override the private method `_adjust_thread_count()`.
For example, suppose I have a class that applies some
New submission from Erick Fonseca:
cPickle raises a PicklingError when trying to pickle an instance of a class
defined in a module being profiled with cProfile.
Example code:
import cPickle
class A(object):
pass
a = A()
with open('file.dat',
Erick Jones added the comment:
This ended up biting me also. I had a list of URLs to fetch with
authentication. One of the URLs was bad (returning 401 even with
authentication), and that was causing all of the subsequent URLs to fail as
well since the reset count wasn't getting rese
New submission from Erick Tryzelaar :
I found that the sqlite3 function executemany module crashes when passed in a
generator that it iself is executing a query. It looks like this confuses the
statement cache, and causes it to get cleared inappropriately in this case.
I've attached a
New submission from Erick Tryzelaar :
It looks like Python 3.x's relpath isn't compatible between posixpath
and ntpath. In posixpath.relpath, the start keyword defaults to None,
but ntpath.relpath, the start keyword defaults to curdir.
Interestingly enough, 2.6 and 2.7 have a
Erick Tryzelaar added the comment:
Benjamin, I just applied that patch but I still got the same error:
/usr/bin/libtool -o Python.framework/Versions/3.1/Python
-dynamic libpython3.1.a \
-lSystem -lSystemStubs -arch_only i386 -
install_name
/opt/local
Erick Tryzelaar added the comment:
I completely agree, Georg. I tried to get this in before 3.0, but it
didn't work out which is a shame. I assume you also feel that we
couldn't make a backwards compatible change in 3.1, right? I thought I
heard that 3.1 may break some things in 3.
New submission from Erick Tryzelaar :
Python version 3.0.1's io.StringIO has a bug when trying to use
universal newlines on the mac. It's fixed in 3.1a1 though. Here's the
exception:
>>> io.StringIO('hello there\r\nlela\r\n', newline=None).readlines()
Traceba
Erick Tryzelaar added the comment:
Moving this to a documentation bug here: http://bugs.python.org/issue5452
--
message_count: 3.0 -> 4.0
___
Python tracker
<http://bugs.python.org/iss
New submission from Erick Tryzelaar :
(this is redirecting from http://bugs.python.org/issue5451). The
documentation for io.StringIO is incorrect on the arguments. First off, it
doesn't actually accept the "encoding" and "errors" arguments. Second,
it's not st
Erick Tryzelaar added the comment:
Thanks Benjamin. Could the documentation for StringIO be updated then? The
docs for io.StringIO [1] says that io.TextIOWrapper implements the
constructor, but TextIOWrapper defaults newline to None [2], and there's
nothing that states that io.Str
New submission from Erick Tryzelaar :
I noticed that io.StringIO is inconsistent with open on how newlines are
handled. The default approach open uses is universal newlines:
>>> with open('foo', 'w') as f:
... f.write('hello hi\r\nla la\r\n')
...
17
&
New submission from Erick Tryzelaar :
I noticed that it was possible to specify arbitrary arguments to
io.BytesIO:
>>> io.BytesIO(b'foo', foo=1)
<_io.BytesIO object at 0x430150>
But io.StringIO doesn't:
>>> io.StringIO('foo', foo=1)
Traceba
New submission from Erick Tryzelaar :
It would be really handy to add a way to portably kill process groups of
a process spawned with subprocess.Popen. My project starts a process,
which then starts other long running processes. Because of this process
tree, there's no way for me to por
Erick Tryzelaar added the comment:
I just checked, and the latest svn version of python has fixed this. Could
someone close this bug for me?
___
Python tracker
<http://bugs.python.org/issue4
New submission from Erick Tryzelaar :
Noticed that in the release version of python 3.0 and the latest svn that
on line 835 the exception UnpickingError is raised instead of UnpicklingError.
--
components: Library (Lib)
messages: 79531
nosy: erickt
severity: normal
status: open
title
New submission from Erick Tryzelaar :
According to both of these bugs:
http://bugs.python.org/issue1398
http://bugs.python.org/issue4331
pickle can't pickle functools.partial objects. It looks the underlying
reason is that objects that pickle can't handle objects with __new__ an
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
As I mentioned on python-ideas, I my project needs to extend fnmatch to
support zsh-style globbing, where you can use brackets to designate
subexpressions. Say you had a directory structure like this:
foo/
foo.ext1
foo.ex
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
I'm running into a similar problem as Jean-Paul in:
http://bugs.python.org/issue4223
But the patch in it doesn't work for me. My issue is also with files
compiled already with python3.0, but then being accessed f
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
I ran into a case where I modified the __name__ attribute of a function
and then didn't specify the right number of arguments, and I got a
TypeError that used the original function name, as demonstrated here:
>>
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
I believe I found an unintentional syntax error with a combination of
decorators, parenthesis, and dots. Here's a demonstration:
class C:
def prop(self, function):
return property(function)
class F:
@C().prop
Erick Tryzelaar <[EMAIL PROTECTED]> added the comment:
fyi, the multiprocessing docs also refer to applyAync, but the function
was renamed to apply_async. This is also in the python 3.0 docs.
--
nosy: +erickt
versions: +Python 3.0
___
Python t
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
It seems like there's a bug with defaultdict. This is segfaulting with
the latest python 3.0 svn checkout:
import collections, pickle
d=collections.defaultdict(int)
d[1]
pickle.dumps(d)
It errors out with:
Asser
Erick Tryzelaar <[EMAIL PROTECTED]> added the comment:
fyi, on the mac with gcc-4.2, distutils is erroring out because of the "-
Wno-long-double" it is getting from "python-config --cflags", as it's no
longer accepted as an argument. Fortunately this can be work
Erick Tryzelaar <[EMAIL PROTECTED]> added the comment:
fyi, I found another case where pprint needs a "safe sort", this is
when you have a list that contains a dictionary. Anyway, Here's a
simple patch that creates a _safe_sorted function that implements the
fallback
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
I've run into a case where pprint isn't able to print out a particular
data structure, and have distilled it down to a simple example:
import pprint
class A:
pass
pprint.pprint({A(): 1, A(): 2})
Which throw
Erick Tryzelaar <[EMAIL PROTECTED]> added the comment:
On Thu, Aug 28, 2008 at 1:48 PM, Erick Tryzelaar <[EMAIL PROTECTED]> wrote:
>
> New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
>
> The docs still reference Py_InitModule*, which was removed in r641
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
The docs still reference Py_InitModule*, which was removed in r64107.
Also, Demo/embed/demo.c still use Py_InitModule, and thus doesn't
compile.
--
assignee: georg.brandl
components: Documentation
messages: 72111
n
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
Hello,
I noticed that doing "pydoc3.0 hashlib" was throwing this exception:
Traceback (most recent call last):
File "/opt/local/bin/pydoc3.0", line 5, in
pydoc.cli()
File
"/opt/local/Library/Frame
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
functools.partial functions are not comparable, in both python 2.5 and
3.0:
>>> def foo(): pass
>>> functools.partial(foo) == functools.partial(foo)
False
It can be worked around by comparing the func, args,
Erick Tryzelaar <[EMAIL PROTECTED]> added the comment:
> Guido van Rossum <[EMAIL PROTECTED]> added the comment:
>
> Does this occur in 2.6 or 2.5?
It doesn't in python 2.5. The RuntimeError manages to get printed out.
I don't have 2.6 installed to test ag
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
I found a segfault in pickle.load when you overload __getattr__ and
create yourself a infinite loop in the latest svn checkout of python 3:
import pickle
class Foo:
def __getattr__(sel
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
Hello again!
It looks like doing "make frameworkinstall maninstall" isn't creating
"Python.framework/Versions/3.0/Resources/Python.app", so when I try to
run python it errors out with: "python3.0: e
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
There's a slight typo in Mac/Makefile.in, where DESDIR was used instead of
DESTDIR. This
patch fixes it:
--- /tmp/Makefile.in2008-07-18 19:42:29.0 -0700
+++ Mac/Makefile.in 2008-07-18 19:42:33.0 -070
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
This may be a known consequence of python 3.0, but I couldn't find any
reference to it, nor a test case that covers it. Here's a valid use of yield
in 2.5.1:
>>> def foo():
... x=[(yield x) for x in 1,2,3]
..
Erick Tryzelaar <[EMAIL PROTECTED]> added the comment:
Hello again,
I then have problems with it finding MacOS.py in the BuildApplet.py script:
DYLD_FRAMEWORK_PATH=/opt/local/var/macports/build/_Users_Shared_erickt_Projects_macports_dports.git_lang_python30/work/Python-3.0b1:
../pyth
Erick Tryzelaar <[EMAIL PROTECTED]> added the comment:
I should add the error message:
DYLD_FRAMEWORK_PATH=/opt/local/var/macports/build/_Users_Shared_erickt_P
rojects_macports_dports.git_lang_python30/work/Python-3.0b1:
../python.exe ./scripts/cachersrc.py -v
/opt/local/var/macports
New submission from Erick Tryzelaar <[EMAIL PROTECTED]>:
Revision r63851 [1] by Benjamin Peterson removed a couple mac scripts,
including cachersrc.py. Unfortunately, this script is still referenced in
Mac/Makefile.in, so it fails to install on my mac. Anyone have a
workaround I could a
New submission from Erick Tryzelaar:
I was playing around with python 3's io functions, and I found that when trying
to write to
an encoded utf-16 file that TextIOWrapper.write re-writes the utf-16 bom for
every string:
>>> f=open('foo', 'w', encoding=
42 matches
Mail list logo