windowserror

Disabling Windows error reporting (Dr. Watson) for my process

孤街浪徒 提交于 2019-12-05 01:58:08
I have an application that is hosting some unstable third-party code which I can't control in an external process to protect my main application from nasty errors it exhibits. My parent process is monitoring the other process and doing "the right thing (tm)" when it fails. The problem that I have is that Dr. Watson is still detecting crashes in the isolated process and attaching to the processes on the way down to take a crash dump. This has the two problems of: 1. Dramatically slowing down the time that it takes for me to detect a failure because the process stays alive while the crash dump

WinError 10060 A connection attempt failed because the connected party did not properly respond

▼魔方 西西 提交于 2019-12-04 19:56:14
I am trying to verify emails by sending requests to SMTP servers. When I test in Linux, it works for 90% of emails. When I test in Windows, I did some analysis and like for 79% of emails will show the WinError10060 problem. I tried using VPN, proxies and even turning off the firewall but the same problem will appear: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond Could this be from the firewall in the router or the internet provider blocking

How to workaround Python “WindowsError messages are not properly encoded” problem?

删除回忆录丶 提交于 2019-12-04 03:50:01
问题 It's a trouble when Python raised a WindowsError, the encoding of message of the exception is always os-native-encoded. For example: import os os.remove('does_not_exist.file') Well, here we get an exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> WindowsError: [Error 2] 系統找不到指定的檔案。: 'does_not_exist.file' As the language of my Windows7 is Traditional Chinese, the default error message I get is in big5 encoding (as know as CP950). >>> try: ... os.remove('abc.file

os.system to invoke an exe which lies in a dir whose name contains whitespace

人走茶凉 提交于 2019-12-03 20:44:46
问题 simply my code is as follows: file = 'C:\\Exe\\First Version\\filename.exe' os.system(file) when I run this program, windowserror is raised, can't find the file specified. I found out the problem has to with the whitespace between "First Version". So Could I find a way circumventing the problem? PS: what if the variable 'file' will be passed as arg into another func? 回答1: Putting quotes around the path will work: file = 'C:\\Exe\\First Version\\filename.exe' os.system('"' + file + '"') but a

How to workaround Python “WindowsError messages are not properly encoded” problem?

↘锁芯ラ 提交于 2019-12-01 18:46:29
It's a trouble when Python raised a WindowsError, the encoding of message of the exception is always os-native-encoded. For example: import os os.remove('does_not_exist.file') Well, here we get an exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> WindowsError: [Error 2] 系統找不到指定的檔案。: 'does_not_exist.file' As the language of my Windows7 is Traditional Chinese, the default error message I get is in big5 encoding (as know as CP950). >>> try: ... os.remove('abc.file') ... except WindowsError, value: ... print value.args ... (2, '\xa8t\xb2\xce\xa7\xe4\xa4\xa3\xa8\xec

Running Spark on Windows Error 5 (Access Denied) even when running as Admin

♀尐吖头ヾ 提交于 2019-11-30 21:06:23
问题 I'm beginning with Spark so not really sure where my problem is and looking for a helpful hint here. I'm trying to run Spark (pyspark) on a windows 7 machine as an admin but it does not seem to be working (I still get the WindowsError 5). See image below: I've downloaded the file (release 1.2.0 with pre-built for Hadoop 2.4 or later), unzipped it using tar via command line and set IPYTHON=1 before calling bin\pyspark. When I call it, pyspark runs but I get the error below as per image. When I

os.system to invoke an exe which lies in a dir whose name contains whitespace

你。 提交于 2019-11-30 17:31:58
simply my code is as follows: file = 'C:\\Exe\\First Version\\filename.exe' os.system(file) when I run this program, windowserror is raised, can't find the file specified. I found out the problem has to with the whitespace between "First Version". So Could I find a way circumventing the problem? PS: what if the variable 'file' will be passed as arg into another func? Putting quotes around the path will work: file = 'C:\\Exe\\First Version\\filename.exe' os.system('"' + file + '"') but a better solution is to use the subprocess module instead: import subprocess file = 'C:\\Exe\\First Version\

Windows error 5: Access is denied when trying delete a directory in windows

两盒软妹~` 提交于 2019-11-29 15:40:20
问题 i am trying to delete a directory but when i run the code it gives windows error 5: access is denied. here is my code: in the Release folder, there is a folder called OD . if os.path.exists(os.path.join(get_path_for_output,'Release')): shutil.rmtree(os.path.join(get_path_for_output,'Release')) the error is like: WindowsError: [Error 5] Access is denied: 'C:\\Users\\marahama\\Desktop\\Abdur_Release\\Release\\OD\\automations\\GEM\\FMS_adapter.py' 回答1: This was due to the file permissions issue.

Python: simple ctypes dll load yields error

两盒软妹~` 提交于 2019-11-29 08:45:27
I created the MathFuncsDll.dll from MSDN DLL example and running the calling .cpp worked fine. Now, trying to load this in IPython with ctypes like import ctypes lib = ctypes.WinDLL('MathFuncsDll.dll') being in the correct folder yields UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 28: ordinal not in range(128) Similarly in Python shell this yields WindowsError: [Error 193] %1 is not a valid Win32 application What should I change? Hm, it might be Win 7 64bit vs. some 32bit dll or something right? I'll check later when I've time again. ctypes doesn't work with C++, which

Can't remove a folder with os.remove (WindowsError: [Error 5] Access is denied: 'c:/temp/New Folder')

扶醉桌前 提交于 2019-11-29 06:55:36
I'm working on a test case for which I create some subdirs. However, I don't seem to have the permission to remove them anymore. My UA is an Administrator account (Windows XP). I first tried: folder="c:/temp/" for dir in os.listdir(folder): os.remove(folder+dir) and then folder="c:/temp/" os.remove(folder+"New Folder") because I'm sure "New Folder" is empty. However, in all cases I get: Traceback (most recent call last): File "<string>", line 3, in <module> WindowsError: [Error 5] Access is denied: 'c:/temp/New Folder' Does anybody know what's going wrong? os.remove requires a file path , and