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

to_html() got an unexpected keyword argument 'wrap_slash' #2504

Closed
Gustry opened this Issue Dec 4, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@Gustry
Contributor

Gustry commented Dec 4, 2015

When I add a layer, I often got this error message :
layer

  • QGIS 2.12
  • InaSAFE develop

@Gustry Gustry added the Bug label Dec 4, 2015

@timlinux

This comment has been minimized.

Show comment
Hide comment
@timlinux

timlinux Dec 5, 2015

Contributor

Can you replicate this on a clean start of QGIS?

Contributor

timlinux commented Dec 5, 2015

Can you replicate this on a clean start of QGIS?

@borysiasty

This comment has been minimized.

Show comment
Hide comment
@borysiasty

borysiasty Dec 6, 2015

Contributor

To replicate, please open the volcano_krb.shp test layer. While opening, it fails to display the layer metadata in the dock (for the same result the wizard test #2494 fails when it attempts to display the summary):

File "/home/borys/sources/inasafe/safe/messaging/item/cell.py", line 121, in to_html
wrap_slash=self.wrap_slash))
TypeError: to_html() got an unexpected keyword argument 'wrap_slash'

The reason is nested tables in the keywords html representation. Cell.to_html() calls self.content.to_html() with wrap_slash keyword argument. The self.content may be instance of either safe.messaging.item.text.Text or safe.messaging.item.table.Table (for nested tables). The latter doesn't support the wrap_slash argument.

The easiest fix would be to add this argument to the safe.messaging.item.table.Table.to_html() method.

Contributor

borysiasty commented Dec 6, 2015

To replicate, please open the volcano_krb.shp test layer. While opening, it fails to display the layer metadata in the dock (for the same result the wizard test #2494 fails when it attempts to display the summary):

File "/home/borys/sources/inasafe/safe/messaging/item/cell.py", line 121, in to_html
wrap_slash=self.wrap_slash))
TypeError: to_html() got an unexpected keyword argument 'wrap_slash'

The reason is nested tables in the keywords html representation. Cell.to_html() calls self.content.to_html() with wrap_slash keyword argument. The self.content may be instance of either safe.messaging.item.text.Text or safe.messaging.item.table.Table (for nested tables). The latter doesn't support the wrap_slash argument.

The easiest fix would be to add this argument to the safe.messaging.item.table.Table.to_html() method.

borysiasty added a commit to borysiasty/inasafe that referenced this issue Dec 6, 2015

@borysiasty borysiasty referenced this issue Dec 6, 2015

Closed

Fix #2504 #2506

@Gustry

This comment has been minimized.

Show comment
Hide comment
@Gustry

Gustry Dec 7, 2015

Contributor

Yes this error happens with volcano_krb.shp for instance, with a clean start of QGIS.
According to my unit test in pycharm, tests are failing according to this issue also.

Thanks @borysiasty to have a look on this issue.

Contributor

Gustry commented Dec 7, 2015

Yes this error happens with volcano_krb.shp for instance, with a clean start of QGIS.
According to my unit test in pycharm, tests are failing according to this issue also.

Thanks @borysiasty to have a look on this issue.

timlinux added a commit to timlinux/inasafe that referenced this issue Dec 7, 2015

fix #2504 - exception raised when messaging cell contains nested tabl…
…e or bullet list due to slashes param not being accepted by table class to_html() method.

@timlinux timlinux assigned timlinux and unassigned borysiasty Dec 7, 2015

@timlinux

This comment has been minimized.

Show comment
Hide comment
@timlinux

timlinux Dec 7, 2015

Contributor

Thanks for the diagnostics @borysiasty and @Gustry - I've made an alternative fix with PR #2508

Contributor

timlinux commented Dec 7, 2015

Thanks for the diagnostics @borysiasty and @Gustry - I've made an alternative fix with PR #2508

timlinux added a commit to timlinux/inasafe that referenced this issue Dec 7, 2015

fix #2504 - exception raised when messaging cell contains nested tabl…
…e or bullet list due to slashes param not being accepted by table class to_html() method.

@timlinux timlinux closed this in #2508 Dec 7, 2015

@timlinux timlinux removed the Needs review label Dec 7, 2015

timlinux added a commit that referenced this issue Dec 7, 2015

Merge pull request #2508 from timlinux/fix-2504
Better fix for #2504 - exception when calling Table.to_html() method

ismailsunni added a commit to ismailsunni/inasafe that referenced this issue Dec 22, 2015

timlinux added a commit to ismailsunni/inasafe that referenced this issue Dec 22, 2015

fix #2504 - exception raised when messaging cell contains nested tabl…
…e or bullet list due to slashes param not being accepted by table class to_html() method.

@timlinux timlinux assigned ismailsunni and unassigned timlinux Dec 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment