Skip to content
Snippets Groups Projects
Commit 266d7c7d authored by nickolas360's avatar nickolas360
Browse files

Fix split_string(), version 1.14.2

parent 011be4bb
No related branches found
No related tags found
No related merge requests found
pyrcb
=====
 
Version 1.14.1
Version 1.14.2
 
**pyrcb** is a simple, self-contained, extendable library for building IRC
bots. It isn't a full implementation of IRC, but rather provides everything
Loading
Loading
@@ -24,11 +24,11 @@ Documentation for pyrcb is available at <https://pyrcb.readthedocs.io/>. If
you're new to pyrcb, start with [this guide] and take a look at the
[examples](examples/).
 
The current version of pyrcb is **1.14.1**, which was released on 2016-10-15.
The current version of pyrcb is **1.14.2**, which was released on 2016-12-11.
See the [changelog] for more information.
 
[this guide]: https://pyrcb.readthedocs.io/guide.html
[changelog]: https://pyrcb.readthedocs.io/release-notes/1.13/changelog.html
[changelog]: https://pyrcb.readthedocs.io/release-notes/1.14/changelog.html
 
Tests
-----
Loading
Loading
Loading
Loading
@@ -88,7 +88,7 @@ author = 'nickolas360'
# The short X.Y version.
version = '1.14'
# The full version, including alpha/beta/rc tags.
release = '1.14.1'
release = '1.14.2'
 
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Loading
Loading
@@ -99,7 +99,7 @@ language = None
 
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
today = 'October 15, 2016'
today = 'December 11, 2016'
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'
 
Loading
Loading
Loading
Loading
@@ -32,7 +32,7 @@ needed to easily create bots.
pyrcb is compatible with Python 2.7 and Python 3.1 or higher. SSL/TLS support
requires at least Python 2.7.9 or Python 3.2 (see :meth:`~IRCBot.connect`).
 
The current version of pyrcb is **1.14.1**, which was released on 2016-10-15.
The current version of pyrcb is **1.14.2**, which was released on 2016-12-11.
See the :doc:`changelog <release-notes/1.14/changelog>` for more information.
 
Source code for pyrcb (including this documentation) is available at
Loading
Loading
Loading
Loading
@@ -25,6 +25,14 @@
Changelog
=========
 
.. _changelog-1.14.2:
1.14.2
------
* Fixed a bug where :meth:`IRCBot.split_string` would not split properly with
``once=True``.
.. _changelog-1.14.1:
 
1.14.1
Loading
Loading
Loading
Loading
@@ -18,9 +18,8 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License and the GNU Free Documentation License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
from __future__ import print_function
from __future__ import unicode_literals
Loading
Loading
@@ -38,7 +37,7 @@ import traceback
import time
import warnings
 
__version__ = "1.14.1"
__version__ = "1.14.2"
 
# ustr is unicode in Python 2 (because of unicode_literals)
# and str in Python 3.
Loading
Loading
@@ -694,6 +693,8 @@ class IRCBot(object):
while not result or (rest and not once):
split, rest = split_func(rest, bytelen)
result.append(split)
if rest:
result.append(rest)
return result
 
# Splits a string based on the number of bytes it takes
Loading
Loading
Loading
Loading
@@ -674,6 +674,8 @@ class TestMisc(BaseBotTest):
self.assertEqual(split, ["test", "§tes", "t"])
split = IRCBot.split_string("test§§ test", 10)
self.assertEqual(split, ["test§§ ", "test"])
split = IRCBot.split_string("test§§ test0123456789", 10, once=True)
self.assertEqual(split, ["test§§ ", "test0123456789"])
with self.assertRaises(ValueError):
IRCBot.split_string("test", 0)
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment