Registry / testing / mozprofile

mozprofile

JSON →
library3.0.0pypypi✓ verified 84d ago

Library to create and modify Mozilla application profiles. Version 3.0.0 is the latest. Release cadence is irregular, often tied to Mozilla development cycles.

pip install mozprofile
INSTALL
IMPORT
SIG · MOZPROFILE
M
mozprofile
testingpythonv3.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Profile
from mozprofile import Profile
from mozprofile.profile import Profile
Profile is exposed at top-level, not in submodule
FirefoxProfile
from mozprofile import FirefoxProfile

Creates a Firefox profile with a custom homepage preference.

from mozprofile import FirefoxProfile profile = FirefoxProfile() profile.set_preference('browser.startup.homepage', 'https://example.com') print(profile.profile)
Debug
Known issues
breakingIn version 3.0.0, the 'Profile' class is no longer directly instantiable; use 'FirefoxProfile' or 'ThunderbirdProfile' instead.
fix
Replace Profile() with FirefoxProfile() or appropriate subclass.
affects: >=3.0.0
deprecatedThe 'clone_profile' method is deprecated; use 'create_new_profile' with cloning parameters.
fix
Use profile.create_new_profile(clone_from=...) instead.
affects: >=2.5.0
gotchaProfile paths are temporary by default; they are deleted when the Profile object is garbage collected or the script ends.
fix
Call profile.cleanup() explicitly if you need to control deletion.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'mozprofile'
The library was installed in a different Python environment or not installed at all.
fix
Run 'pip install mozprofile' in the correct environment (e.g., virtualenv).
AttributeError: 'Profile' object has no attribute 'set_preference'
Using an older API where set_preference was not a direct method.
fix
Upgrade to latest mozprofile and use FirefoxProfile.set_preference().
OSError: [Errno 2] No such file or directory: '/tmp/...'
The temporary profile directory was deleted prematurely, possibly by a concurrent cleanup.
fix
Ensure no other process is cleaning up the same profile path; call profile.cleanup() only once.
Upgrade
Version history
3.0.0latest on PyPI · released Apr 26, 2024
Audit
Dependencies
mozfilerequiredFile operations for profile cleanup
mozlogrequiredLogging infrastructure
Agent activity
2 hits · last 30 days
node
2
Resources
mozprofile — pip install mozprofile · libregistry