Closed Bug 872138 Opened 12 years ago Closed 12 years ago

mozfile.NamedTemporaryFile API updates

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: k0scist, Assigned: k0scist)

References

Details

Attachments

(1 file)

From https://bugzilla.mozilla.org/show_bug.cgi?id=790765#c35 and https://bugzilla.mozilla.org/show_bug.cgi?id=790765#c36 : New file APIs are needed for mozfile.NamedTemporaryFile: - should be (line) iterable (i.e. a generator with __iter__ and next in the ususal way - should take delete=False Relevent tracebacks: ====================================================================== ERROR: test_schema_version (bug785146.PermissionsTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/jhammel/mozilla/src/mozilla-central/testing/mozbase/mozprofile/tests/bug785146.py", line 41, in test_schema_version perms.write_db(self.locations_file) File "/home/jhammel/mozilla/src/mozilla-central/testing/mozbase/mozprofile/mozprofile/permissions.py", line 247, in write_db for location in locations: TypeError: 'NamedTemporaryFile' object is not iterable ---------------------------------------------------------------------- ====================================================================== ERROR: test_prefs_write (test_preferences.PreferencesTest) test that the Preferences.write() method correctly serializes preferences ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/jhammel/mozilla/src/mozilla-central/testing/mozbase/mozprofile/tests/test_preferences.py", line 237, in test_prefs_write with mozfile.NamedTemporaryFile(suffix='.js', delete=False) as f: TypeError: __init__() got an unexpected keyword argument 'delete'
Blocks: 790765
Following this (and ensuring m-c is okay) this should be version bumped and mirrored to m-c for bug 790765
Found https://bugzilla.mozilla.org/show_bug.cgi?id=872230 while working. Luckily, I don't think we care about it for this bug.
Attached patch fix these thingsSplinter Review
a version bump and mirroring (possibly to be done with other code) is still needed following checkin
Attachment #749497 - Flags: review?(jgriffin)
Assignee: nobody → jhammel
Blocks: 872285
Comment on attachment 749497 [details] [diff] [review] fix these things Review of attachment 749497 [details] [diff] [review]: ----------------------------------------------------------------- cool, lgtm!
Attachment #749497 - Flags: review?(jgriffin) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Will bump mozfile -> 0.7 for this
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: