Compare commits

..

No commits in common. "c8-stream-3.8" and "c8s" have entirely different histories.

8 changed files with 169 additions and 197 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/psutil-5.6.4.tar.gz /psutil-5.4.3.tar.gz

View File

@ -1 +0,0 @@
038eebeacabe8f11215961aae307818e4c5af85b SOURCES/psutil-5.6.4.tar.gz

View File

@ -1,19 +1,19 @@
diff --git a/psutil/_psutil_aix.c b/psutil/_psutil_aix.c diff --git a/psutil/_psutil_aix.c b/psutil/_psutil_aix.c
index 8c055a4..9f58f60 100644 index 916254d..37a1fb2 100644
--- a/psutil/_psutil_aix.c --- a/psutil/_psutil_aix.c
+++ b/psutil/_psutil_aix.c +++ b/psutil/_psutil_aix.c
@@ -265,8 +265,8 @@ psutil_proc_environ(PyObject *self, PyObject *args) { @@ -158,8 +158,8 @@ psutil_proc_name_and_args(PyObject *self, PyObject *args) {
py_retlist = Py_BuildValue("OO", py_name, py_args);
if (!py_retlist)
goto error; goto error;
if (PyDict_SetItem(py_retdict, py_key, py_val)) - Py_DECREF(py_name);
goto error; - Py_DECREF(py_args);
- Py_DECREF(py_key); + Py_CLEAR(py_name);
- Py_DECREF(py_val); + Py_CLEAR(py_args);
+ Py_CLEAR(py_key); return py_retlist;
+ Py_CLEAR(py_val);
} error:
curvar = strchr(curvar, '\0') + 1; @@ -389,10 +389,10 @@ psutil_users(PyObject *self, PyObject *args) {
}
@@ -510,10 +510,10 @@ psutil_users(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -28,7 +28,7 @@ index 8c055a4..9f58f60 100644
} }
endutxent(); endutxent();
@@ -570,9 +570,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) { @@ -449,9 +449,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -42,10 +42,10 @@ index 8c055a4..9f58f60 100644
} }
endmntent(file); endmntent(file);
diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c
index b4264ce..7f1c492 100644 index 9a2ed04..3dc04e0 100644
--- a/psutil/_psutil_bsd.c --- a/psutil/_psutil_bsd.c
+++ b/psutil/_psutil_bsd.c +++ b/psutil/_psutil_bsd.c
@@ -154,7 +154,7 @@ psutil_pids(PyObject *self, PyObject *args) { @@ -152,7 +152,7 @@ psutil_pids(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_pid)) if (PyList_Append(py_retlist, py_pid))
goto error; goto error;
@ -118,10 +118,10 @@ index b4264ce..7f1c492 100644
endutxent(); endutxent();
diff --git a/psutil/_psutil_linux.c b/psutil/_psutil_linux.c diff --git a/psutil/_psutil_linux.c b/psutil/_psutil_linux.c
index 717723d..0d16eb4 100644 index d1f0d14..00212ba 100644
--- a/psutil/_psutil_linux.c --- a/psutil/_psutil_linux.c
+++ b/psutil/_psutil_linux.c +++ b/psutil/_psutil_linux.c
@@ -241,9 +241,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) { @@ -232,9 +232,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -134,7 +134,7 @@ index 717723d..0d16eb4 100644
} }
endmntent(file); endmntent(file);
return py_retlist; return py_retlist;
@@ -454,10 +454,10 @@ psutil_users(PyObject *self, PyObject *args) { @@ -488,10 +488,10 @@ psutil_users(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -150,19 +150,10 @@ index 717723d..0d16eb4 100644
endutent(); endutent();
return py_retlist; return py_retlist;
diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c
index d2ca94b..76ec0ee 100644 index 55dd64c..37f5284 100644
--- a/psutil/_psutil_osx.c --- a/psutil/_psutil_osx.c
+++ b/psutil/_psutil_osx.c +++ b/psutil/_psutil_osx.c
@@ -138,7 +138,7 @@ psutil_pids(PyObject *self, PyObject *args) { @@ -795,7 +795,7 @@ psutil_per_cpu_times(PyObject *self, PyObject *args) {
goto error;
if (PyList_Append(py_retlist, py_pid))
goto error;
- Py_DECREF(py_pid);
+ Py_CLEAR(py_pid);
proclist++;
}
free(orig_address);
@@ -653,7 +653,7 @@ psutil_per_cpu_times(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_cputime)) if (PyList_Append(py_retlist, py_cputime))
goto error; goto error;
@ -171,7 +162,7 @@ index d2ca94b..76ec0ee 100644
} }
ret = vm_deallocate(mach_task_self(), (vm_address_t)info_array, ret = vm_deallocate(mach_task_self(), (vm_address_t)info_array,
@@ -841,9 +841,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) { @@ -977,9 +977,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -184,7 +175,7 @@ index d2ca94b..76ec0ee 100644
} }
free(fs); free(fs);
@@ -911,7 +911,6 @@ psutil_proc_threads(PyObject *self, PyObject *args) { @@ -1055,7 +1055,6 @@ psutil_proc_threads(PyObject *self, PyObject *args) {
} }
for (j = 0; j < thread_count; j++) { for (j = 0; j < thread_count; j++) {
@ -192,7 +183,7 @@ index d2ca94b..76ec0ee 100644
thread_info_count = THREAD_INFO_MAX; thread_info_count = THREAD_INFO_MAX;
kr = thread_info(thread_list[j], THREAD_BASIC_INFO, kr = thread_info(thread_list[j], THREAD_BASIC_INFO,
(thread_info_t)thinfo_basic, &thread_info_count); (thread_info_t)thinfo_basic, &thread_info_count);
@@ -934,7 +933,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) { @@ -1076,7 +1075,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -201,7 +192,7 @@ index d2ca94b..76ec0ee 100644
} }
ret = vm_deallocate(task, (vm_address_t)thread_list, ret = vm_deallocate(task, (vm_address_t)thread_list,
@@ -1043,10 +1042,8 @@ psutil_proc_open_files(PyObject *self, PyObject *args) { @@ -1185,10 +1184,8 @@ psutil_proc_open_files(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -214,7 +205,7 @@ index d2ca94b..76ec0ee 100644
// --- /construct python list // --- /construct python list
} }
} }
@@ -1226,7 +1223,7 @@ psutil_proc_connections(PyObject *self, PyObject *args) { @@ -1368,7 +1365,7 @@ psutil_proc_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -223,7 +214,7 @@ index d2ca94b..76ec0ee 100644
} }
else if (family == AF_UNIX) { else if (family == AF_UNIX) {
py_laddr = PyUnicode_DecodeFSDefault( py_laddr = PyUnicode_DecodeFSDefault(
@@ -1248,9 +1245,9 @@ psutil_proc_connections(PyObject *self, PyObject *args) { @@ -1390,9 +1387,9 @@ psutil_proc_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -236,7 +227,7 @@ index d2ca94b..76ec0ee 100644
} }
} }
} }
@@ -1370,7 +1367,7 @@ psutil_net_io_counters(PyObject *self, PyObject *args) { @@ -1513,7 +1510,7 @@ psutil_net_io_counters(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItemString(py_retdict, ifc_name, py_ifc_info)) if (PyDict_SetItemString(py_retdict, ifc_name, py_ifc_info))
goto error; goto error;
@ -245,7 +236,7 @@ index d2ca94b..76ec0ee 100644
} }
else { else {
continue; continue;
@@ -1543,7 +1540,7 @@ psutil_disk_io_counters(PyObject *self, PyObject *args) { @@ -1686,7 +1683,7 @@ psutil_disk_io_counters(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItemString(py_retdict, disk_name, py_disk_info)) if (PyDict_SetItemString(py_retdict, disk_name, py_disk_info))
goto error; goto error;
@ -254,7 +245,7 @@ index d2ca94b..76ec0ee 100644
CFRelease(parent_dict); CFRelease(parent_dict);
IOObjectRelease(parent); IOObjectRelease(parent);
@@ -1605,10 +1602,10 @@ psutil_users(PyObject *self, PyObject *args) { @@ -1748,10 +1745,10 @@ psutil_users(PyObject *self, PyObject *args) {
endutxent(); endutxent();
goto error; goto error;
} }
@ -270,7 +261,7 @@ index d2ca94b..76ec0ee 100644
endutxent(); endutxent();
diff --git a/psutil/_psutil_posix.c b/psutil/_psutil_posix.c diff --git a/psutil/_psutil_posix.c b/psutil/_psutil_posix.c
index 209e787..aa60084 100644 index cc82727..6d9212a 100644
--- a/psutil/_psutil_posix.c --- a/psutil/_psutil_posix.c
+++ b/psutil/_psutil_posix.c +++ b/psutil/_psutil_posix.c
@@ -324,11 +324,11 @@ psutil_net_if_addrs(PyObject* self, PyObject* args) { @@ -324,11 +324,11 @@ psutil_net_if_addrs(PyObject* self, PyObject* args) {
@ -291,10 +282,10 @@ index 209e787..aa60084 100644
freeifaddrs(ifaddr); freeifaddrs(ifaddr);
diff --git a/psutil/_psutil_sunos.c b/psutil/_psutil_sunos.c diff --git a/psutil/_psutil_sunos.c b/psutil/_psutil_sunos.c
index 919e76d..31d6f36 100644 index c667364..ff635f6 100644
--- a/psutil/_psutil_sunos.c --- a/psutil/_psutil_sunos.c
+++ b/psutil/_psutil_sunos.c +++ b/psutil/_psutil_sunos.c
@@ -300,8 +300,8 @@ psutil_proc_environ(PyObject *self, PyObject *args) { @@ -214,8 +214,8 @@ psutil_proc_environ(PyObject *self, PyObject *args) {
if (PyDict_SetItem(py_retdict, py_envname, py_envval) < 0) if (PyDict_SetItem(py_retdict, py_envname, py_envval) < 0)
goto error; goto error;
@ -305,7 +296,7 @@ index 919e76d..31d6f36 100644
} }
psutil_free_cstrings_array(env, env_count); psutil_free_cstrings_array(env, env_count);
@@ -655,10 +655,10 @@ psutil_users(PyObject *self, PyObject *args) { @@ -576,10 +576,10 @@ psutil_users(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -320,7 +311,7 @@ index 919e76d..31d6f36 100644
} }
endutxent(); endutxent();
@@ -714,9 +714,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) { @@ -635,9 +635,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -333,7 +324,7 @@ index 919e76d..31d6f36 100644
} }
fclose(file); fclose(file);
return py_retlist; return py_retlist;
@@ -767,8 +767,7 @@ psutil_per_cpu_times(PyObject *self, PyObject *args) { @@ -688,8 +688,7 @@ psutil_per_cpu_times(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_cputime)) if (PyList_Append(py_retlist, py_cputime))
goto error; goto error;
@ -343,7 +334,7 @@ index 919e76d..31d6f36 100644
} }
} }
@@ -824,7 +823,7 @@ psutil_disk_io_counters(PyObject *self, PyObject *args) { @@ -745,7 +744,7 @@ psutil_disk_io_counters(PyObject *self, PyObject *args) {
if (PyDict_SetItemString(py_retdict, ksp->ks_name, if (PyDict_SetItemString(py_retdict, ksp->ks_name,
py_disk_info)) py_disk_info))
goto error; goto error;
@ -352,7 +343,7 @@ index 919e76d..31d6f36 100644
} }
} }
ksp = ksp->ks_next; ksp = ksp->ks_next;
@@ -959,8 +958,8 @@ psutil_proc_memory_maps(PyObject *self, PyObject *args) { @@ -880,8 +879,8 @@ psutil_proc_memory_maps(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -363,7 +354,7 @@ index 919e76d..31d6f36 100644
// increment pointer // increment pointer
p += 1; p += 1;
@@ -1075,7 +1074,7 @@ psutil_net_io_counters(PyObject *self, PyObject *args) { @@ -996,7 +995,7 @@ psutil_net_io_counters(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItemString(py_retdict, ksp->ks_name, py_ifc_info)) if (PyDict_SetItemString(py_retdict, ksp->ks_name, py_ifc_info))
goto error; goto error;
@ -372,7 +363,7 @@ index 919e76d..31d6f36 100644
goto next; goto next;
next: next:
@@ -1273,7 +1272,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { @@ -1189,7 +1188,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -381,16 +372,7 @@ index 919e76d..31d6f36 100644
} }
} }
#if defined(AF_INET6) #if defined(AF_INET6)
@@ -1287,7 +1286,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { @@ -1232,7 +1231,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
#ifdef NEW_MIB_COMPLIANT
processed_pid = tp6.tcp6ConnCreationProcess;
#else
- processed_pid = 0;
+ processed_pid = 0;
#endif
if (pid != -1 && processed_pid != pid)
continue;
@@ -1316,14 +1315,14 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -399,15 +381,16 @@ index 919e76d..31d6f36 100644
} }
} }
#endif #endif
// UDPv4 @@ -1240,7 +1239,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
else if (mibhdr.level == MIB2_UDP || mibhdr.level == MIB2_UDP_ENTRY) { else if (mibhdr->level == MIB2_UDP || mibhdr->level == MIB2_UDP_ENTRY) {
num_ent = mibhdr.len / sizeof(mib2_udpEntry_t); ude = (mib2_udpEntry_t *)databuf.buf;
- assert(num_ent * sizeof(mib2_udpEntry_t) == mibhdr.len); num_ent = mibhdr->len / sizeof(mib2_udpEntry_t);
- assert(num_ent * sizeof(mib2_udpEntry_t) == mibhdr->len);
+ assert(num_ent * sizeof(mib2_udpEntry_t) == mibhdr.len); + assert(num_ent * sizeof(mib2_udpEntry_t) == mibhdr.len);
for (i = 0; i < num_ent; i++) { for (i = 0; i < num_ent; i++, ude++) {
memcpy(&ude, databuf.buf + i * sizeof ude, sizeof ude);
#ifdef NEW_MIB_COMPLIANT #ifdef NEW_MIB_COMPLIANT
@@ -1355,7 +1354,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { processed_pid = ude->udpCreationProcess;
@@ -1271,7 +1270,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -416,7 +399,7 @@ index 919e76d..31d6f36 100644
} }
} }
#if defined(AF_INET6) #if defined(AF_INET6)
@@ -1388,7 +1387,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { @@ -1304,7 +1303,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -425,7 +408,7 @@ index 919e76d..31d6f36 100644
} }
} }
#endif #endif
@@ -1561,7 +1560,7 @@ psutil_net_if_stats(PyObject* self, PyObject* args) { @@ -1477,7 +1476,7 @@ psutil_net_if_stats(PyObject* self, PyObject* args) {
goto error; goto error;
if (PyDict_SetItemString(py_retdict, ksp->ks_name, py_ifc_info)) if (PyDict_SetItemString(py_retdict, ksp->ks_name, py_ifc_info))
goto error; goto error;
@ -435,10 +418,10 @@ index 919e76d..31d6f36 100644
} }
diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c
index beaba18..08b208d 100644 index 81d1b4a..adef70c 100644
--- a/psutil/_psutil_windows.c --- a/psutil/_psutil_windows.c
+++ b/psutil/_psutil_windows.c +++ b/psutil/_psutil_windows.c
@@ -221,7 +221,7 @@ psutil_pids(PyObject *self, PyObject *args) { @@ -307,7 +307,7 @@ psutil_pids(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_pid)) if (PyList_Append(py_retlist, py_pid))
goto error; goto error;
@ -447,7 +430,7 @@ index beaba18..08b208d 100644
} }
// free C array allocated for PIDs // free C array allocated for PIDs
@@ -1003,7 +1003,7 @@ psutil_per_cpu_times(PyObject *self, PyObject *args) { @@ -1019,7 +1019,7 @@ psutil_per_cpu_times(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -456,7 +439,7 @@ index beaba18..08b208d 100644
} }
free(sppi); free(sppi);
@@ -1156,7 +1156,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) { @@ -1237,7 +1237,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -465,43 +448,43 @@ index beaba18..08b208d 100644
CloseHandle(hThread); CloseHandle(hThread);
} }
@@ -1580,7 +1580,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { @@ -1695,7 +1695,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_conn_tuple)) if (PyList_Append(py_retlist, py_conn_tuple))
goto error; goto error;
- Py_DECREF(py_conn_tuple); - Py_DECREF(py_conn_tuple);
+ Py_CLEAR(py_conn_tuple); + Py_CLEAR(py_conn_tuple);
} }
}
free(table); else {
@@ -1667,7 +1667,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { @@ -1792,7 +1792,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_conn_tuple)) if (PyList_Append(py_retlist, py_conn_tuple))
goto error; goto error;
- Py_DECREF(py_conn_tuple); - Py_DECREF(py_conn_tuple);
+ Py_CLEAR(py_conn_tuple); + Py_CLEAR(py_conn_tuple);
} }
}
free(table); else {
@@ -1730,7 +1730,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { @@ -1866,7 +1866,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_conn_tuple)) if (PyList_Append(py_retlist, py_conn_tuple))
goto error; goto error;
- Py_DECREF(py_conn_tuple); - Py_DECREF(py_conn_tuple);
+ Py_CLEAR(py_conn_tuple); + Py_CLEAR(py_conn_tuple);
} }
}
free(table); else {
@@ -1793,7 +1793,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { @@ -1939,7 +1939,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_conn_tuple)) if (PyList_Append(py_retlist, py_conn_tuple))
goto error; goto error;
- Py_DECREF(py_conn_tuple); - Py_DECREF(py_conn_tuple);
+ Py_CLEAR(py_conn_tuple); + Py_CLEAR(py_conn_tuple);
} }
}
free(table); else {
@@ -2188,8 +2188,8 @@ psutil_net_io_counters(PyObject *self, PyObject *args) { @@ -2331,8 +2331,8 @@ psutil_net_io_counters(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItem(py_retdict, py_nic_name, py_nic_info)) if (PyDict_SetItem(py_retdict, py_nic_name, py_nic_info))
goto error; goto error;
@ -512,7 +495,7 @@ index beaba18..08b208d 100644
free(pIfRow); free(pIfRow);
pCurrAddresses = pCurrAddresses->Next; pCurrAddresses = pCurrAddresses->Next;
@@ -2304,7 +2304,7 @@ psutil_disk_io_counters(PyObject *self, PyObject *args) { @@ -2446,7 +2446,7 @@ psutil_disk_io_counters(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItemString(py_retdict, szDeviceDisplay, py_tuple)) if (PyDict_SetItemString(py_retdict, szDeviceDisplay, py_tuple))
goto error; goto error;
@ -521,7 +504,7 @@ index beaba18..08b208d 100644
next: next:
CloseHandle(hDevice); CloseHandle(hDevice);
@@ -2461,7 +2461,7 @@ psutil_disk_partitions(PyObject *self, PyObject *args) { @@ -2603,7 +2603,7 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
goto error; goto error;
} }
@ -530,7 +513,7 @@ index beaba18..08b208d 100644
// Continue looking for more mount points // Continue looking for more mount points
mp_flag = FindNextVolumeMountPoint(mp_h, mp_buf, MAX_PATH); mp_flag = FindNextVolumeMountPoint(mp_h, mp_buf, MAX_PATH);
@@ -2486,7 +2486,7 @@ psutil_disk_partitions(PyObject *self, PyObject *args) { @@ -2628,7 +2628,7 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -539,7 +522,7 @@ index beaba18..08b208d 100644
goto next; goto next;
next: next:
@@ -2610,9 +2610,9 @@ psutil_users(PyObject *self, PyObject *args) { @@ -2758,9 +2758,9 @@ psutil_users(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -552,7 +535,7 @@ index beaba18..08b208d 100644
} }
WTSFreeMemory(sessions); WTSFreeMemory(sessions);
@@ -2838,8 +2838,8 @@ psutil_proc_memory_maps(PyObject *self, PyObject *args) { @@ -2992,8 +2992,8 @@ psutil_proc_memory_maps(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -561,9 +544,9 @@ index beaba18..08b208d 100644
+ Py_CLEAR(py_tuple); + Py_CLEAR(py_tuple);
+ Py_CLEAR(py_str); + Py_CLEAR(py_str);
} }
previousAllocationBase = (ULONGLONG)basicInfo.AllocationBase; previousAllocationBase = basicInfo.AllocationBase;
baseAddress = (PCHAR)baseAddress + basicInfo.RegionSize; baseAddress = (PCHAR)baseAddress + basicInfo.RegionSize;
@@ -2889,8 +2889,8 @@ psutil_ppid_map(PyObject *self, PyObject *args) { @@ -3043,8 +3043,8 @@ psutil_ppid_map(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItem(py_retdict, py_pid, py_ppid)) if (PyDict_SetItem(py_retdict, py_pid, py_ppid))
goto error; goto error;
@ -574,7 +557,7 @@ index beaba18..08b208d 100644
} while (Process32Next(handle, &pe)); } while (Process32Next(handle, &pe));
} }
@@ -2993,8 +2993,8 @@ psutil_net_if_addrs(PyObject *self, PyObject *args) { @@ -3147,8 +3147,8 @@ psutil_net_if_addrs(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -585,7 +568,7 @@ index beaba18..08b208d 100644
} }
// find out the IP address associated with the NIC // find out the IP address associated with the NIC
@@ -3070,14 +3070,14 @@ psutil_net_if_addrs(PyObject *self, PyObject *args) { @@ -3224,14 +3224,14 @@ psutil_net_if_addrs(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -604,7 +587,7 @@ index beaba18..08b208d 100644
pCurrAddresses = pCurrAddresses->Next; pCurrAddresses = pCurrAddresses->Next;
} }
@@ -3197,8 +3197,8 @@ psutil_net_if_stats(PyObject *self, PyObject *args) { @@ -3351,8 +3351,8 @@ psutil_net_if_stats(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItem(py_retdict, py_nic_name, py_ifc_info)) if (PyDict_SetItem(py_retdict, py_nic_name, py_ifc_info))
goto error; goto error;

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -1,18 +1,19 @@
%global srcname psutil %global srcname psutil
%global sum A process and system utilities module for Python %global sum A process and system utilities module for Python
%if 0%{?rhel} > 7
# Disable python2 build by default
%bcond_with python2
%else
%bcond_without python2
%endif
# Filter Python modules from Provides # Filter Python modules from Provides
%global __provides_exclude_from ^(%{python2_sitearch}|%{python3_sitearch})/.*\\.so$ %global __provides_exclude_from ^(%{python2_sitearch}|%{python3_sitearch})/.*\\.so$
# Prepared for Python 2 removal
%bcond_with python2
# Possibility to disable tests
%bcond_with tests
Name: python-%{srcname} Name: python-%{srcname}
Version: 5.6.4 Version: 5.4.3
Release: 4%{?dist} Release: 11%{?dist}
Summary: %{sum} Summary: %{sum}
License: BSD License: BSD
@ -24,33 +25,7 @@ Source0: https://github.com/giampaolo/psutil/archive/release-%{version}.t
# and https://github.com/giampaolo/psutil/commit/3a9bccfd2c6d2e6538298cd3892058b1204056e0 # and https://github.com/giampaolo/psutil/commit/3a9bccfd2c6d2e6538298cd3892058b1204056e0
Patch0: CVE-2019-18874.patch Patch0: CVE-2019-18874.patch
# Exclude i686 arch. Due to a modularity issue it's being added to the
# x86_64 compose of CRB, but we don't want to ship it at all.
# See: https://projects.engineering.redhat.com/browse/RCM-72605
ExcludeArch: i686
BuildRequires: gcc
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-rpm-macros
# Test dependencies
%if %{with tests}
BuildRequires: procps-ng BuildRequires: procps-ng
BuildRequires: python%{python3_pkgversion}-mock
%endif
%if %{with python2}
%if 0%{?fedora} < 32
BuildRequires: python2-mock
BuildRequires: python2-devel
BuildRequires: python2-ipaddress
%else
# This package has an exception to use Python 2 in Fedora 32+
# The exception is for chromium (chrome-remote-desktop)
# https://pagure.io/fesco/issue/2214
BuildRequires: python27
BuildRequires: python2-setuptools
%endif
%endif
%description %description
psutil is a module providing an interface for retrieving information on all psutil is a module providing an interface for retrieving information on all
@ -63,6 +38,11 @@ ifconfig, nice, ionice, iostat, iotop, uptime, pidof, tty, who, taskset, pmap.
%if %{with python2} %if %{with python2}
%package -n python2-%{srcname} %package -n python2-%{srcname}
Summary: %{sum} Summary: %{sum}
BuildRequires: python2-devel
BuildRequires: python2-mock
BuildRequires: python2-ipaddress
%{?python_provide:%python_provide python2-%{srcname}} %{?python_provide:%python_provide python2-%{srcname}}
Obsoletes: python-%{srcname} < 3.1.1-3 Obsoletes: python-%{srcname} < 3.1.1-3
@ -72,10 +52,14 @@ running processes and system utilization (CPU, memory, disks, network, users) in
a portable way by using Python 3, implementing many functionalities offered by a portable way by using Python 3, implementing many functionalities offered by
command line tools such as: ps, top, df, kill, free, lsof, free, netstat, command line tools such as: ps, top, df, kill, free, lsof, free, netstat,
ifconfig, nice, ionice, iostat, iotop, uptime, pidof, tty, who, taskset, pmap. ifconfig, nice, ionice, iostat, iotop, uptime, pidof, tty, who, taskset, pmap.
%endif %endif # with python2
%package -n python%{python3_pkgversion}-psutil %package -n python%{python3_pkgversion}-psutil
Summary: %{sum} Summary: %{sum}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-mock
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
%description -n python%{python3_pkgversion}-psutil %description -n python%{python3_pkgversion}-psutil
@ -100,25 +84,23 @@ done
%build %build
%if %{with python2} %if %{with python2}
%py2_build %py2_build
%endif %endif # with python2
%py3_build %py3_build
%install %install
%if %{with python2} %if %{with python2}
%py2_install %py2_install
%endif %endif # with python2
%py3_install %py3_install
%check #%check
%if %{with tests} # the main test target causes failures, investigating
%if %{with python2} && 0%{?fedora} < 32 %if %{with python2}
make test-memleaks PYTHON=%{__python2} #make test-memleaks PYTHON=%{__python2}
%endif %endif # with python2
make test-memleaks PYTHON=%{__python3} #make test-memleaks PYTHON=%{__python3}
%endif
%if %{with python2} %if %{with python2}
%files -n python2-%{srcname} %files -n python2-%{srcname}
@ -126,7 +108,7 @@ make test-memleaks PYTHON=%{__python3}
%doc CREDITS HISTORY.rst README.rst %doc CREDITS HISTORY.rst README.rst
%{python2_sitearch}/%{srcname}/ %{python2_sitearch}/%{srcname}/
%{python2_sitearch}/*.egg-info %{python2_sitearch}/*.egg-info
%endif %endif # with python2
%files -n python%{python3_pkgversion}-%{srcname} %files -n python%{python3_pkgversion}-%{srcname}
@ -137,47 +119,28 @@ make test-memleaks PYTHON=%{__python3}
%changelog %changelog
* Mon Jul 26 2021 Charalampos Stratakis <cstratak@redhat.com> - 5.6.4-4 * Mon Jul 26 2021 Charalampos Stratakis <cstratak@redhat.com> - 5.4.3-11
- Security fix for CVE-2019-18874: double free because of refcount mishandling - Security fix for CVE-2019-18874: double free because of refcount mishandling
Resolves: rhbz#1772014 Resolves: rhbz#1772014
* Thu Dec 12 2019 Tomas Orsava <torsava@redhat.com> - 5.6.4-3 * Mon Aug 05 2019 Athos Ribeiro <athos@redhat.com> - 5.4.3-10
- Exclude unsupported i686 arch - Smoke tests shall only run unicode tests
* Wed Nov 20 2019 Lumír Balhar <lbalhar@redhat.com> - 5.6.4-2 * Mon Aug 05 2019 Athos Ribeiro <athos@redhat.com> - 5.4.3-9
- Adjusted for Python 3.8 module in RHEL 8 - Skip failing tests
* Wed Nov 06 2019 Lumír Balhar <lbalhar@redhat.com> - 5.6.4-1 * Mon Aug 05 2019 Athos Ribeiro <athos@redhat.com> - 5.4.3-8
- New upstream release 5.6.4 - Add test content
- bcond for Python 2 subpackage and tests
- Enabled tests
* Sun Oct 06 2019 Kevin Fenzi <kevin@scrye.com> - 5.6.3-5 * Mon Aug 05 2019 Athos Ribeiro <athos@redhat.com> - 5.4.3-7
- Add python2-setuptools to BuildRequires to fix egg info. Fixes bug #1750362 - Bump release
- Rebuild for rhel 8 gating for rhbz#1720647
* Tue Sep 03 2019 Miro Hrončok <mhroncok@redhat.com> - 5.6.3-4 * Tue Jun 18 2019 Athos Ribeiro <athos@redhat.com> - 5.4.3-6
- Reduce unused build dependencies - Bump release
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 5.6.3-3 * Tue Jun 05 2018 Charalampos Stratakis <cstratak@redhat.com> - 5.4.3-5
- Rebuilt for Python 3.8 - Conditionalize the python2 subpackage
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.6.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Jun 30 2019 Kevin Fenzi <kevin@scrye.com> - 5.6.3-1
- Update to 5.6.3 Fixes bug #1567102
* Thu Feb 28 2019 Yatin Karel <ykarel@redhat.com> - 5.5.1-1
- Update to 5.5.1 (Resolves #1567102)
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Sun Jun 17 2018 Miro Hrončok <mhroncok@redhat.com> - 5.4.3-5
- Rebuilt for Python 3.7
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.3-4 * Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (psutil-5.4.3.tar.gz) = e94a8f184000fa43ad8490badea6838b82e17d1a0f5e17cc61658dcac4eb841782bd393faf056de6e6ad26d04415a68bef59361ae2e0f77f822bb4ed37d84247

8
tests/smoke/runtest.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
set -e
MODULE_PATH=`python3 -c "import psutil; print(psutil.__file__)"`
TESTDIR=`dirname $MODULE_PATH`/tests
python3 $TESTDIR/test_unicode.py

12
tests/tests.yml Normal file
View File

@ -0,0 +1,12 @@
---
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- atomic
- classic
required_packages:
- python3-mock
- python3-psutil
tests:
- smoke