Description of problem: pmNonOptionsFromList() can fail without really telling why: localhost:~> cat ./test.py #!/usr/bin/python from pcp import pmapi import sys opts = pmapi.pmOptions() print opts.pmNonOptionsFromList(sys.argv) ctx = pmapi.pmContext.fromOptions(opts, sys.argv) localhost:~> python ./test.py abc Traceback (most recent call last): File "./test.py", line 7, in <module> print opts.pmNonOptionsFromList(sys.argv) File "/usr/lib64/python2.7/site-packages/pcp/pmapi.py", line 792, in pmNonOptionsFromList return c_api.pmGetNonOptionsFromList(argv) SystemError: error return without exception set localhost:~> If we create the context before calling pmNonOptionsFromList() then it works as expected. Ideally the above would work also as e.g. in pmrep(1) we need to read non-options which include references to configuration file entries which will then in turn be used in context creation. Thanks.
Looking at the code, I think the problem is that pmGetOptions must be called before pmGetNonOptions[...] - because it uses optind and hence getopt state from that earlier call. Because pmrep is using the all-at-once parse-arguments-and-create-context interface - i.e. .fromOptions() - that cannot happen in the right order by definition. However, pmrep could just call the pmContext constructor directly - see the fromOptions code around line 1068 of src/python/pcp/pmapi.py for what happens now. cheers.
That said, "SystemError: error return without exception set" is certainly an indecipherable error message & we can certainly improve that side of things.
Fixed upstream, will be in pcp-3.10.9.
pcp-3.10.9-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-d08245c076
pcp-3.10.9-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-2b40815137
pcp-3.10.9-1.el5 has been submitted as an update to Fedora EPEL 5. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-2ac90519bc
pcp-3.10.9-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'dnf --enablerepo=updates-testing update pcp' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-2b40815137
pcp-3.10.9-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'dnf --enablerepo=updates-testing update pcp' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-d08245c076
pcp-3.10.9-1.el5 has been pushed to the Fedora EPEL 5 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'yum --enablerepo=epel-testing update pcp' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-2ac90519bc
pcp-3.10.9-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
pcp-3.10.9-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
pcp-3.11.0-1.el5 has been submitted as an update to Fedora EPEL 5. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-57b7efb2d7
pcp-3.11.0-1.el5 has been pushed to the Fedora EPEL 5 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-57b7efb2d7
pcp-3.11.1-1.el5 has been pushed to the Fedora EPEL 5 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-5b519318e0
pcp-3.11.1-1.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.