don't use os.kill on win32 platform

Bug #317583 reported by Alexander Belchenko
2
Affects Status Importance Assigned to Milestone
QBzr
Fix Released
Medium
Alexander Belchenko

Bug Description

I've tried to Cancel qpull operation and get the traceback:

Traceback (most recent call last):
  File "C:\work\Bazaar\plugins\qbzr\lib\subprocess.py", line 157, in reject
    self.process_widget.abort()
  File "C:\work\Bazaar\plugins\qbzr\lib\subprocess.py", line 371, in abort
    os.kill(self.process.pid(), signal.SIGINT)
AttributeError: 'module' object has no attribute 'kill'
Connected (version 2.0, client Twisted)
Authentication (publickey) successful!
Secsh channel 1 opened.
Unable to obtain lock file:///C:/work/Bazaar/scmproj-repo/format-change/.bzr/branch/lock
held by <email address hidden> on host bialix-laptop [process #3352]
locked 2 minutes, 15 seconds ago
Will continue to try until 20:31:50, unless you press Ctrl-C
If you're sure that it's not being modified, use bzr break-lock file:///C:/work/Bazaar/scmproj-repo/format-change/.b
zr/branch/lock

os.kill is not available on Windows platform. Using it unconditionally is bad.

Tags: subprocess
Revision history for this message
Alexander Belchenko (bialix) wrote :
Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 317583] [NEW] don't use os.kill on win32 platform

Alexander Belchenko пишет:
> os.kill(self.process.pid(), signal.SIGINT)

BTW this code is wrong. At least on Windows.

self.process.pid() returns sip.voidptr object. If I cast it to int with the code
int(self.process.pid()) then I get pointer value, it's not the same as os.getpid()
result (I've checked via debug print in qsubprocess body).

Changed in qbzr:
assignee: nobody → bialix
importance: Undecided → Medium
milestone: none → 0.9.7
status: New → Fix Committed
Changed in qbzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.