mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 06:56:13 +00:00
Thanks nexone for the report.
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
# History
|
# History
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
|
||||||
|
- Prevented crash in rst export with only-space strings (#469).
|
||||||
|
|
||||||
## 2.0.0 (2020-05-16)
|
## 2.0.0 (2020-05-16)
|
||||||
|
|
||||||
### Breaking changes
|
### Breaking changes
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ def _max_word_len(text):
|
|||||||
>>> _max_word_len('Python Module for Tabular Datasets')
|
>>> _max_word_len('Python Module for Tabular Datasets')
|
||||||
8
|
8
|
||||||
"""
|
"""
|
||||||
return max(len(word) for word in text.split()) if text else 0
|
return max([len(word) for word in text.split()], default=0) if text else 0
|
||||||
|
|
||||||
|
|
||||||
class ReSTFormat:
|
class ReSTFormat:
|
||||||
|
|||||||
@@ -659,6 +659,7 @@ class RSTTests(BaseTestCase):
|
|||||||
data.headers = self.headers
|
data.headers = self.headers
|
||||||
data.append(self.john)
|
data.append(self.john)
|
||||||
data.append(('Wendy', '', 43))
|
data.append(('Wendy', '', 43))
|
||||||
|
data.append(('Esther', ' ', 31))
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
data.export('rst'),
|
data.export('rst'),
|
||||||
'========== ========= ===\n'
|
'========== ========= ===\n'
|
||||||
@@ -666,6 +667,7 @@ class RSTTests(BaseTestCase):
|
|||||||
'========== ========= ===\n'
|
'========== ========= ===\n'
|
||||||
'John Adams 90 \n'
|
'John Adams 90 \n'
|
||||||
'Wendy 43 \n'
|
'Wendy 43 \n'
|
||||||
|
'Esther 31 \n'
|
||||||
'========== ========= ==='
|
'========== ========= ==='
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user