-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ID Namespace Example causes warning #209
Comments
Another comment: The My interim solution is to import them with separate names: from stix.utils import set_id_namespace as stix_sin
from cybox.utils import set_id_namespace as cybox_sin |
The warning issue was fixed in bd831c0. Also, warnings can be filtered such that you can ignore them if you want [1][2][3]. I felt it was important to raise a potential issue to producers about their output without actually aborting on the process so I chose warnings as a solution, with the knowledge that developers can ignore them. They also print to [1] https://docs.python.org/2/library/warnings.html#available-context-managers |
As for function names, I don't see a need to rename them as they are namespaced/packaged appropriately. There are a number of ways you could have addressed this via import statements, including your own. import cybox.utils
import stix.utils
cybox.utils.set_id_namespace(...)
stix.utils.set_id_namespace(...) import cybox.utils as cybox_utils
import stix.utils as stix_utils
cybox_utils.set_id_namespace(...)
stix_utils.set_id_namespace(...) I am going to close this out since there are fixes already in place for your specific warning, and workarounds available for those who want to filter Python warnings. |
Agree with the close. The warning was the issue, which seems to have been fixed. Thanks! |
When running the example for ID Namespaces [1], I get the following warning:
site-packages\stix\utils\nsparser.py:161: UserWarning: Unable to map namespace 'http://MY-NAMESPACE.com' to schemaLocation "schemaLocation" % ns)
Valid XML is produced, so I'm really just filing this issue about the warning. My guess is that ID namespaces don't really need to be present in the schemaLocation element.
This is probably a pretty low priority.
-Mark
[1] http://stix.readthedocs.org/en/latest/examples/index.html#id-namespaces
The text was updated successfully, but these errors were encountered: