• <i id='Wv5tN'><tr id='Wv5tN'><dt id='Wv5tN'><q id='Wv5tN'><span id='Wv5tN'><b id='Wv5tN'><form id='Wv5tN'><ins id='Wv5tN'></ins><ul id='Wv5tN'></ul><sub id='Wv5tN'></sub></form><legend id='Wv5tN'></legend><bdo id='Wv5tN'><pre id='Wv5tN'><center id='Wv5tN'></center></pre></bdo></b><th id='Wv5tN'></th></span></q></dt></tr></i><div id='Wv5tN'><tfoot id='Wv5tN'></tfoot><dl id='Wv5tN'><fieldset id='Wv5tN'></fieldset></dl></div>
      <legend id='Wv5tN'><style id='Wv5tN'><dir id='Wv5tN'><q id='Wv5tN'></q></dir></style></legend>
    1. <small id='Wv5tN'></small><noframes id='Wv5tN'>

          <bdo id='Wv5tN'></bdo><ul id='Wv5tN'></ul>

        <tfoot id='Wv5tN'></tfoot>

        WindowsError [错误 5] 访问被拒绝

        时间:2023-07-22
          <tbody id='inUcC'></tbody>

        <small id='inUcC'></small><noframes id='inUcC'>

          <legend id='inUcC'><style id='inUcC'><dir id='inUcC'><q id='inUcC'></q></dir></style></legend>

          • <bdo id='inUcC'></bdo><ul id='inUcC'></ul>
            <i id='inUcC'><tr id='inUcC'><dt id='inUcC'><q id='inUcC'><span id='inUcC'><b id='inUcC'><form id='inUcC'><ins id='inUcC'></ins><ul id='inUcC'></ul><sub id='inUcC'></sub></form><legend id='inUcC'></legend><bdo id='inUcC'><pre id='inUcC'><center id='inUcC'></center></pre></bdo></b><th id='inUcC'></th></span></q></dt></tr></i><div id='inUcC'><tfoot id='inUcC'></tfoot><dl id='inUcC'><fieldset id='inUcC'></fieldset></dl></div>

                1. <tfoot id='inUcC'></tfoot>

                  本文介绍了WindowsError [错误 5] 访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 killableprocess 包(建立在子进程之上)来运行进程每当我在脚本中运行killableprocess.Popen(command)"这段代码时,我都会收到以下错误:

                  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 _execute_child
                    winprocess.AssignProcessToJobObject(self._job, hp)
                  File "winprocess.py", line 37, in ErrCheckBool
                    raise WinError()
                  WindowsError [error 5] Access is denied
                  Exception TypeError: "'NoneType' object is not callable" in <bound method AutoHANDLE.__del__ of <AutoHANDLE object at 0x025D42B0>> ignored
                  

                  但是当我从 python 交互式控制台 (python 2.6) 运行它时,它工作正常.这可能意味着当我从脚本运行它时存在权限问题,但我不知道如何解决它们.我尝试从以管理员身份运行的 cmd 运行脚本,但没有帮助.尝试寻找类似的帖子,但没有找到任何好的解决方案.希望能在这里找到帮助我在 Windows 上运行,特别是 Windows 7 Ultimate x64,如果有帮助的话.

                  But when I run it from the python interactive console (python 2.6) it works fine. That probably means there are permission issues when I run this from the script, but I don't know how to solve them. I tried running the script from a cmd that I ran as administrator, but it didn't help. Tried looking for similar posts but didn't find any good solution. Hope to find some help here I'm running on Windows, specifically Windows 7 Ultimate x64, if it's any help.

                  谢谢

                  推荐答案

                  我通过切换到进程目录(我尝试使用inkscape)解决了我遇到的类似问题,它解决了我的问题

                  I solved a similar problem I had by switching to the process directory (I was trying to use inkscape) and it solved my problem

                  import subprocess
                  inkscape_dir=r"C:Program Files (x86)Inkscape"
                  assert os.path.isdir(inkscape_dir)
                  os.chdir(inkscape_dir)
                  subprocess.Popen(['inkscape.exe',"-f",fname,"-e",fname_png])
                  

                  也许切换到进程目录也对你有用.

                  Maybe switching to the process directory will work for you too.

                  这篇关于WindowsError [错误 5] 访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:等待具有多个并行作业的子进程结束 下一篇:抑制 subprocess.Popen 的输出

                  相关文章

                2. <legend id='gNiD3'><style id='gNiD3'><dir id='gNiD3'><q id='gNiD3'></q></dir></style></legend>
                  <i id='gNiD3'><tr id='gNiD3'><dt id='gNiD3'><q id='gNiD3'><span id='gNiD3'><b id='gNiD3'><form id='gNiD3'><ins id='gNiD3'></ins><ul id='gNiD3'></ul><sub id='gNiD3'></sub></form><legend id='gNiD3'></legend><bdo id='gNiD3'><pre id='gNiD3'><center id='gNiD3'></center></pre></bdo></b><th id='gNiD3'></th></span></q></dt></tr></i><div id='gNiD3'><tfoot id='gNiD3'></tfoot><dl id='gNiD3'><fieldset id='gNiD3'></fieldset></dl></div>
                  <tfoot id='gNiD3'></tfoot>

                  <small id='gNiD3'></small><noframes id='gNiD3'>

                      <bdo id='gNiD3'></bdo><ul id='gNiD3'></ul>