Memeplex added the comment:
I understand Michael's comment http://bugs.python.org/issue672115#msg14169 but
I'm failing to see how it's directly related to this issue: as Michael himself
said it's even relevant for the object-subclass-object hack or for any
hierarchy whatso
Memeplex added the comment:
As usual, thank you for the detailed and informative answer, Eryk. I think I
understand your points but I decided to do it the way I did it because:
1. I sometimes need the array itself. For example, some of my clases contains
or inherits from a ctypes structure
Memeplex added the comment:
I have been happily using this helper function:
def c_array(*args):
if type(args[1]) is int:
ptr, size = args
return (ptr._type_ * size).from_address(ct.addressof(ptr.contents))
else:
c_type, buf = args
return (c_type * (len
Memeplex added the comment:
Martin: I can't reproduce the issue by just importing matplotlib with the TkAgg
backend into a vanilla python repl. I will try to isolate the problem when I
have some free time.
--
status: pending -> open
__
Memeplex added the comment:
Thank you for the tips, Paul. The issue is related to the default behavior but
it's always good to know about handy workarounds and extensibility hooks.
--
___
Python tracker
<http://bugs.python.org/is
Changes by Memeplex :
--
type: -> enhancement
___
Python tracker
<http://bugs.python.org/issue27303>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Memeplex:
Currently when you specify more than one name for an option (typically short
and long versions) each name is listed with its entire arg list. This is
annoying for options taking many args or choices, for example:
--type {html,pdf,github,blogger}, -t {html,pdf
Memeplex added the comment:
Martin, there were two reasons:
1. Conciseness: addressof(p.contents) vs. p.value.
2. Uniformity: I expect the value of a pointer to be the address it points to.
Then Eryk pointed out that p.value has already another meaning for simple
pointer types, so (2) can
Memeplex added the comment:
> The first argument can be any type accepted by c_void_p.from_param, such as a
> ctypes pointer/array, str, bytes, or an integer address.
Now I see why you suggested ptr.as_void in 26565. Both issues are very related.
Some functions are overloaded in the
Memeplex added the comment:
Thank you for the great tips, Eryk, somehow I overlooked string_at while
reading the docs.
Now, given that the address parameter of string_at is pretty overloaded,
wouldn't it be reasonable to overload from_address the same instead of
introducing from_po
Memeplex added the comment:
I would like to add some information about my use case. Many c structs have
pointers to arrays of data plus some field indicating the length of those
arrays. Sometimes I need to pickle that kind of structs and a bytes object has
to somehow be created from each
Memeplex added the comment:
Related: http://bugs.python.org/issue27274.
Maybe ptr.toaddress? As opposed to addressof(ptr). I think ptr.address might be
confusing as it's intutive meaning is closer to addressof(ptr).
--
___
Python tracker
New submission from Memeplex:
This real life example is pretty terrible:
(ct.c_float * self._nfeats).from_address(
ct.addressof(self._vals.contents))
The alternative of casting the pointer to pointer-to-array, then pick
ptr.contents is not really better.
What about a from_pointer(ptr
New submission from Memeplex:
The module documentation recommends...
More picklability
Ensure that all arguments to Process.__init__() are picklable. This means, in
particular, that bound or unbound methods cannot be used directly as the target
(unless you use the fork start method) — just
New submission from Memeplex:
In [1]: mv = memoryview(b'123')
In [2]: mv.__reduce__()
TypeError: can't pickle memoryview objects
But then:
In [3]: pickle.dumps(mv)
b'\x80\x03cbuiltins\nmemoryview\nq\x00)\x81q\x01.'
Even worse:
In [4]: pickle.loads(pickle
New submission from Memeplex:
Maybe this is just a bug in ipython but as it's closely related to
http://bugs.python.org/issue23735 I'm reporting it here too, just in case.
-- My original report to bug-readline:
using readline with ipython 4.1.2 and the TkAgg (or GTK3Agg)
b
New submission from Memeplex:
I know one can do addressof(p.contents), but it's a bit inconsistent that
c_void_p and c_char_p contain the same information in the value attribute.
--
components: ctypes
messages: 261794
nosy: memeplex
priority: normal
severity: normal
status: open
New submission from Memeplex:
The current implementation offers a stop_after parameter for run_setup() but
not for setup(). This design has some shortcomings:
1. It couples the possibility to stop setup after some phase to the fact that
the setup function resides in another file. But the
Changes by Memeplex :
--
nosy: +bethard
___
Python tracker
<http://bugs.python.org/issue26510>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Memeplex :
--
title: Add required argument to add_subparsers -> [argparse] Add required
argument to add_subparsers
___
Python tracker
<http://bugs.python.org/issu
New submission from Memeplex:
It's useful in combination with dest. Currently you have to set required as an
attribute. This is not only inconsistent but not even documented as a valid
usage (in general, it's not clear from the docs whether attribute setting -vs
argument passing-
New submission from Memeplex:
When not using a timeout, communicate will raise a BrokenPipeError if the
command returns an error code. For example:
sp = subprocess.Popen('cat --not-an-option', shell=True, stdin=subprocess.PIPE)
time.sleep(.2)
sp.communicate(b'hi\n')
This i
Memeplex added the comment:
Well it's like that since 2.1 so I guess the doc is wrong indeee.
--
___
Python tracker
<http://bugs.python.org/issue25509>
___
___
Memeplex added the comment:
Brett, I'm not sure about that, notice that the "import hook" as is mentioned
in the docs is just the current __import__ in the builtins module (which could
have been replaced and in this sense would be a "hook") but not proper import
ho
New submission from Memeplex:
The documentation (for 3.5) states that "[PyImport_ImportModule] is a
simplified interface to PyImport_ImportModuleEx()" but the current
implementation calls PyImport_Import instead, which is a higher level interface
that takes into account import ho
Memeplex added the comment:
Here is another manifestation of this problem: http://bugs.python.org/issue17050
--
___
Python tracker
<http://bugs.python.org/issue9
Memeplex added the comment:
What's missing for this patch to be applied? Can I help somehow?
--
nosy: +memeplex
___
Python tracker
<http://bugs.python.org/i
Memeplex added the comment:
One possible fix to multiprocessing/process.py:
< try:
< self.run()
< exitcode = 0
< finally:
< util._exit_function()
---
> self.run()
>
Memeplex added the comment:
http://bugs.python.org/issue24948
I posted a tentative solution there.
--
___
Python tracker
<http://bugs.python.org/issue13
New submission from Memeplex:
Related to but not the same than https://bugs.python.org/issue13812.
Try this:
```
import multiprocessing as mp
import time
def g():
time.sleep(100)
def f():
mp.Process(target=g).start()
1/0
mp.Process(target=f).start()
```
It won't sho
Changes by Memeplex :
--
versions: +Python 3.4, Python 3.5
___
Python tracker
<http://bugs.python.org/issue13812>
___
___
Python-bugs-list mailing list
Unsub
Memeplex added the comment:
I would like to reopen this issue because of the following, very related,
behavior. Try this:
```
import multiprocessing as mp
import time
def g():
time.sleep(100)
def f():
mp.Process(target=g).start()
1/0
mp.Process(target=f).start()
```
It won
Changes by Memeplex :
--
title: Must not replace LF or CR by CRLF in literals -> imaplib: must not
replace LF or CR by CRLF in literals
___
Python tracker
<http://bugs.python.org/iss
New submission from Memeplex :
For example, after that "normalization", quoted printable encoded
headers (as described at rfc 2047) longer than 76 characters are
splitted in two different ill-formed headers because the soft LF line
break becomes a "hard" CRLF one. This is
34 matches
Mail list logo