Crash in os.environ.clear() with empty environment key
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python |
New
|
Unknown
|
|||
apport (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
python2.7 (Ubuntu) |
Confirmed
|
Medium
|
Unassigned | ||
python3.3 (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
% ubuntu-bug apport
Traceback (most recent call last):
File "/usr/share/
app.run_argv()
File "/usr/lib/
return self.run_
File "/usr/lib/
self.
File "/usr/lib/
os.
File "/usr/lib/
self.popitem()
File "/usr/lib/
del self[key]
File "/usr/lib/
self.
OSError: [Errno 22] Invalid argument
Looking at the output of `os.environ`, there is a odd entry (key '').
os.environ.clear() fails both with python2.7 and python3:
In [1]: import os
In [2]: os.environ[''] = ''
In [3]: os.environ.clear()
-------
OSError Traceback (most recent call last)
<ipython-
----> 1 os.environ.clear()
/usr/lib/
551 try:
552 while True:
--> 553 self.popitem()
554 except KeyError:
555 pass
/usr/lib/
544 raise KeyError
545 value = self[key]
--> 546 del self[key]
547 return key, value
548
/usr/lib/
685 def __delitem__(self, key):
686 encodedkey = self.encodekey(key)
--> 687 self.unsetenv(
688 try:
689 del self._data[
OSError: [Errno 22] Invalid argument
While this looks like a bug to be fixed in Python also, apport should handle it gracefully, and not crash/abort on it.
ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: apport 2.12.5-0ubuntu2.2
ProcVersionSign
Uname: Linux 3.11.0-15-generic x86_64
ApportVersion: 2.12.5-0ubuntu2.2
Architecture: amd64
CrashReports:
640:1000:
640:1000:
640:1000:
Date: Mon Feb 17 13:41:48 2014
InstallationDate: Installed on 2012-05-28 (629 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
MarkForUpload: True
PackageArchitec
SourcePackage: apport
UpgradeStatus: Upgraded to saucy on 2013-10-08 (131 days ago)
modified.
mtime.conffile.
Changed in python: | |
status: | Unknown → New |
Changed in python2.7 (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in python3.3 (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Confirmed |
This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.