[issue36760] subprocess.run fails with capture_output=True and stderr=STDOUT

2019-04-30 Thread Joe Borg


New submission from Joe Borg :

Reading from 
https://docs.python.org/3/library/subprocess.html#subprocess.CompletedProcess

"""
If you ran the process with stderr=subprocess.STDOUT, stdout and stderr will be 
combined in this attribute, and stderr will be None.
"""

But, if you run `run()` with `capture_output=True`, you get the following 
exception:

"""
ValueError: stdout and stderr arguments may not be used with capture_output.
"""

So, it seems impossible to get the combined outputs of stdout and stderr with 
`run()`.

--
components: Library (Lib)
messages: 341158
nosy: Joe.Borg
priority: normal
severity: normal
status: open
title: subprocess.run fails with capture_output=True and stderr=STDOUT
type: behavior
versions: Python 3.7

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



[issue4705] python3.0 -u: unbuffered stdout

2013-08-26 Thread Joe Borg

Joe Borg added the comment:

Can I confirm this is still in the trunk?  I have 3.3.2 and am suffering from 
the fact that `-u` isn't setting stdin to unbuffered.  I'm have to run a flush 
every command, which is awful.

--
nosy: +Joe.Borg, georg.brandl
versions: +Python 3.2, Python 3.3

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



[issue18868] Python3 unbuffered stdin

2013-08-28 Thread Joe Borg

New submission from Joe Borg:

I'm in need of an unbuffered stdin for Python3.  Using the '-u' flag worked 
fine in Python2.  But, it seems, Python3's stdin is always buffered; as seen in 
http://bugs.python.org/issue4705.

This is not always desirable.  For example:

#!/bin/python3
import os, subprocess, time

with open("%s/unbuffered_test.log" % (os.getenv("HOME")), "w") as f:
with subprocess.Popen(["%s/unbuffered_test.sh" % (os.getenv("HOME"))], 
stdin=subprocess.PIPE, stdout=f, stderr=f) as p:
p.stdin.write(bytes("test\n", encoding="utf-8"))
time.sleep(10)

Where unbuffered_test.sh is:
#!/bin/sh
read INPUT
echo $INPUT
exit 0

Running with -u in Python2 sees the log file populated before the 10 seconds 
are up.  This isn't the case in Python3.  This making controlling applications, 
using subprocess, basically impossible; without putting p.stdin.flush() after 
each command (which does work in the example above).

I ran this example in Python3.3.2.

--
messages: 196359
nosy: Joe.Borg
priority: normal
severity: normal
status: open
title: Python3 unbuffered stdin
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue18868] Python3 unbuffered stdin

2013-08-28 Thread Joe Borg

Changes by Joe Borg :


--
type:  -> behavior

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



[issue21481] Argpase Namespace object methods __eq__ and __ne__ raise TypeError when comparing to None

2014-05-12 Thread Joe Borg

New submission from Joe Borg:

See example:

>>> import argparse
>>> a = argparse.ArgumentParser()
>>> b = a.parse_args([])
>>> if b != None:
... print "hey"
  File "", line 2
print "hey"
  ^
SyntaxError: invalid syntax
>>> 
>>> if b != None:   
... print("hey")
... 
Traceback (most recent call last):
  File "", line 1, in 
  File "/cfd/software/Python/340/lib/python3.4/argparse.py", line 1202, in 
__ne__
return not (self == other)
  File "/cfd/software/Python/340/lib/python3.4/argparse.py", line 1199, in 
__eq__
return vars(self) == vars(other)
TypeError: vars() argument must have __dict__ attribute

--
components: Library (Lib)
messages: 218326
nosy: Joe.Borg
priority: normal
severity: normal
status: open
title: Argpase Namespace object methods __eq__ and __ne__  raise TypeError when 
comparing to None
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue21481] Argpase Namespace object methods __eq__ and __ne__ raise TypeError when comparing to None

2014-05-12 Thread Joe Borg

Joe Borg added the comment:

I believe this comes from doing vars(None).  But why would this be happening if 
Namespace is empty.

--

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



[issue16767] Cannot install Python 2.7 in Wine 1.4.1

2012-12-24 Thread Joe Borg

New submission from Joe Borg:

Trying to install Python 2.7 (in particular) under Wine 1.4.1, but keep getting 
the "Installer has ended prematurely" error.  I've also tried with 2.6 and 3.2 
and different versions of wine; same error.  Also tried with winetricks; again, 
same error.

I've used the msiexec command to log the output of the installer and will 
attach.

Thanks.

--
components: Windows
files: install.log
messages: 178061
nosy: Joe.Borg
priority: normal
severity: normal
status: open
title: Cannot install Python 2.7 in Wine 1.4.1
versions: Python 2.7
Added file: http://bugs.python.org/file28421/install.log

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



[issue21887] Python3 can't detect Tcl

2014-06-30 Thread Joe Borg

New submission from Joe Borg:

Trying to configure 3.4.1 on Cent OS 6.4.  I have built Tcl and Tk, using the 
prefix /scratch/root.  I can confirm the builds with:

$ find /scratch/root/ -name "tcl.h"
/scratch/root/include/tcl.h

$ find /scratch/root/ -name "tk.h"
/scratch/root/include/tk.h

But, when configuring Python, they aren't picked up:

$ ./configure --prefix=/scratch/root 
--with-tcltk-includes=/scratch/root/include --with-tcltk-libs=/scratch/root/lib 
| grep tcl
checking for --with-tcltk-includes... /scratch/root/include
checking for --with-tcltk-libs... /scratch/root/lib
checking for UCS-4 tcl... no

I've tried to make install with this, but then get the usual exception from 
_tkinter.

--
components: Build
messages: 221964
nosy: Joe.Borg
priority: normal
severity: normal
status: open
title: Python3 can't detect Tcl
versions: Python 3.4

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



[issue21887] Python3 can't detect Tcl/Tk 8.6.1

2014-06-30 Thread Joe Borg

Changes by Joe Borg :


--
title: Python3 can't detect Tcl -> Python3 can't detect Tcl/Tk 8.6.1

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



[issue17321] Better way to pass objects between imp.find_module() and imp.load_module()

2013-02-28 Thread Joe Borg

New submission from Joe Borg:

If I want to use imp to find some load modules, I have to do it in quite an 
"unpythonic" way:

>>> name = "os"
>>> file, pathname, description = imp.find_module(name)
>>> imp.load_module(name, file, pathname, description)

Can there not be a better way to pass the tuple (or other object) between 
find_module() and load_module()?

I'm happy to patch this myself and submit, if it's not already been thought 
about.

--
messages: 183220
nosy: Joe.Borg
priority: normal
severity: normal
status: open
title: Better way to pass objects between imp.find_module() and 
imp.load_module()
versions: Python 2.7

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



[issue17321] Better way to pass objects between imp.find_module() and imp.load_module()

2013-02-28 Thread Joe Borg

Joe Borg added the comment:

Thanks for the swift feedback guys, if this is deprecated (i.e. not being 
carried to Python 3) then close the bug; I'll look at `importlib` and see if it 
carries the same problem.

--
type: behavior -> 

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



[issue17321] Better way to pass objects between imp.find_module() and imp.load_module()

2013-02-28 Thread Joe Borg

Joe Borg added the comment:

Hi Brett, I missed the fact that it's deprecated as it's not mentioned in the 
2.* docs http://docs.python.org/2/library/imp.html.

I can see it is in the 3.*.

Thanks for the feedback.

--

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