ConfigSchema should provide an interface for constructing from a string

Bug #309859 reported by Barry Warsaw
2
Affects Status Importance Assigned to Milestone
lazr.config
Fix Released
Medium
Barry Warsaw

Bug Description

ConfigSchema.__init__() takes a filename argument. This can cause problems if your schema file lives inside an egg. You'd like to use pkg_resource.resource_string() to get the schema as a string, but this can't be passed to ConfigSchema's constructor. Okay, you can use pkg_resource.resource_filename(), but that creates a cache file, which is kind of ugly.

ConfigSchema's constructor should accept a filename or file-like object.

Related branches

Revision history for this message
Barry Warsaw (barry) wrote :

Actually, the attached branch allows you to pass a file-like object to the ConfigSchema constructor. This will solve the problem by allowing you to pass in a StringIO wrapper around pkg_resource.resource_string().

Changed in lazr.config:
assignee: nobody → barry
importance: Undecided → Medium
status: New → In Progress
Barry Warsaw (barry)
Changed in lazr.config:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.