Skip to content

Commit 9353516

Browse files
PubNub SDK v5.2.1 release.
1 parent dea9c0b commit 9353516

File tree

7 files changed

+64
-7
lines changed

7 files changed

+64
-7
lines changed

.pubnub.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: python
2-
version: 5.2.0
2+
version: 5.2.1
33
schema: 1
44
scm: github.com/pubnub/python
55
sdks:
@@ -169,6 +169,12 @@ sdks:
169169
license-url: https://github.com/aio-libs/aiohttp/blob/master/LICENSE.txt
170170
is-required: Required
171171
changelog:
172+
- version: v5.2.1
173+
date: 2021-09-06
174+
changes:
175+
-
176+
text: "Encoding of the double quote character fixed."
177+
type: bug
172178
- version: v5.2.0
173179
date: 2021-08-31
174180
changes:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [v5.2.1](https://github.com/pubnub/python/releases/tag/v5.2.1)
2+
3+
[Full Changelog](https://github.com/pubnub/python/compare/v5.2.0...v5.2.1)
4+
5+
- 🐛 Encoding of the double quote character fixed.
6+
17
## [v5.2.0](https://github.com/pubnub/python/releases/tag/v5.2.0)
28

39
[Full Changelog](https://github.com/pubnub/python/compare/v5.1.4...v5.2.0)

pubnub/pubnub_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
class PubNubCore:
6767
"""A base class for PubNub Python API implementations"""
68-
SDK_VERSION = "5.2.0"
68+
SDK_VERSION = "5.2.1"
6969
SDK_NAME = "PubNub-Python"
7070

7171
TIMESTAMP_DIVIDER = 1000

pubnub/utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ def get_data_for_user(data):
2424

2525
def write_value_as_string(data):
2626
try:
27-
if isinstance(data, str):
28-
return "\"%s\"" % data
29-
else:
30-
return json.dumps(data)
27+
return json.dumps(data)
3128
except TypeError:
3229
raise PubNubException(
3330
pn_error=PNERR_JSON_NOT_SERIALIZABLE

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='pubnub',
5-
version='5.2.0',
5+
version='5.2.1',
66
description='PubNub Real-time push service in the cloud',
77
author='PubNub',
88
author_email='[email protected]',
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
Accept:
6+
- '*/*'
7+
Accept-Encoding:
8+
- gzip, deflate
9+
Connection:
10+
- keep-alive
11+
User-Agent:
12+
- PubNub-Python/5.1.4
13+
method: GET
14+
uri: https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/ch1/0/%22%5C%22%22?seqn=1
15+
response:
16+
body:
17+
string: '[1,"Sent","16297201438613366"]'
18+
headers:
19+
Access-Control-Allow-Methods:
20+
- GET
21+
Access-Control-Allow-Origin:
22+
- '*'
23+
Cache-Control:
24+
- no-cache
25+
Connection:
26+
- keep-alive
27+
Content-Length:
28+
- '30'
29+
Content-Type:
30+
- text/javascript; charset="UTF-8"
31+
Date:
32+
- Mon, 23 Aug 2021 12:02:23 GMT
33+
status:
34+
code: 200
35+
message: OK
36+
version: 1

tests/integrational/native_sync/test_publish.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,3 +332,15 @@ def test_publish_with_ptto_and_replicate(self):
332332
assert isinstance(env.result, PNPublishResult)
333333
assert "ptto" in env.status.client_request.url
334334
assert "norep" in env.status.client_request.url
335+
336+
@pn_vcr.use_cassette(
337+
'tests/integrational/fixtures/native_sync/publish/publish_with_single_quote_message.yaml',
338+
filter_query_parameters=['uuid', 'pnsdk', 'l_pub']
339+
)
340+
def test_single_quote_character_message_encoded_ok(self):
341+
envelope = PubNub(pnconf).publish()\
342+
.channel("ch1")\
343+
.message('"')\
344+
.sync()
345+
346+
assert envelope

0 commit comments

Comments
 (0)