WindowsError
is a built-in Python exception raised when a Windows-specific error occurs or when the error number does not correspond to an errno
value.
WindowsError
instance can be created by function ctypes.WinError()
.
Questions tagged [windowserror]
78 questions
34
votes
13 answers
Can't remove a folder with os.remove (WindowsError: [Error 5] Access is denied: 'c:/temp/New Folder')
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):
…

Sergio Da Silva
- 341
- 1
- 3
- 3
31
votes
5 answers
WindowsError [error 5] Access is denied
I'm using the killableprocess package (built on top of subprocess) for running processes
Whenever I run the "killableprocess.Popen(command)" piece of code in my script I get the following error:
File "killableprocess.py", line 157, in…

Serg
- 311
- 1
- 3
- 3
30
votes
5 answers
os.system to invoke an exe which lies in a dir whose name contains whitespace
My code is simply as follows:
file = 'C:\\Exe\\First Version\\filename.exe'
os.system(file)
When I run this program, a Windows error is raised: can't find the file specified.
I found out the problem has to with the whitespace in the middle of…

Synapse
- 1,574
- 6
- 18
- 19
25
votes
8 answers
How to avoid "WindowsError: [Error 5] Access is denied"
There's the script to re-create folder:
# Remove folder (if exists) with all files
if os.path.isdir(str(os.path.realpath('..') + "\\my_folder")):
shutil.rmtree(os.path.realpath('..') + "\\my_folder", ignore_errors=True)
# Create new…

Andersson
- 51,635
- 17
- 77
- 129
14
votes
2 answers
Why am i getting WindowsError: [Error 5] Access is denied?
Trying to create program that adds folders into program files-recieving this error:
WindowsError: [Error 5] Access is denied 'C:\\Program Files\\IMP'
Here is my code
import os, sys, random
numb= 1
x=True
while x==True:
newpath = ((r'C:\Program…

ThePrinceofPython
- 174
- 1
- 1
- 9
10
votes
2 answers
Disabling Windows error reporting (Dr. Watson) for my process
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…
SmackAttack
7
votes
1 answer
"WindowsError: Access is denied" on calling Process.terminate
I enforce a timeout for a block of code using the multiprocessing module. It appears that with certain sized inputs, the following error is raised:
WindowsError: [Error 5] Access is denied
I can replicate this error with the following code. Note…

David C
- 7,204
- 5
- 46
- 65
6
votes
2 answers
"WindowsError: exception: access violation..." - ctypes question
Here is the prototype for a C function that resides in a DLL:
extern "C" void__stdcall__declspec(dllexport) ReturnPulse(double*,double*,double*,double*,double*);
In another thread, I asked about how to properly create and send the necessary…

trayres
- 522
- 2
- 6
- 18
5
votes
3 answers
ERROR_PATH_NOT_FOUND vs ERROR_FILE_NOT_FOUND, what is the difference?
I usually get ERROR_FILE_NOT_FOUND when I try to open a file that's not there, but now fopen() fails and GetLastError() returns ERROR_PATH_NOT_FOUND.
So what is the difference between ERROR_FILE_NOT_FOUND and ERROR_PATH_NOT_FOUND?

sashoalm
- 75,001
- 122
- 434
- 781
5
votes
3 answers
Wix error 1721 related to CustomAction
I have following CostomAction

sanam_bl
- 299
- 1
- 7
- 14
4
votes
3 answers
How to workaround Python "WindowsError messages are not properly encoded" problem?
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):
…

Fang-Pen Lin
- 13,420
- 15
- 66
- 96
4
votes
1 answer
Why I got "WindowsError [Error5] Access is denied" when run python file using mrjob
I'm trying to use mrjob in a python file and run it in the command line, but I'm keeping getting the error log saying:
C:\Users\Ni\Desktop>python si601lab6_sol.py pg1268.txt
no configs found; falling back on auto-configuration
no configs found;…

Ni Yan
- 165
- 1
- 4
- 9
3
votes
4 answers
pytesseract error Windows Error [Error 2]
Hi I am trying the python library pytesseract to extract text from image.
Please find the code:
from PIL import Image
from pytesseract import image_to_string
print image_to_string(Image.open(r'D:\new_folder\img.png'))
But the following error…

Sourajit Roy Chowdhury
- 103
- 3
- 11
3
votes
2 answers
How to open a random Image from a given file directory?
I am trying to open the image from this directory but am not been able to.
It gives me the following error:
WindowsError: [Error 123] The filename, directory name, or volume
label syntax is incorrect.
This is my code:
import os,…

White Shadow
- 444
- 2
- 10
- 26
3
votes
0 answers
Trying to solve WindowError 126 - module not found
Though this is my first question on the StackOverflow, I consider myself a long time member of the community.
Considering myself as a pre-intermediate programmer, I'll try to be as specific as possible.
I'm writing a Python package that uses a C dll…

Gomes J. A.
- 1,235
- 2
- 9
- 9