Issue 10094: test_urllib.py fails in py3k r85440 with RuntimeError (original) (raw)

Created on 2010-10-13 22:46 by barry, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
10094.txt barry,2010-10-14 18:09
Messages (9)
msg118598 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-10-13 22:46
Running the test suite on py3k r85440, I get the following failure: ====================================================================== ERROR: test_getproxies_environment_keep_no_proxies (__main__.ProxyTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_urllib.py", line 121, in setUp for k in os.environ.keys(): File "/home/barry/projects/python/py3k/Lib/_abcoll.py", line 410, in __iter__ for key in self._mapping: File "/home/barry/projects/python/py3k/Lib/os.py", line 441, in __iter__ for key in self._data: RuntimeError: dictionary changed size during iteration This is consistent (i.e. fails every time) on Ubuntu 10.10 amd64.
msg118669 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-10-14 15:27
This may not be a Python bug. The failure is consistent on all Ubuntu 10.10 machines I've tried, including both i386 and x86_64 platforms. I've gone back many svn revisions and even pulled down earlier alpha tarballs and the failure is consistent. This does *not* fail on the one Ubuntu 10.04 x86_64 VM I've tried. Will try on Debian squeeze next.
msg118670 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2010-10-14 15:30
I have seen this in very inconsistent manner.
msg118671 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-10-14 15:35
Senthil, can you provide any additional information on where/when you've seen this? AFAICT, test_urllib.py is the only test it shows up, but it's totally consistent. What OS/platforms have you seen this happen on? Same test or different one?
msg118696 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2010-10-14 17:19
I had seen with test_urllib, but it was inconsistent for me. Sometimes make distclean and run had worked fine. This was on Ubuntu 10.04, Intel 64 bit. It is surprising, if it is seen consistently on Ubuntu 10.10 ( I have not upgraded to this yet, so have not tried).
msg118705 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-10-14 18:09
The problem occurs on Ubuntu 10.10 because there's a new environment variable called $UBUNTU_MENUPROXY in the default user environment. This is why it suddenly showed up in Python 3.1 and why it does not occur on other OS (even Ubuntu 10.04). ProxyTests.setUp() conditional is too naive. Will attach patch, commit and backport.
msg118710 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-10-14 18:29
Er, this patch is horrible. You should fix the generic bug, not workaround it on your particular environment. The test still fails with NO_PROXY: $ NO_PROXY=1 ./python -m test.regrtest test_urllib [1/1] test_urllib Warning -- os.environ was modified by test_urllib test test_urllib failed -- Traceback (most recent call last): File "/home/antoine/py3k/__svn__/Lib/test/test_urllib.py", line 121, in setUp for k in os.environ.keys(): File "/home/antoine/py3k/__svn__/Lib/_abcoll.py", line 410, in __iter__ for key in self._mapping: File "/home/antoine/py3k/__svn__/Lib/os.py", line 441, in __iter__ for key in self._data: RuntimeError: dictionary changed size during iteration
msg118711 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-10-14 18:32
Fixed in r85489, please backport.
msg119571 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-10-25 19:30
This was already backported but the issue wasn't closed.
History
Date User Action Args
2022-04-11 14:57:07 admin set github: 54303
2010-10-25 19:30:05 barry set status: open -> closedresolution: fixedmessages: +
2010-10-14 18:32:07 pitrou set messages: + versions: - Python 3.2
2010-10-14 18:29:57 pitrou set status: closed -> opennosy: + pitroumessages: + assignee: barryresolution: fixed -> (no value)
2010-10-14 18:24:18 barry set status: open -> closedresolution: fixed
2010-10-14 18:09:25 barry set versions: + Python 3.1
2010-10-14 18:09:10 barry set files: + 10094.txtmessages: +
2010-10-14 17:19:39 orsenthil set messages: + title: test_urllib.py fails with RuntimeError on Ubuntu 10.10 -> test_urllib.py fails in py3k r85440 with RuntimeError
2010-10-14 16:17:57 barry set title: test_urllib.py fails in py3k r85440 with RuntimeError -> test_urllib.py fails with RuntimeError on Ubuntu 10.10
2010-10-14 15:35:24 barry set messages: +
2010-10-14 15:30:21 orsenthil set nosy: + orsenthilmessages: +
2010-10-14 15:27:53 barry set messages: +
2010-10-13 22:46:20 barry create