Change by Thomas Heller :
--
nosy: -theller
___
Python tracker
<https://bugs.python.org/issue20899>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Thomas Heller <thel...@ctypes.org>:
ctypes Structure fields of type c_char_p or c_wchar_p used to accept strings
with embedded null characters. I noticed that Python 3.6.4 does refuse them.
It seems this has been changed in recent version(s).
There ARE use
Changes by Thomas Heller <thel...@ctypes.org>:
--
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29294>
___
_
Thomas Heller added the comment:
Yes, seems that it is fixed in the repository. So I have to use 2.7.12
or wait for 2.7.14. Thanks!
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
New submission from Thomas Heller:
ctypes.windll.LoadLibrary refuses unicode argument; this is a regression in
Python 2.7.13:
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or
Thomas Heller added the comment:
Thanks Martin and eryk for correcting me and finding the real cause of
the problem.
Am 21.12.2016 um 13:04 schrieb eryk sun:
> ... the private names _COORD, _FILETIME, _LARGE_INTEGER,
> _POINTL, _RECTL, _SMALL_RECT, and _ULARGE_INTEGER are skipped by a
New submission from Thomas Heller:
The documentation states that 'from module import *' imports all symbols that
are listed in the module's __all__ list.
In Python 3, unlike Python 2, only symbols that do NOT start with an underscore
are actually imported.
The following code works in Python
Changes by Thomas Heller <thel...@ctypes.org>:
--
nosy: +theller
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26137>
___
__
Changes by Thomas Heller <thel...@ctypes.org>:
--
nosy: +theller
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27417>
___
__
Changes by Thomas Heller thel...@ctypes.org:
--
nosy: +theller
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20899
___
___
Python-bugs-list
Thomas Heller added the comment:
As for progress, the answer is no as the hope is to eventually replace
zipimport with something in pure Python thanks to importlib.
Does this mean there is no chance to put this into 3.4 and 3.3, do we really
have to wait until 3.5 with it's pure-python
Thomas Heller added the comment:
When you say os.path.isdir(...) works fine, you mean it's returning False?
As shown in the original report
(http://bugs.python.org/issue21516#msg218664)
os.path.isdir() returns True; which is correct since c:\Users\admin is a
directory on my machine
New submission from Thomas Heller:
On Windows, pathlib.Path(...).is_dir() crashes on readonly directories while
os.path.isdir(...) works fine. Example on Windows7:
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:24:06) [MSC v.1600 32 bit
(Intel)] on win32
Type help, copyright, credits
Thomas Heller added the comment:
Well, not 'readonly' directories but directories where the user has no access
rights. I corrected the title of this bug.
--
title: pathlib.Path(...).is_dir() crashes on readonly directories (Windows) -
pathlib.Path(...).is_dir() crashes on some
Thomas Heller added the comment:
My usecase is: I create kind of bound methods with functools.partial.
Apologies for the confusion by using the word 'equivalent'; what I mean is that
partial instances should (IMO) compare equal when they contain the same
function and args/keywords which
Changes by Thomas Heller thel...@ctypes.org:
--
nosy: +theller
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21157
___
___
Python-bugs-list
New submission from Thomas Heller:
I think that 'equivalent' functools.partial objects should compare equal, so
the following snippet SHOULD print True:
import functools
f = lambda x: x
a = functools.partial(f, 42)
b = functools.partial(f, 42)
a == b
False
--
components: Library
Thomas Heller added the comment:
Sure. I'm not sure 'equivalent' is the word I should have used.
I suggest (and I would have expected) that partial instances (a, b) should
compare equal when
a.func == b.func \
and a.args == b.args \
and a.keywords == b.keywords
New submission from Thomas Heller:
With python 3.4 and pywin32 version 218 it is only possible
to import win32com or win32api when pywintypes has been imported before.
Here is part of a session with 'python -v':
import win32api
Traceback (most recent call last):
File stdin, line 1
Thomas Heller added the comment:
It was most certainly an issue on my side, something with leftover files or
directories from a previous installation. After cleaning everything up it
works now. Sorry for the confusion.
(A personal remark: sometimes, the bdist_wininst uninstaller does
Thomas Heller added the comment:
Hm, what's the problem?
For me, the patch applies cleanly (in Python 3.4.0b3, 32-bit and 64-bit on
Windows), and
py -3.4(-32) -m pip install numpy
works correctly. At least
py -3.4(-32) -c import numpy; print(numpy.__version__)
prints 1.8.0
Changes by Thomas Heller thel...@ctypes.org:
--
nosy: +theller
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17633
___
___
Python-bugs-list
New submission from Thomas Heller:
The windows python launcher supports the '-3.3' resp. '-3.3-32' command line
switches to ask for 'the best 3.3' version resp. 'the 32-bit 3.3' version, but
does not support a '-3.3-64' switch to explicitely request the 64-bit version
of Python.
I suggest
Thomas Heller added the comment:
I have written a new modulefinder based on importlib. It is not a refactoring
of the old one, so it is no plug-in replacement. Instead it has some new
features:
- Better logging output
- collects dependencies (self._depgraph maps module names to callers
New submission from Thomas Heller:
(As requested by email in python-dev I'm reporting this problem)
Some function prototypes in the stable ABI have been changed between Python 3.3
and 3.4.
PyObject_CallFunction is an example, the second parameter has been changed from
'char *' to 'const char
Changes by Thomas Heller thel...@ctypes.org:
--
nosy: +theller
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18986
___
___
Python-bugs-list
Thomas Heller added the comment:
I suggest to remove the comment part from the patch and then apply it.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18852
New submission from Thomas Heller:
In site.py, line 477, I find this code:
# Reading the initialization (config) file may not be enough to set a
# completion key, so we set one first and then read the file
if 'libedit' in getattr(readline, '__doc__
Changes by Thomas Heller thel...@ctypes.org:
--
nosy: +theller
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15767
___
___
Python-bugs-list
Thomas Heller added the comment:
Brett, can these changes be merged into 3.3 also?
--
nosy: +theller
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18058
Thomas Heller added the comment:
The modulefinder usage is directly exposed in its API as the return
value of a find_module method, which makes removal a pain. Adding
Thomas Heller to see what he has to say.
Some months ago, I have started to implement a brand-new modulefinder,
which
New submission from Thomas Heller:
Typo: trucate instead of truncate
--
assignee: docs@python
components: Documentation
files: work.patch
keywords: patch
messages: 185901
nosy: docs@python, theller
priority: normal
severity: normal
status: open
title: Typo in Doc/whatsnew/3.3.rst
Added
Thomas Heller added the comment:
Patch looks good. Please apply.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17378
___
___
Python-bugs-list
Thomas Heller added the comment:
I have only tried my code with 3.4; but still get problems with the modules
'builtins' and '_frozenimportlib'.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17098
Thomas Heller added the comment:
I confirm that the bug is fixed, my test-code works now (a modulefinder using
importlib instead of imp to find modules).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17098
Thomas Heller added the comment:
Thanks for the very fast fix Brett :-)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17098
___
___
Python-bugs
Thomas Heller added the comment:
Hope it is ok to assign this to you, vinay.
--
assignee: - vinay.sajip
nosy: +vinay.sajip
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17028
New submission from Thomas Heller:
The python launcher does not parse the shebang if arguments for the Python
interpreter are given on the command line. For example:
py.exe test.py # uses shebang line
py.exe -u test.py # does NOT use shebang line
The attached patch fixes
Changes by Thomas Heller thel...@ctypes.org:
--
title: launcher - launcher does not read shebang line when arguments are given
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17028
New submission from Thomas Heller:
It seems the statement
import importlib
is missing in 3.3's modulefinder.py
--
components: Library (Lib)
messages: 177951
nosy: theller
priority: normal
severity: normal
status: open
title: Missing import in modulefinder.py
versions: Python 3.3
New submission from Thomas Heller thel...@ctypes.org:
When a ctypes Structure uses a subclass of c_int, c_short, c_byte in the
_fields_ list to define bitfields, the results are wrong.
The attached script showbug.py demonstrates this behaviour.
--
components: ctypes
files: showbug.py
Thomas Heller thel...@ctypes.org added the comment:
The attached patch for branch default fixes this issue. It also contains a
unittest.
--
Added file: http://bugs.python.org/file26530/bitfields.patch
___
Python tracker rep...@bugs.python.org
http
Thomas Heller thel...@ctypes.org added the comment:
The rationale was to allow different packages (for example) in the same process
to have their own private instance of a foreign function, with possibly
different definitions of restype, argtypes and/or errcheck
ctypes has _always_ catched exceptions raised in function calls.
On Windows ;-).
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Thomas Heller thel...@ctypes.org added the comment:
Thomas, it seems this change doesn't work for py3k. Buildbots complain and my
working copy does as well.
Example:
http://www.python.org/dev/buildbot/all/builders/x86%20gentoo%203.1/builds/990
I do not know why this happens. It works
Thomas Heller thel...@ctypes.org added the comment:
issue5504-py27-2.patch is the updated patch that now also works on Windows.
--
Added file: http://bugs.python.org/file18439/issue5504-py27-2.patch
___
Python tracker rep...@bugs.python.org
http
Thomas Heller thel...@ctypes.org added the comment:
Fixed in rev 83836 (release27-maint branch) and rev. 83837 (py3k branch).
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5504
Thomas Heller thel...@ctypes.org added the comment:
Fixed in rev 83841 (py3k), rev 83842 (release31-maint), and rev 83843
(release27-maint).
Thanks for the patch.
--
resolution: - fixed
status: open - closed
___
Python tracker rep
Thomas Heller thel...@ctypes.org added the comment:
The libffi library included with Python has been updated in the meantime, so
most of the issue5504-linux.patch is unneeded now.
Here is a new patch, issue5504-py27.patch, against the current release27-maint
branch. Seems it is exactly
Thomas Heller thel...@ctypes.org added the comment:
To test windows callbacks, I suggest to use EnumResourceTypes()
instead, which is more likely to work in any condition:
Unfortunately the proposed test doesn't detect the problem in Python2.7 rc1.
It runs without crashing, even
Thomas Heller thel...@ctypes.org added the comment:
Fixed in rev. 82127 (trunk) and rev 82138 (py3k).
Added test for the issues reported here so that it doen't happen again.
--
resolution: - fixed
status: open - closed
___
Python tracker rep
Thomas Heller thel...@ctypes.org added the comment:
Thanks, Michael, for reporting this issue.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8959
Thomas Heller thel...@ctypes.org added the comment:
Is r80761 something that can be safely reverted?
Yes, I think so.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8959
Thomas Heller thel...@ctypes.org added the comment:
The commit that breaks the examples is revision 80761.
Tested on WinXP 32 bit.
Someone should test on Win 64bit too ;-).
--
priority: normal - release blocker
___
Python tracker rep
Thomas Heller thel...@ctypes.org added the comment:
I'm not sure this issue is really done. The current state works fine, but
there is one problem remaining:
There are Python extensions that seem to need a manifest pointing to the MSVC
runtime libs: dlls that start in-process com servers
Thomas Heller thel...@ctypes.org added the comment:
Martin, you should probably post your patch to upstream libffi.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8314
Thomas Heller thel...@ctypes.org added the comment:
It appears to me that no-one is maintaining this separate ctypes
code-base anymore so I'll have to ditch dependencies that use it
(Shapely) unfortunately.
This is correct, the separate ctypes code base is linked via svn:external
Thomas Heller thel...@ctypes.org added the comment:
We should revert the following chunk for configure.ac to generate the
Makefile's again, so that we are able to run the testsuite at least with
dejagnu:
-AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile
man
Thomas Heller thel...@ctypes.org added the comment:
done, and updated the patch for the merge from the trunk.
--
Added file: http://bugs.python.org/file16590/libffi-update3.diff
This patch passes the ctypes tests and libffi testsuite on this system:
Linux tubu64 2.6.24-27
Thomas Heller thel...@ctypes.org added the comment:
the ports which are maintained separately still need an update:
libffi_msvc
libffi trunk now has a port to x86/msvc. might require some
extra updates from libffi.
I'll take care of this one.
Would it be a good idea to upgrade
Thomas Heller thel...@ctypes.org added the comment:
Thomas,
Do you remember why your patch for issue1039 was not backported?
Probably an oversight only.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8154
Thomas Heller thel...@ctypes.org added the comment:
Code duplication is unavoidable because the goal is to give access to
machine arithmetics which means (# types) x (# operations) of very
similar looking functions. I considered reducing (perceived) code
duplication through some pre
Thomas Heller thel...@ctypes.org added the comment:
CThunkObject is not registered correctly with the cycle GC. The attached
patch, against trunk, fixes the issue.
--
keywords: +patch
Added file: http://bugs.python.org/file16345/issue7957.patch
New submission from Thomas Heller thel...@ctypes.org:
This little script 'ctypes-leak.py' leaks memory:
import gc
from ctypes import *
PROTO = WINFUNCTYPE(None)
class Test(object):
def func(self):
pass
def __init__(self):
self.v = PROTO(self.func)
while 1:
try
Thomas Heller thel...@ctypes.org added the comment:
I'm curious: Which output do you get from:
'LANG=C /sbin/ldconfig -p | fgrep GL'
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7356
Thomas Heller thel...@ctypes.org added the comment:
I assume the patch is fine, would you like to apply it? Thanks.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7356
Thomas Heller thel...@ctypes.org added the comment:
I retract this request. It seems the idea is not liked or a solution is
not easy.
(The solution I now use is to start Python from a batch file that parses
some command line flags itself, sets environment variables, and my
sitecustomize.py
Thomas Heller thel...@ctypes.org added the comment:
Jean-Paul Calderone:
How about putting this into the logging module instead? Instead of
python logging options program program options, making it
python -m logging logging options program program options.
This:
* involves
Thomas Heller thel...@ctypes.org added the comment:
How do these global settings (either via the interpreter or a wrapper
in the logging module) change what an app might do on its own? IOW, if
my app is already written to configure logging, and someone invokes it
with these other settings
New submission from Thomas Heller thel...@ctypes.org:
I want the Python executable to have command line flags which allow
simple configuration of the logging module. Use cases are to run
applications/scripts (which use libraries that use logging calls) with
different logging output without
Thomas Heller thel...@ctypes.org added the comment:
I get the idea. The Python part of the patch demonstrates what you're
getting at, though it can't be used as is - for example the
getattr(logging, a, a) could lead to problems. However a more
intelligent parser (which looked for specific
Thomas Heller thel...@ctypes.org added the comment:
Why does this need to be built into the interpreter? The script / app
should have logging config support.
It does not need to, but it would be nice.
I think the '-l' flag should be similar to the -W flag.
Or consider for example using
Thomas Heller thel...@ctypes.org added the comment:
This one is fixed, isn't it?
See for example the buildbot output at
http://www.python.org/dev/buildbot/2.6/builders/x86%20osx.5%202.6/builds/566/steps/compile/logs/stdio
(Search for building '_ctypes' extension on the page)
--
nosy
Thomas Heller thel...@ctypes.org added the comment:
Is that any help?
Not really ;-).
Here is a patch I just wrote - it must still be checked for correctness,
and tests for it must be added. I hope the comment in the code explains
how it works. ctypes-structinit.patch
--
keywords
Thomas Heller thel...@ctypes.org added the comment:
I've commited a slightly changed patch plus a test.
trunk: 74917, py3k: 74918, release26-maint: 74919, release31-maint: 74920.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Changes by Thomas Heller thel...@ctypes.org:
--
resolution: - fixed
status: open - closed
versions: -Python 2.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5042
Thomas Heller thel...@ctypes.org added the comment:
Comitted as
trunk: 74921, py3k: 74922, release31-maint: 74923, release26-maint: 74924
--
resolution: accepted - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http
Thomas Heller thel...@ctypes.org added the comment:
I guess this is a bug in your code, as mentioned in my last comment, so
closing as invalid.
--
resolution: - invalid
status: open - closed
___
Python tracker rep...@bugs.python.org
http
Thomas Heller thel...@ctypes.org added the comment:
Find where c_size_t is defined: in Lib/ctypes/__init__.py
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6729
Thomas Heller thel...@ctypes.org added the comment:
Since ctypes should stay compatible with Python versions down to 2.4, a
with block cannot be used.
Of course would closing the object returned by os.popen() explicitely be
better style, but I wonder what the real problem is. My observations
Thomas Heller thel...@ctypes.org added the comment:
Would you like to work on a patch?
--
versions: +Python 2.7, Python 3.0, Python 3.1, Python 3.2 -Python 2.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6729
Thomas Heller thel...@ctypes.org added the comment:
The py3k version of the file already contains 3.x only code, and it's
missing the comment at the top that it should be compatible. But it's
not really a big deal to me.
Yes, I had deleted the comment since the 3.x code cannot be compatible
Changes by Thomas Heller thel...@ctypes.org:
--
assignee: theller - eric.smith
resolution: - accepted
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6882
Changes by Thomas Heller thel...@ctypes.org:
--
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 3.0
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5042
Thomas Heller thel...@ctypes.org added the comment:
The problem is the implementation of the current __init__ method, in
Modules/_ctypes/_ctypes.c, line 4024. Rewritten in Python, and slightly
simplified it looks like this:
def __init__(self, *args, **kw):
The current BUGGY
Thomas Heller thel...@ctypes.org added the comment:
Commited as svn rev 74664 (py3k) and rev 74665 (release31-maint).
--
stage: needs patch - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Thomas Heller thel...@ctypes.org added the comment:
This is on purpose.
The idea is that the function call returns an existing pointer to an
existing object, so __init__ (or __new__, IIRC) is never called in this
case.
--
resolution: - invalid
status: open - closed
Thomas Heller thel...@ctypes.org added the comment:
I agree that the C type 'char' is a byte, not a character. So Python3
should creates a Python bytes object for the ctypes c_char_p type.
Since Python 3.1 is out, is it too late to change it in the 3.x branch?
:-) Maybe for Python 3.2?
I
Thomas Heller thel...@ctypes.org added the comment:
I have no time to figure out what the attached script is supposed to do.
Please provide a standalone test-script and describe exactly how it
should be used to reproduce the bug.
However, I guess the problem is that the signature
Thomas Heller thel...@ctypes.org added the comment:
Andrew McNabb schrieb:
I just looked at ConvParam in a little more detail, and it seems that
the problem is caused because setting pa-value.i to 0 only works for
the lower-order bits. Apparently the higher order bits in pa-value are
non
Thomas Heller thel...@ctypes.org added the comment:
Python 3.0 is dead ;-).
--
versions: -Python 3.0
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4606
Thomas Heller thel...@ctypes.org added the comment:
Here's a patch.
--
keywords: +patch
Added file: http://bugs.python.org/file14615/c_char_p.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6239
Thomas Heller thel...@ctypes.org added the comment:
Thanks for bringing my attention to this problem again, and for the review.
Andrew McNabb schrieb:
I looked at the attached patch, and it seems to me the only alternative
approach would be to use PyLong_FromLong instead of PyInt_FromLong
Thomas Heller thel...@ctypes.org added the comment:
Here's a corrected patch against svn trunk.
--
Added file: http://bugs.python.org/file14608/patch-ctypes-none-arg-2.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4606
Thomas Heller thel...@ctypes.org added the comment:
One of the new tests in r74134 is failing on my box (Gentoo x86), and on
a number of the buildbots:
I've seen that, but do not yet have a patch.
--
title: Can not set value for structure members larger than 32 bits - Can not
set
Thomas Heller thel...@ctypes.org added the comment:
ctypes_workaround_2.patch from ocean-city seems to fix it so I'll apply
that.
--
title: Can not set value for structure members larger than 32 bits - Can not
set value for structure members larger than 32 bits
New submission from Thomas Heller thel...@ctypes.org:
This patch implements some pointer arithmetic operations for ctypes.
--
files: ctypes-pointerarith.patch
keywords: patch
messages: 89225
nosy: theller
severity: normal
status: open
title: ctypes pointer arithmetic
type: behavior
Changes by Thomas Heller thel...@ctypes.org:
--
assignee: - theller
components: +ctypes
versions: +Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6259
Changes by Thomas Heller thel...@ctypes.org:
--
assignee: theller -
components: -ctypes
nosy: -theller
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6121
New submission from Thomas Heller thel...@ctypes.org:
The json package is a lot slower than the simplejson package. Both
packages have their C compiled speedup module; however:
C:\py26 -m timeit -s from json import dumps, loads
loads(dumps(range(32)))
1000 loops, best of 3: 618 usec per
1 - 100 of 344 matches
Mail list logo