[issue38988] Killing asyncio subprocesses on timeout?

2019-12-06 Thread dontbugme


New submission from dontbugme :

I'm trying to use asyncio.subproceess and am having difficulty killing the 
subprocesses after timeout. My use case is launching processes that hold on to 
file handles and other exclusive resources, so subsequent processes can only be 
launched after the first ones are fully stopped.


The documentation on 
https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.asyncio.subprocess.Process
 say there is no timeout-parameter and suggests using wait_for() instead.
I tried this but it's kind of a footgun because the wait_for() times out but 
the process still lives on in the background. See Fail(1) and Fail(2) in 
attached test1().


To solve this i tried to catch the CancelledError and in the exception handler 
kill the process myself. While this worked it's also semi dangerous because it 
takes some time for the process to get killed and the wait() after kill() runs 
in the background as some kind of detached task. See Fail(3) in attached 
test2().
This i can sortof understand because after TimeoutError something would have to 
block for wait() to actually finish and this is impossible.

After writing this i feel myself there is no good solution for Fail#3 because 
again, timeouts can't be blocking. Maybe some warning in the documentation 
would be appropriate for Fail(1+2) because the suggestion in the documentation 
right now is quite misleading, the wait_for()-alternative to timeout-parameter 
does not behave like the timeout-parameter in ordinary subprocess.Popen.wait()

--
components: asyncio
files: subprocess_timeout.py
messages: 357930
nosy: asvetlov, dontbugme, yselivanov
priority: normal
severity: normal
status: open
title: Killing asyncio subprocesses on timeout?
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file48761/subprocess_timeout.py

___
Python tracker 
<https://bugs.python.org/issue38988>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28758] UnicodeDecodeError: 'gbk' codec can't decode byte 0xab in position 74: illegal multibyte sequence

2016-11-20 Thread dontbugme

New submission from dontbugme:

you can see https://github.com/mintty/mintty/issues/609
os.popen('chcp 65001 && ' + JAVA + ' -jar ' + CHECKSTYLE_JAR + ' -c ' + 
CHECKSTYLE_XML + ' "%s/%s"' % (COMMIT_TEMP_DIT, changed)).read()

--
messages: 281322
nosy: dontbugme
priority: normal
severity: normal
status: open
title: UnicodeDecodeError: 'gbk' codec can't decode byte 0xab in position 74: 
illegal multibyte sequence
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28758>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6792] Distutils-based installer does not detect 64bit versions of Python

2010-10-02 Thread dontbugme

dontbugme pythonbugsbugme...@spamavert.com added the comment:

you can add  InstallPath key with the corresponding value at 
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.6\]
if you want disutils installer to detect your python
That makes him detect and install the librarys or scripts to the right 
directory, but doens't make your library 64bit compatible if it isn't
(means if the library doesn't work on 64 bit i neither will whith this work 
around) Only possibility of fixing that problem is installing 32bit python

--
nosy: +dontbugme
versions: +Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7680] pythonw crash while attempting to start() a thread object

2010-01-17 Thread dontbugme

dontbugme pythonbugsbugme...@spamavert.com added the comment:

After asking at the IRC channel, posborne resolved the error:

posborne Also, the behaviour of exiting the main thread before all threads 
has exited is undefined.  Is the behaviour different if you add t.join() to the 
end of the script?

Code:
#!/usr/bin/env python
import threading

class MyThread (threading.Thread):
def __init__(self):
threading.Thread.__init__(self)

def run(self):
print 'hello, dude!'

t = MyThread()
t.start()
t.join()

--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7680
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7680] pythonw crash while attempting to start() a thread object

2010-01-12 Thread dontbugme

dontbugme pythonbugsbugme...@spamavert.com added the comment:

I did not understand the question.
If you were meaning running a plain print(), then it does work:
#!/usr/bin/env python
print foo

IDLE 2.6.4   No Subprocess 
 
foo
 

Well, as you suggested the problem most probably originates from calling print 
from within a thread.

This code works as it should:
#!/usr/bin/env python
import threading

