Re: Win32api problems

2019-10-22 Thread GerritM
On Tuesday, October 22, 2019 at 12:09:46 PM UTC+2, Terry Reedy wrote:
> On 10/22/2019 5:23 AM, GerritM wrote:
<...snip...>
> 
> Install 1 at a time and try your normal scripts?  Or try them with 3.7.
> 
> -- 
> Terry Jan Reedy

I am working on the Python 2 to Python 3 transition.

I found on Internet many people struggling with Win32 over the years. It served 
me without problems for decades. So, I was wondering, whether somewhere in the 
growth of modules and options a weak spot is appearing...

Gerrit
-- 
https://mail.python.org/mailman/listinfo/python-list


Win32api problems

2019-10-22 Thread GerritM
I recently installed IPython, Pandas, Altair, Jupyter, MatPlotLib, and Numpy on 
my Windows 10, Python27 installation to explore what it can do.

When I tried to run my normal scripts a few days later, I discovered that 
win32com and related modules like win32ami give problems:

Traceback (most recent call last):
  File "D:\gaudi\src\PythonTools\generateDocumentsPdf.py", line 10, in 
    from win32com.client.dynamic import Dispatch
  File "C:\Python27\lib\site-packages\win32com\__init__.py", line 5, in 
    import win32api, sys, os
ImportError: DLL load failed: The specified procedure could not be found.

after trying out several tips on Internet, like copying dll and pyd files, I 
re-installed my entire ActiveState installation. Luckily it works again.

However, question is what culprit of my initial list damaged the Python-win32 
configuration?

Gerrit
-- 
https://mail.python.org/mailman/listinfo/python-list


Python 2 EOL; what about P2 packages

2019-05-12 Thread GerritM
I had missed the End-of-Life announcement of Python 2 for 2020. When installing 
a missing package on my new laptop, pip did warn me about this upcoming event.

I have been reading up on the conversion. Unfortunately, I can find no 
information yet on coping with Python 2 only packages. So far, I identified 
that I am using at least 2 packages that are Python 2 only:
+ HTMLgen (the old original version that has been an orphan for decades; simple 
but effective)
+ eGenix (excellent package with a.o. MxDateTime; I can only find a sprint 
attempt to convert t to Python 3)

Any suggestions how to port to Python 3, when using Python 2 only packages?

Although the websites state that we can keep using Python 2 after maintenance 
stops, this may in practice not be the case. Any time that we need to get a new 
laptop operational, we need a way to install it. E.g. pip should stay working...

Gerrit
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PIL installation fails; registration problem

2015-03-01 Thread GerritM
Some more searching brought me to Pillow. That seems to work!

No answer needed anymore on previous question.


On Saturday, February 28, 2015 at 9:51:53 PM UTC+1, GerritM wrote:
 I am reinstalling everything on my new Windows 7 laptop. I run into a problem 
 when installing PIL 1.1.7, in combination with my Activestate Python 2.7.8.
 
 The PIL installer complains that no Python is registered. I did run Joakim 
 Löw's script to register Python. This results in the message *** You 
 probably have another Python installation!. Adding some code to this script 
 reveals that my Python is registered with the following values (deviating 
 from the values in the script):
 installkey: C:\Python27\
 pythonkey C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk
 
 The script proposes for pythonkey: 
 C:\Python27;C:\Python27\Lib\;C:\Python27\DLLs\
 
 Can I change the pythonkey to the value proposed by Joakim Löw's script?

-- 
https://mail.python.org/mailman/listinfo/python-list


PIL installation fails; registration problem

2015-02-28 Thread GerritM
I am reinstalling everything on my new Windows 7 laptop. I run into a problem 
when installing PIL 1.1.7, in combination with my Activestate Python 2.7.8.

The PIL installer complains that no Python is registered. I did run Joakim 
Löw's script to register Python. This results in the message *** You probably 
have another Python installation!. Adding some code to this script reveals 
that my Python is registered with the following values (deviating from the 
values in the script):
installkey: C:\Python27\
pythonkey C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk

The script proposes for pythonkey: 
C:\Python27;C:\Python27\Lib\;C:\Python27\DLLs\

Can I change the pythonkey to the value proposed by Joakim Löw's script?

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python2.6 + win32com crashes with unicode bug

2009-10-30 Thread GerritM

Terry Reedy schreef:

