Upgrade Guide¶
MAJOR
version bumps will have upgrade notes
posted here.
[2021-09-22] 6.x.x to 7.x.x¶
Overview¶
Version 7.x.x
is the first version that officially drops support for Python versions 2.7, 3.4, and 3.5.
Removal of files and dependencies that were added to support Python 2.7, 3.4, and 3.5:¶
- Six
- Removed use of
u
a fake unicode literal - Removed use of
b
a fake bytes literal - Removed
PY3
a boolean indicating if the code is running on Python 3 text_type
type for representing (Unicode) textual data –>str
iteritems
returns an iterator over dictionary’s items –>items
string_types
possible types for text data like basestring() in Python 2 and str in Python 3.–>str
- Removed use of
- twilio/compat.py
from twilio.compat import urlencode
–>from urllib.parse import urlencode
izip
–>zip
- twilio/jwt/compat.py
- Removed
compat.compare_digest
- Removed
- twilio/jwt/init.py
- Removed import for
simplejson
andjson
- Removed import for
Updated dependencies¶
CHANGED - Remove the ability to override the algorithm
in Jwt.to_jwt()
.¶
Removed the ability to override the algorithm while using a jwt access token:¶
// 6.x.x
from twilio.jwt.access_token import AccessToken
token.to_jwt(algorithm='HS512')
// 7.x.x
from twilio.jwt.access_token import AccessToken
token.to_jwt()
[2017-09-28] 6.6.x to 6.7.x¶
CHANGED - Body
parameter on Chat Message
creation is no longer required.¶
Rationale¶
This was changed to add support for sending media in Chat messages, users can now either provide a body
or a media_sid
.
6.6.x¶
from twilio.rest import Client
client = Client('AC123', 'auth')
client.chat.v2.services('IS123').channels('CH123').messages.create("this is the body")
6.7.x¶
from twilio.rest import Client
client = Client('AC123', 'auth')
client.chat.v2.services('IS123').channels('CH123').messages.create(body="this is the body")