class MyThread (threading.Thread):
def __init__(self):
threading.Thread.__init__(self)

def run(self):
f = open('I am alive', 'w')
f.write('hello, dude!\n')
f.close()

t = MyThread()
t.start()

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7680
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7680] pythonw crash while attempting to start() a thread object

2010-01-11 Thread dontbugme

New submission from dontbugme pythonbugsbugme...@spamavert.com:

PythonW.exe crash, tested under Windows 7 x86 / x64, Python v2.6.4.
The crash can be reproduced by opening and running the attached code in IDLE.
TY!

Error Message:
Microsoft Visual C++ Runtime Library
Runtime Error!
Program: C:\Python26\pythonw.exe
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Code:
#!/usr/bin/env python
import threading

class MyThread (threading.Thread):
def __init__(self):
threading.Thread.__init__(self)

def run(self):
print 'hello, dude!'

t = MyThread()
t.start()

--
components: IDLE
messages: 97622
nosy: dontbugme
severity: normal
status: open
title: pythonw crash while attempting to start() a thread object
type: crash
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7680
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7394] sqlite3: some OperationalError exceptions should be ProgrammingError (PEP 249)

2009-11-25 Thread dontbugme

New submission from dontbugme pythonbugsbugme...@spamavert.com:

The following code raises OperationalError exceptions:
python -c 'import sqlite3; sqlite3.connect(:memory:).execute(bad
syntax)'
python -c 'import sqlite3; sqlite3.connect(:memory:).execute(SELECT *
FROM no_such_table)'
python -c 'import sqlite3; sqlite3.connect(:memory:).execute(SELECT
no_such_column)'

But ProgrammingError should be raised, as per PEP 249:

ProgrammingError
  
Exception raised for programming errors, e.g. table not
found or already exists, syntax error in the SQL
statement, wrong number of parameters specified, etc.  It
must be a subclass of DatabaseError.

--
components: Library (Lib)
messages: 95719
nosy: dontbugme
severity: normal
status: open
title: sqlite3: some OperationalError exceptions should be ProgrammingError 
(PEP 249)
type: behavior
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7394
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6735] restype pointer to Structure subclass never initialized

2009-08-19 Thread dontbugme

New submission from dontbugme pythonbugsbugme...@spamavert.com:

So, say I'm sub-classing ctypes.Structure with a class: MyClass.

I define __init__() in MyClass..

If I explicitly instantiate MyClass(), then the __init__() is properly
executed as expected.

But say I have a CFUNCTYPE where I set it's restype member to a POINTER
to MyClass.. A python MyClass object is obviously instantiated at one
point in time, but it's __init__ is never called. Seems odd to me?

--
assignee: theller
components: ctypes
messages: 91736
nosy: dontbugme, theller
severity: normal
status: open
title: restype pointer to Structure subclass never initialized
versions: Python 2.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6735
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5993] python produces zombie in webbrowser.open

2009-05-10 Thread dontbugme

New submission from dontbugme pythonbugsbugme...@spamavert.com:

the webbrowser library produces a zombie process when opening urls.

please see http://dev.deluge-torrent.org/ticket/928
and the original bug report (by me) on ubuntu's launchpad (https://
bugs.launchpad.net/bugs/313149) for details.
could not find any references in your tracker, but i did not test it in 
newer versions than the one supplied in ubuntu atm (2.6.2), so please 
forgive me, if it is already fixed :)

--
components: Library (Lib)
messages: 87561
nosy: dontbugme
severity: normal
status: open
title: python produces zombie in webbrowser.open
type: resource usage
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5993
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4772] undesired switch fall-through in socketmodule.c

2008-12-29 Thread dontbugme

New submission from dontbugme pythonbugsbugme...@spamavert.com:

makesockaddr() in socketmodule.c will fall through from AF_BLUETOOTH to
AF_PACKET if none of Bluetooth protocols match. That's not a very
appropriate thing to do.

--
messages: 78483
nosy: dontbugme
severity: normal
status: open
title: undesired switch fall-through in socketmodule.c

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4772
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com