Message7558

Author ajdavis
Recipients ajdavis
Date 2012-12-29.18:36:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1356806172.77.0.608024060056.issue2001@psf.upfronthosting.co.za>
In-reply-to
Content
The deque docs say that "Deques support thread-safe, memory efficient appends and pops from either side of the deque", but deque.popleft() isn't thread-safe. Under some circumstances the attached script throws a NullPointerException:

Exception in thread Thread:Traceback (most recent call last):
  File "/Users/emptysquare/jython2.5.2/Lib/threading.py", line 179, in _Thread__bootstrap
    self.run()
  File "/Users/emptysquare/jython2.5.2/Lib/threading.py", line 170, in run
    self._target(*self._args, **self._kwargs)
  File "deque_play.py", line 9, in f
    q.popleft()
NullPointerException: java.lang.NullPointerException

... under others it simply throws "IndexError: pop from an empty deque". Either error is wrong and inconsistent with the docs and with CPython's behavior.
History
Date User Action Args
2012-12-29 18:36:12ajdavissetrecipients: + ajdavis
2012-12-29 18:36:12ajdavissetmessageid: <1356806172.77.0.608024060056.issue2001@psf.upfronthosting.co.za>
2012-12-29 18:36:12ajdavislinkissue2001 messages
2012-12-29 18:36:12ajdaviscreate