Skip to content
Snippets Groups Projects
  • Olivier Delalleau's avatar
    139308b1
    Avoid infinite loop in `_get_full_key()` (#602) · 139308b1
    Olivier Delalleau authored
    
    * Avoid infinite loop in `_get_full_key()`
    
    When there was a cycle when iterating over parents of a node,
    `_get_full_key()` would get into an infinite loop.
    
    This commit detects this situation to raise an explicit exception
    instead.
    
    In addition, `format_and_raise()` is modified to *not* raise exceptions
    when trying to obtain the full key, so as to avoid hiding the original
    exception with a different error. Instead, any exception raised when
    trying to obtain the full key is displayed on the "full key" line of the
    error message.
    
    * Fix tests with Python 3.6
    
    The error message is inconsistent in that Python version.
    
    * Make test more robust
    
    * Update omegaconf/_utils.py
    
    Co-authored-by: default avatarOmry Yadan <omry@fb.com>
    
    * Fully test the new error message
    
    * Introduce new exception type ConfigCycleDetectedException
    
    Co-authored-by: default avatarOmry Yadan <omry@fb.com>
    Avoid infinite loop in `_get_full_key()` (#602)
    Olivier Delalleau authored
    
    * Avoid infinite loop in `_get_full_key()`
    
    When there was a cycle when iterating over parents of a node,
    `_get_full_key()` would get into an infinite loop.
    
    This commit detects this situation to raise an explicit exception
    instead.
    
    In addition, `format_and_raise()` is modified to *not* raise exceptions
    when trying to obtain the full key, so as to avoid hiding the original
    exception with a different error. Instead, any exception raised when
    trying to obtain the full key is displayed on the "full key" line of the
    error message.
    
    * Fix tests with Python 3.6
    
    The error message is inconsistent in that Python version.
    
    * Make test more robust
    
    * Update omegaconf/_utils.py
    
    Co-authored-by: default avatarOmry Yadan <omry@fb.com>
    
    * Fully test the new error message
    
    * Introduce new exception type ConfigCycleDetectedException
    
    Co-authored-by: default avatarOmry Yadan <omry@fb.com>