GerritM wrote:
I have automated image generation with Python, win32com and Visio5.0. 
This works well upto Python2.5 but fails with Python 2.6.

Short term solution is to return to 2.5 :-(.

I have reproduced the bug below with a minimum of Python lines. Below 
the problem the working example from 2.5


kind regards, Gerrit

---minimal session reproducing the bug---


..snip..

d = v.Documents.OpenEx(D:/temp/test.vsd,8)

...snip...
UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 
52: ordinal not in range(128)


I suspect that 2.6 fixed the bug of allowing non-ascii chars when using 
the ascii codec.  I would check to see if there is an 0x83 in 
D:/temp/test.vsd



...snip...
the string D:/temp/test.vsd itself does not contain any 
charactervalue128:

 for c in D:/temp/test.vsd:
print ord(c),  ,

68   58   47   116   101   109   112   47   116   101   115   116   46 
 118   115   100

(on my current Python 2.5 configuration)

The presumably binary file itself may contain any value, but I don't 
expect Python or win32com to do anything with the file content...


There are explanations on internet that Windows uses internally 2 
(incompatible) API's that cause poblems with Unicode based filenames. I 
do something like that to be the problem in Python 2.6


kind regards, Gerrit

--
http://mail.python.org/mailman/listinfo/python-list


Python2.6 + win32com crashes with unicode bug

2009-10-29 Thread GerritM
I have automated image generation with Python, win32com and Visio5.0. 
This works well upto Python2.5 but fails with Python 2.6.

Short term solution is to return to 2.5 :-(.

I have reproduced the bug below with a minimum of Python lines. Below 
the problem the working example from 2.5


kind regards, Gerrit

---minimal session reproducing the bug---

Python 2.6.3 (r263:75183, Oct  5 2009, 14:41:55) [MSC v.1500 32 bit 
(Intel)] on win32

Type copyright, credits or license() for more information.


Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface.  This connection is not visible on any external
interface and no data is sent to or received from the Internet.


IDLE 2.6.3
 from win32com.client.dynamic import Dispatch
 v = Dispatch(Visio.Application)
 d = v.Documents.OpenEx(D:/temp/test.vsd,8)

Traceback (most recent call last):
  File pyshell#2, line 1, in module
d = v.Documents.OpenEx(D:/temp/test.vsd,8)
  File C:\Python26\lib\site-packages\win32com\client\dynamic.py, line 
467, in __getattr__
if self._olerepr_.mapFuncs.has_key(attr): return 
self._make_method_(attr)
  File C:\Python26\lib\site-packages\win32com\client\dynamic.py, line 
295, in _make_method_
methodCodeList = 
self._olerepr_.MakeFuncMethod(self._olerepr_.mapFuncs[name], methodName,0)
  File C:\Python26\lib\site-packages\win32com\client\build.py, line 
297, in MakeFuncMethod

return self.MakeDispatchFuncMethod(entry, name, bMakeClass)
  File C:\Python26\lib\site-packages\win32com\client\build.py, line 
318, in MakeDispatchFuncMethod
s = linePrefix + 'def ' + name + '(self' + BuildCallList(fdesc, 
names, defNamedOptArg, defNamedNotOptArg, defUnnamedArg, defOutArg) + '):'
  File C:\Python26\lib\site-packages\win32com\client\build.py, line 
604, in BuildCallList

argName = MakePublicAttributeName(argName)
  File C:\Python26\lib\site-packages\win32com\client\build.py, line 
542, in MakePublicAttributeName

return filter( lambda char: char in valid_identifier_chars, className)
  File C:\Python26\lib\site-packages\win32com\client\build.py, line 
542, in lambda

return filter( lambda char: char in valid_identifier_chars, className)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 52: 
ordinal not in range(128)



---no problem with 2.5---
Python 2.5 (r25:51908, Mar  9 2007, 17:40:28) [MSC v.1310 32 bit 
(Intel)] on win32

Type copyright, credits or license() for more information.


Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface.  This connection is not visible on any external
interface and no data is sent to or received from the Internet.


IDLE 1.2
 from win32com.client.dynamic import Dispatch
 v = Dispatch(Visio.Application)
 d = v.Documents.OpenEx(D:/temp/test.vsd,8)


---configuration data---
Windows XP SP3
ASUS 1106HA (11.6 EEE PC)
Visio 5.0
--
http://mail.python.org/mailman/listinfo/python-list