[issue20777] PyArg_ParseTupleAndKeywords does not respect arguments format.
Carlos Ferreira added the comment: Solved. This issue had nothing to do with Python API. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20777] PyArg_ParseTupleAndKeywords does not respect arguments format.
New submission from Carlos Ferreira: PyArg_ParseTupleAndKeywords is not respecting the format string sy*ss When using the format sbss with the following valid arguments enp0s8, 0, 08:00:27:da:b3:47, 08:00:27:11:22:33 there is no error and the function succeeds in parsing the arguments. But when passing the following valid arguments, 8bf2f93c-8f44-4960-a2de-71f87130882e, bytes(list([0,0,0,1])), 08:00:27:11:22:33, 10.0.0.3 it will fail stating that the 3rd argument has a null character. -- components: Extension Modules messages: 212236 nosy: Claymore priority: normal severity: normal status: open title: PyArg_ParseTupleAndKeywords does not respect arguments format. type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20777] PyArg_ParseTupleAndKeywords does not respect arguments format.
Carlos Ferreira added the comment: (Please ignore the previous post) PyArg_ParseTupleAndKeywords is not respecting the format string sy*ss When using the format sbss with the following valid arguments enp0s8, 0, 08:00:27:da:b3:47, 08:00:27:11:22:33 there is no error and the function succeeds in parsing the arguments. But when using the format sy*ss with the following valid arguments, 8bf2f93c-8f44-4960-a2de-71f87130882e, bytes(list([0,0,0,1])), 08:00:27:11:22:33, 10.0.0.3 it will fail stating that the 3rd argument has a null character. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20777 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17794] Priority Queue
New submission from Carlos Ferreira: I'm using Priority Queues and followed the Python documentation for a simple example. From Queue documentation in Python 3.3 http://docs.python.org/3.3/library/queue.html The lowest valued entries are retrieved first (the lowest valued entry is the one returned by sorted(list(entries))[0]). A typical pattern for entries is a tuple in the form: (priority_number, data). Then I tried this simple code. pq = PriorityQueue() pq.put_nowait((0, {'a':1})) pq.put_nowait((0, {'a':2})) Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python3.3/queue.py, line 187, in put_nowait return self.put(item, block=False) File /usr/lib/python3.3/queue.py, line 146, in put self._put(item) File /usr/lib/python3.3/queue.py, line 230, in _put heappush(self.queue, item) TypeError: unorderable types: dict() dict() Is this a normal behaviour? I'm not sure if this should be declared as a bug... Instead of sticking to the first argument that indicates the priority, the heapq algorithm checks the second field and tries to order the dictionaries. I solved this annoyance by adding a third field, the object ID. Since the object ID is actually its address in memory, every object will have a different ID. Also, since the queue entries will have the same priority (zero), the id value is used to order the tuples in the heap queue. pq = PriorityQueue() a = {'a':1} b = {'a':2} pq.put_nowait((0, id(a), a)) pq.put_nowait((0, id(b), b)) -- components: Interpreter Core messages: 187321 nosy: Claymore priority: normal severity: normal status: open title: Priority Queue type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17794 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16621] sched module enhancement request
New submission from Carlos Ferreira: The sched module available in the Python core lacks a simple but very useful which is waiting for new events scheduling. Current version only process events that are present in the queue before the schedule.run() is issued or for events that are schedule while the scheduler is still active and processing events from the queue. I propose a simple enhancement, by using an Event object from the threading module, so that the thread that is running the scheduler, waits for new events scheduling, after finishing processing all queued events. The sched2.py is a modified version of the original sched.py (modified by means of a large hammer), which adds an alwaysRunning argument in the object constructor, a self.wakeUpEvent attribute which is the Event Object, a modified eterabs method to call the Event.set() and finally, a modified run() to wait for new events. This modification is just a quick patch in order to pass the idea of what is being requested here. If there is a better way to do this, then it should be taken. -- components: Library (Lib) files: sched2.py messages: 177002 nosy: carlosmf.pt priority: normal severity: normal status: open title: sched module enhancement request type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file28214/sched2.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16621 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16621] sched module enhancement request
Changes by Carlos Ferreira carlosmf...@gmail.com: Removed file: http://bugs.python.org/file28214/sched2.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16621 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16621] sched module enhancement request
Carlos Ferreira added the comment: Sorry, wrong file issued before... -- Added file: http://bugs.python.org/file28215/sched2.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16621 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com