Re: empty stdout (subprocess.run)

2022-01-19 Thread Cameron Simpson
On 19Jan2022 19:16, James Smith wrote: >I'm trying to run a shell command but the stdout is empty: > >import subprocess > >torrentno=8 >cmd="/usr/bin/transmission-remote --torrent %s --info", str(torrentno) >res=subprocess.run(cmd, shell=True, check=True, universal_newlines=True, >capture_output=

Re: empty stdout (subprocess.run)

2022-01-19 Thread Dennis Lee Bieber
On Wed, 19 Jan 2022 19:16:19 -0800 (PST), James Smith declaimed the following: >I'm trying to run a shell command but the stdout is empty: > >import subprocess > >torrentno=8 >cmd="/usr/bin/transmission-remote --torrent %s --info", str(torrentno) Don't you need to provide for that %s? Pe

empty stdout (subprocess.run)

2022-01-19 Thread James Smith
I'm trying to run a shell command but the stdout is empty: import subprocess torrentno=8 cmd="/usr/bin/transmission-remote --torrent %s --info", str(torrentno) res=subprocess.run(cmd, shell=True, check=True, universal_newlines=True, capture_output=True) print(res) CompletedProcess(args=('/usr/b

Re: Puzzling behaviour of Py_IncRef

2022-01-19 Thread Barry Scott
> On 19 Jan 2022, at 10:57, Tony Flury via Python-list > wrote: > > I am writing a C extension module for an AVL tree, and I am trying to ensure > reference counting is done correctly. I was having a problem with the > reference counting so I worked up this little POC of the problem, and I

Re: Puzzling behaviour of Py_IncRef

2022-01-19 Thread Chris Angelico
On Thu, Jan 20, 2022 at 1:22 AM Tony Flury wrote: > > > On 19/01/2022 11:09, Chris Angelico wrote: > > On Wed, Jan 19, 2022 at 10:00 PM Tony Flury via Python-list > > wrote: > >> Extension function : > >> > >> static PyObject *_Node_test_ref_count(PyObject *self) > >> { > >> p

Re: Puzzling behaviour of Py_IncRef

2022-01-19 Thread Tony Flury via Python-list
On 19/01/2022 11:09, Chris Angelico wrote: On Wed, Jan 19, 2022 at 10:00 PM Tony Flury via Python-list wrote: Extension function : static PyObject *_Node_test_ref_count(PyObject *self) { printf("\nIncrementing ref count for self - just for the hell of it\n");

Re: Puzzling behaviour of Py_IncRef

2022-01-19 Thread Chris Angelico
On Wed, Jan 19, 2022 at 10:00 PM Tony Flury via Python-list wrote: > Extension function : > > static PyObject *_Node_test_ref_count(PyObject *self) > { > printf("\nIncrementing ref count for self - just for the hell > of it\n"); > printf("\n before self has a ref coun

Puzzling behaviour of Py_IncRef

2022-01-19 Thread Tony Flury via Python-list
I am writing a C extension module for an AVL tree, and I am trying to ensure reference counting is done correctly. I was having a problem with the reference counting so I worked up this little POC of the problem, and I hope someone can explain this. Extension function : static PyObject *_N