2025-05-08 10:49:31 +00:00
|
|
|
diff -rU 3 a/vobject/base.py b/vobject/base.py
|
|
|
|
|
--- a/vobject/base.py 2024-12-16 08:15:20.000000000 +0100
|
|
|
|
|
+++ b/vobject/base.py 2025-05-08 10:54:19.517509757 +0200
|
|
|
|
|
@@ -6,7 +6,7 @@
|
2024-12-19 09:32:00 +00:00
|
|
|
import codecs
|
|
|
|
|
import logging
|
|
|
|
|
import re
|
|
|
|
|
-import six
|
|
|
|
|
+import io
|
|
|
|
|
import sys
|
|
|
|
|
|
2025-05-08 10:49:31 +00:00
|
|
|
# Package version
|
|
|
|
|
@@ -858,7 +858,7 @@
|
2024-12-19 09:32:00 +00:00
|
|
|
Quoted-printable data will be decoded in the Behavior decoding phase.
|
|
|
|
|
|
|
|
|
|
# We're leaving this test in for awhile, because the unittest was ugly and dumb.
|
|
|
|
|
- >>> from six import StringIO
|
|
|
|
|
+ >>> from io import StringIO
|
|
|
|
|
>>> f=StringIO(testLines)
|
|
|
|
|
>>> for n, l in enumerate(getLogicalLines(f)):
|
|
|
|
|
... print("Line %s: %s" % (n, l[0]))
|
2025-05-08 10:49:31 +00:00
|
|
|
@@ -881,7 +881,7 @@
|
2024-12-19 09:32:00 +00:00
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
quotedPrintable = False
|
|
|
|
|
- newbuffer = six.StringIO
|
|
|
|
|
+ newbuffer = io.StringIO
|
|
|
|
|
logicalLine = newbuffer()
|
|
|
|
|
lineNumber = 0
|
|
|
|
|
lineStartNumber = 0
|
2025-05-08 10:49:31 +00:00
|
|
|
@@ -996,7 +996,7 @@
|
2024-12-19 09:32:00 +00:00
|
|
|
"""
|
|
|
|
|
Encode and fold obj and its children, write to buf or return a string.
|
|
|
|
|
"""
|
|
|
|
|
- outbuf = buf or six.StringIO()
|
|
|
|
|
+ outbuf = buf or io.StringIO()
|
|
|
|
|
|
|
|
|
|
if isinstance(obj, Component):
|
|
|
|
|
if obj.group is None:
|
2025-05-08 10:49:31 +00:00
|
|
|
@@ -1018,7 +1018,7 @@
|
2024-12-19 09:32:00 +00:00
|
|
|
if obj.behavior and not startedEncoded:
|
|
|
|
|
obj.behavior.encode(obj)
|
|
|
|
|
|
|
|
|
|
- s = six.StringIO()
|
|
|
|
|
+ s = io.StringIO()
|
|
|
|
|
|
|
|
|
|
if obj.group is not None:
|
2025-05-08 10:49:31 +00:00
|
|
|
s.write(obj.group + '.')
|
|
|
|
|
@@ -1082,7 +1082,7 @@
|
2024-12-19 09:32:00 +00:00
|
|
|
Generate one Component at a time from a stream.
|
|
|
|
|
"""
|
|
|
|
|
if isinstance(streamOrString, basestring):
|
|
|
|
|
- stream = six.StringIO(streamOrString)
|
|
|
|
|
+ stream = io.StringIO(streamOrString)
|
|
|
|
|
else:
|
|
|
|
|
stream = streamOrString
|
|
|
|
|
|
2025-05-08 10:49:31 +00:00
|
|
|
diff -rU 3 a/vobject/hcalendar.py b/vobject/hcalendar.py
|
|
|
|
|
--- a/vobject/hcalendar.py 2024-10-01 16:46:45.000000000 +0200
|
|
|
|
|
+++ b/vobject/hcalendar.py 2025-05-08 10:55:12.047890349 +0200
|
|
|
|
|
@@ -28,7 +28,7 @@
|
2024-12-19 09:32:00 +00:00
|
|
|
</span>
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
-import six
|
|
|
|
|
+import io
|
|
|
|
|
|
|
|
|
|
from datetime import date, datetime, timedelta
|
|
|
|
|
|
2025-05-08 10:49:31 +00:00
|
|
|
@@ -45,7 +45,7 @@
|
2024-12-19 09:32:00 +00:00
|
|
|
Serialize iCalendar to HTML using the hCalendar microformat (http://microformats.org/wiki/hcalendar)
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
- outbuf = buf or six.StringIO()
|
|
|
|
|
+ outbuf = buf or io.StringIO()
|
|
|
|
|
level = 0 # holds current indentation level
|
|
|
|
|
tabwidth = 3
|
|
|
|
|
|
2025-05-08 10:49:31 +00:00
|
|
|
diff -rU 3 a/vobject/icalendar.py b/vobject/icalendar.py
|
|
|
|
|
--- a/vobject/icalendar.py 2024-12-16 08:09:54.000000000 +0100
|
|
|
|
|
+++ b/vobject/icalendar.py 2025-05-08 10:57:12.542858557 +0200
|
|
|
|
|
@@ -10,7 +10,7 @@
|
2024-12-19 09:32:00 +00:00
|
|
|
import base64
|
|
|
|
|
|
|
|
|
|
from dateutil import rrule, tz
|
|
|
|
|
-import six
|
|
|
|
|
+import io
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
import pytz
|
2025-05-08 10:49:31 +00:00
|
|
|
@@ -56,7 +56,7 @@
|
2024-12-19 09:32:00 +00:00
|
|
|
"""
|
|
|
|
|
Take a string or unicode, turn it into unicode, decoding as utf-8
|
|
|
|
|
"""
|
|
|
|
|
- if isinstance(s, six.binary_type):
|
|
|
|
|
+ if isinstance(s, bytes):
|
2025-05-08 10:49:31 +00:00
|
|
|
s = s.decode('utf-8')
|
2024-12-19 09:32:00 +00:00
|
|
|
return s
|
|
|
|
|
|
2025-05-08 10:49:31 +00:00
|
|
|
@@ -135,7 +135,7 @@
|
|
|
|
|
good_lines = ('rdate', 'rrule', 'dtstart', 'tzname', 'tzoffsetfrom',
|
|
|
|
|
'tzoffsetto', 'tzid')
|
2024-12-19 09:32:00 +00:00
|
|
|
# serialize encodes as utf-8, cStringIO will leave utf-8 alone
|
|
|
|
|
- buffer = six.StringIO()
|
|
|
|
|
+ buffer = io.StringIO()
|
|
|
|
|
# allow empty VTIMEZONEs
|
|
|
|
|
if len(self.contents) == 0:
|
|
|
|
|
return None
|
2025-05-08 10:49:31 +00:00
|
|
|
@@ -569,7 +569,7 @@
|
2024-12-19 09:32:00 +00:00
|
|
|
self.add(name).value = setlist
|
|
|
|
|
elif name in RULENAMES:
|
|
|
|
|
for rule in setlist:
|
|
|
|
|
- buf = six.StringIO()
|
|
|
|
|
+ buf = io.StringIO()
|
2025-05-08 10:49:31 +00:00
|
|
|
buf.write('FREQ=')
|
2024-12-19 09:32:00 +00:00
|
|
|
buf.write(FREQUENCIES[rule._freq])
|
|
|
|
|
|
2025-05-08 10:49:31 +00:00
|
|
|
@@ -1010,7 +1010,7 @@
|
2024-12-19 09:32:00 +00:00
|
|
|
transformed = obj
|
|
|
|
|
undoTransform = False
|
|
|
|
|
out = None
|
|
|
|
|
- outbuf = buf or six.StringIO()
|
|
|
|
|
+ outbuf = buf or io.StringIO()
|
|
|
|
|
if obj.group is None:
|
2025-05-08 10:49:31 +00:00
|
|
|
groupString = ''
|
2024-12-19 09:32:00 +00:00
|
|
|
else:
|