8
8
9
9
def rm_announce ():
10
10
# remove all announcement
11
- with open (readme_md ) as fp :
11
+ with open (readme_md , encoding = 'utf-8' ) as fp :
12
12
_old = fp .read ()
13
13
_new = re .sub (
14
14
r'(<!--startmsg-->\s*?\n).*(\n\s*?<!--endmsg-->)' ,
@@ -17,18 +17,18 @@ def rm_announce():
17
17
flags = re .DOTALL ,
18
18
)
19
19
20
- with open (readme_md , 'w' ) as fp :
20
+ with open (readme_md , 'w' , encoding = 'utf-8' ) as fp :
21
21
fp .write (_new )
22
22
23
- with open (conf_py ) as fp :
23
+ with open (conf_py , encoding = 'utf-8' ) as fp :
24
24
_old = fp .read ()
25
25
_new = re .sub (
26
26
r'(# start-announce\s*?\n).*(\n\s*?# end-announce)' ,
27
27
rf'\g<1>\g<2>' ,
28
28
_old ,
29
29
flags = re .DOTALL ,
30
30
)
31
- with open (conf_py , 'w' ) as fp :
31
+ with open (conf_py , 'w' , encoding = 'utf-8' ) as fp :
32
32
fp .write (_new )
33
33
34
34
@@ -49,7 +49,7 @@ def rm_announce():
49
49
meetup_svg_url = f'<a href="{ url } "><img src="https://github.com/jina-ai/jina/blob/master/{ meetup_svg } ?raw=true"></a>'
50
50
51
51
# update meetup_svg
52
- with open (meetup_svg ) as fp :
52
+ with open (meetup_svg , encoding = 'utf-8' ) as fp :
53
53
_old = fp .read ()
54
54
_new = re .sub (r'(<a href=").*(")' , rf'\g<1>{ url } \g<2>' , _old )
55
55
_new = re .sub (
@@ -59,11 +59,11 @@ def rm_announce():
59
59
flags = re .DOTALL ,
60
60
)
61
61
62
- with open (meetup_svg , 'w' ) as fp :
62
+ with open (meetup_svg , 'w' , encoding = 'utf-8' ) as fp :
63
63
fp .write (_new )
64
64
65
65
# update readme_md
66
- with open (readme_md ) as fp :
66
+ with open (readme_md , encoding = 'utf-8' ) as fp :
67
67
_old = fp .read ()
68
68
_new = re .sub (
69
69
r'(<!--startmsg-->\s*?\n).*(\n\s*?<!--endmsg-->)' ,
@@ -72,11 +72,11 @@ def rm_announce():
72
72
flags = re .DOTALL ,
73
73
)
74
74
75
- with open (readme_md , 'w' ) as fp :
75
+ with open (readme_md , 'w' , encoding = 'utf-8' ) as fp :
76
76
fp .write (_new )
77
77
78
78
# update conf
79
- with open (conf_py ) as fp :
79
+ with open (conf_py , encoding = 'utf-8' ) as fp :
80
80
_old = fp .read ()
81
81
_new = re .sub (
82
82
r'(# start-announce\s*?\n).*(\n\s*?# end-announce)' ,
@@ -85,5 +85,5 @@ def rm_announce():
85
85
flags = re .DOTALL ,
86
86
)
87
87
88
- with open (conf_py , 'w' ) as fp :
88
+ with open (conf_py , 'w' , encoding = 'utf-8' ) as fp :
89
89
fp .write (_new )
0 commit comments