From mehmet.hamit93 at gmail.com Mon Jun 1 04:56:54 2020 From: mehmet.hamit93 at gmail.com (Mehmet Hamit) Date: Mon, 1 Jun 2020 09:56:54 +0100 Subject: [python-win32] Python 3.8.2 Msi Install Message-ID: Hi, Just wondering if there is a msi install or detailed instructions on how to create this package? Slightly new to Python myself but the install is required for deployment on roughly 300 machines Mehmet -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhammond at skippinet.com.au Sat Jun 13 02:13:08 2020 From: mhammond at skippinet.com.au (Mark Hammond) Date: Sat, 13 Jun 2020 16:13:08 +1000 Subject: [python-win32] [ANN] pywin32 build 228 released Message-ID: Hi all, I'm happy to announce the release of pywin32 build 228. If all goes well, this release will be the last release that supports Python 2! If no significant issues are reported in the Python 2 builds of this release, I'll be removing all support for Python 2 from the repository, convert all .py files to Python 3 syntax, etc. Downloads are available at: https://github.com/mhammond/pywin32/releases/tag/b228 and via pypi. For initial support (eg, to ask questions about the release etc), please contact this mailing-list (python-win32 at python.org). If you want to report a bug, please do so at https://github.com/mhammond/pywin32/issues As always, thanks to everyone who contributed to this release, both in terms of code and reporting bugs. Cheers, Mark. Changes: * Support for for win32evtlog.EvtFormatMessage and EvtCreateRenderContext (#1308) * Support more elements in the SECURITY_LOGON_SESSION_DATA struct returned by win32security.LsaGetLogonSession (#1515) * Remove trailing \0 char from win32file.FindFileNames results (#1511) * Added win32process.ReadProcessMemory/WriteProcessMemory (#1502) * Added win32process.VirtualAllocEx/VirtualFreeEx (#1509) * Added win32gui.ValidateRect (#1504) * Adodbapi corrected and updated to version 2.6.2. With this change the pywin32 repo will become the definitive source code for adodbapi, so files should never be missing again. Includes bug fix for 'named' paramstyle SF#28. * Added a __repr__ implementation for PySecBufferDesc and PySecBuffer. * Fix bug when trying to free a PySecBuffer object when the buffer was not allocated by the caller. This can occur when decrypting a message with a SECBUFFER_STREAM and SECBUFFER_DATA buffer when calling DecryptMessage(). From vernondcole at gmail.com Thu Jun 18 14:07:37 2020 From: vernondcole at gmail.com (Vernon D. Cole) Date: Thu, 18 Jun 2020 12:07:37 -0600 Subject: [python-win32] Very unimportant bug report. Message-ID: I am testing the installation of our newest version 228 of pywin32. When attempting to install pywidn32 on the 32-bit version of Python 3.8 on *Windows 7 *32 bit, I get the following error: "The procedure entry point ucrtbase.terminate could not be located in the dynamic link library api-ms-win-crt-runtime-l1-1-0.dll." If anyone loses any sleep over this particular problem, I will say that they are delusional. The very idea that anything works at all on this old platform is amazing. The installation of pywin32 was at least partially successful, as I was able to run a rudimentary test of adodbapi. The Python 2.7 installation was clean and appears to work. Since 2.7 applications are much more likely targets, I would say that our bases are covered pretty well. My real reason for this posting is actually to say: "well done, team!" -- Vernon Cole -------------- next part -------------- An HTML attachment was scrubbed... URL: From eryksun at gmail.com Thu Jun 18 17:25:50 2020 From: eryksun at gmail.com (Eryk Sun) Date: Thu, 18 Jun 2020 16:25:50 -0500 Subject: [python-win32] Very unimportant bug report. In-Reply-To: References: Message-ID: On 6/18/20, Vernon D. Cole wrote: > I am testing the installation of our newest version 228 of pywin32. > > When attempting to install pywidn32 on the 32-bit version of Python > 3.8 on *Windows 7 *32 bit, I get the following error: "The procedure > entry point ucrtbase.terminate could not be located in the dynamic > link library api-ms-win-crt-runtime-l1-1-0.dll." Python 3.8 officially supports Windows 7, but the OS has to be kept updated (e.g. KB2533623 is required for new loader flags and AddDllDirectory). I'd check optional Windows updates for a C runtime update. If that doesn't fix the problem, an issue should probably be opened -- at least for tracking. From andrei_r_o at yahoo.co.uk Fri Jun 19 02:05:15 2020 From: andrei_r_o at yahoo.co.uk (andrei andrei) Date: Fri, 19 Jun 2020 06:05:15 +0000 (UTC) Subject: [python-win32] pywin32 has different behavior when running from * .exe or * .py References: <1221686004.1079777.1592546715776.ref@mail.yahoo.com> Message-ID: <1221686004.1079777.1592546715776@mail.yahoo.com> I have a Python project developed by a colleague, in which pywin32??is used to control the application: CANoe from Vector. When he is running the *.py script from PyCharm (2019.2.5) everything is ok, if he used auto-py-to-exe to convert the python script to *.exe, and then he executes the *.exe everything is ok, in both cases the script is working perfectly fine. Now the problem is the following: if I'm trying to run the *.py script from PyCharm (2020.1.2) the module pywin32?is throwing an exception: raise AttributeError("'%s' object has no attribute '%s'" % (repr(self), attr))AttributeError: '' object has no attribute 'TestModules' >From what I checked the COM Library has 2 dispinterface: ITestEnvironment and ITestEnvironment2, and only ITestEnvironment2 has the attribute TestModules, and it seems that in my case somehow the script is not considering the correct interface. If I use auto-py-to-exe to convert the python script to *.exe, and then execute the *.exe, everything works perfectly fine. If he converts the script to *.exe and then I run it on my PC, or I convert locally the script to *.exe and run it on my PC, in both cases the output of the script is the same. I tried: - Install the same PyCharm version as he uses- Run the code from Visual Studio 2017- Update pywin32 to latest version (228) in all the cases the result is the same. I'm using the same Python version as he uses: Py 3.6.7. Dose anyone know why pywin32?has different behavior when running from * .exe or * .py, and also why it has different behavior on different PCs ? Have a nice day,Andrei -------------- next part -------------- An HTML attachment was scrubbed... URL: From lepto.python at gmail.com Sat Jun 27 00:30:05 2020 From: lepto.python at gmail.com (oyster) Date: Sat, 27 Jun 2020 12:30:05 +0800 Subject: [python-win32] can't read WORD document's header correctly Message-ID: Hi, all p.s. The script and test.docx can be found on https://github.com/retsyo/read_word_header_win32com . I have a [`DOCX` file](https://github.com/retsyo/read_word_header_win32com), which has the following info | | pages of section | header | | ---------- | ------------------ | ------------------------------------------------- | | section 1 | 1 | None | | section 2 | 2 | Abstract. current page ??, total IV pages | | section 3 | 5 | paper body, current page ??, total 35 pages | Then if the line `oSec.Headers(1).Range.Fields.Update` is used in the following `VBA` code, the corrected header text will be shown by calling `displayHeader` ```vb Function myTrim(s) a = Replace(s, vbLf, "") myTrim = Trim(a) End Function Sub displayHeader() idx = 1 For Each oSec In ActiveDocument.Sections oSec.Headers(1).Range.Fields.Update 'this line must be called MsgBox "sec " & idx & " " & myTrim(oSec.Headers(1).Range.Text) idx = idx + 1 Next End Sub ``` Then I coined the `Python` version, as we all know it looks like the original `VBA` one ```python import win32com from win32com.client import Dispatch, constants #~ word = win32com.client.Dispatch('Word.Application') word = win32com.client.gencache.EnsureDispatch('Word.Application') word.Visible = 1 word.DisplayAlerts = 0 word.Documents.Open('r:/test.docx') for idx, oSec in enumerate(word.ActiveDocument.Sections): #~ oSec.Headers(1).Range.Fields.Update() print(f'sec {idx+1}', oSec.Headers(1).Range.Text.strip()) word.Documents.Close(constants.wdDoNotSaveChanges) word.Quit() ``` However, the `Python` code does not give the same corrected header text no matter I use `Dispatch('Word.Application')` or `gencache.EnsureDispatch('Word.Application') `, and no matter I use `Range.Fields.Update()` or not. You can read a much well-presented version on https://github.com/retsyo/read_word_header_win32com, but in one word, I can't get the expected result with any of the 4 different approaches. So, what is the problem, and how to fix it? Thank you in advance. From mark_haddad at outlook.com Sat Jun 27 14:16:36 2020 From: mark_haddad at outlook.com (mark haddad) Date: Sat, 27 Jun 2020 18:16:36 +0000 Subject: [python-win32] Script folder empty Message-ID: Hello, Matthew Dixon Cowles told me to contact this so u can help me with my problem, I removed everything that is python from my pc.. Downloaded the version 3.8.3 amd64 bit .exe. Suddenly there is no Script folder in my python path .. I did install it as recommended at C:/Users/UserAppdata/local/programs/python38 There should be a 5.exe files but they are missing.. I?ve tried like everything: Py ?version : to check my python first. Py -m pip : No module named pip I?ve tried also this: python -m ensurepip: but this error keep occurring: Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\ensurepip\__main__.py", line 5, in sys.exit(ensurepip._main()) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\ensurepip\__init__.py", line 210, in _main return _bootstrap( File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\ensurepip\__init__.py", line 129, in _bootstrap return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\ensurepip\__init__.py", line 32, in _run_pip runpy.run_module("pip", run_name="__main__", alter_sys=True) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 207, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\user\AppData\Local\Temp\tmpz28pjijd\pip-19.2.3-py2.py3-none-any.whl\pip\__main__.py", line 16, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "C:\Users\user\AppData\Local\Temp\tmpz28pjijd\pip-19.2.3-py2.py3-none-any.whl\pip\_internal\__init__.py", line 40, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "C:\Users\user\AppData\Local\Temp\tmpz28pjijd\pip-19.2.3-py2.py3-none-any.whl\pip\_internal\cli\autocompletion.py", line 8, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "C:\Users\user\AppData\Local\Temp\tmpz28pjijd\pip-19.2.3-py2.py3-none-any.whl\pip\_internal\cli\main_parser.py", line 11, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "C:\Users\user\AppData\Local\Temp\tmpz28pjijd\pip-19.2.3-py2.py3-none-any.whl\pip\_internal\commands\__init__.py", line 6, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "C:\Users\user\AppData\Local\Temp\tmpz28pjijd\pip-19.2.3-py2.py3-none-any.whl\pip\_internal\commands\completion.py", line 6, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "C:\Users\user\AppData\Local\Temp\tmpz28pjijd\pip-19.2.3-py2.py3-none-any.whl\pip\_internal\cli\base_command.py", line 21, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "C:\Users\user\AppData\Local\Temp\tmpz28pjijd\pip-19.2.3-py2.py3-none-any.whl\pip\_internal\download.py", line 14, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "C:\Users\user\AppData\Local\Temp\tmpz28pjijd\pip-19.2.3-py2.py3-none-any.whl\pip\_vendor\requests\__init__.py", line 114, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "C:\Users\user\AppData\Local\Temp\tmpz28pjijd\pip-19.2.3-py2.py3-none-any.whl\pip\_vendor\requests\utils.py", line 26, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "C:\Users\user\AppData\Local\Temp\tmpz28pjijd\pip-19.2.3-py2.py3-none-any.whl\pip\_vendor\requests\_internal_utils.py", line 11, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "C:\Users\user\AppData\Local\Temp\tmpz28pjijd\pip-19.2.3-py2.py3-none-any.whl\pip\_vendor\requests\compat.py", line 64, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 779, in exec_module File "", line 915, in get_code File "", line 973, in get_data OSError: [Errno 9] Bad file descriptor I?ve tried to download a get-pip.py And used py get-pip.py and also same error as the above Any more suggestions to try or should I stop python and start php or something else ?? Regards, Mark Sent from Mail for Windows 10 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tranv94 at gmail.com Sun Jun 28 16:07:19 2020 From: tranv94 at gmail.com (Vinh tran) Date: Sun, 28 Jun 2020 13:07:19 -0700 Subject: [python-win32] Using pywin32 via a remote SSH shell with COM objects Message-ID: <73E84ED0-A02D-407B-92F5-0CD8A33DE464@gmail.com> Hi, I?m currently SSH?ing into a windows machine to run a python script to call `win32com.client.GetActiveObject`. This command works successfully locally but via a remote SSH terminal it does not. I have tried opening the application with and without ?Run as Administrator? and trying the same function call and neither work. Any ideas?