Skip to content

Fixed a bug with ALLOW_EMPTY_STRING_KEYS#71

Closed
Qmando wants to merge 1 commit into
dpath-maintainers:masterfrom
Qmando:master
Closed

Fixed a bug with ALLOW_EMPTY_STRING_KEYS#71
Qmando wants to merge 1 commit into
dpath-maintainers:masterfrom
Qmando:master

Conversation

@Qmando

@Qmando Qmando commented Jul 2, 2018

Copy link
Copy Markdown

Prevents the following error:

  File "/.../local/lib/python2.7/site-packages/dpath/path.py", line 90, in paths
    elif (skip and k[0] == '+'):
IndexError: string index out of range

This occurs because if the path is empty but you HAVE set allow_empty_strings, the elif clause will attempt to check k[0]. We want the empty if and option if to be separate, to no longer trigger the elif check.

@danielpops danielpops left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Qmando Qmando changed the title Fixed a bug with ALLOW_EMPTY_PATHS Fixed a bug with ALLOW_EMPTY_STRING_KEYS Jul 2, 2018
@akesterson

Copy link
Copy Markdown
Collaborator

Fixed in #96, thanks for the report, there were a couple of competing fixes for this. We took the one from #74

@akesterson akesterson closed this Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants