Skip to content

Commit

Permalink
fix #302 deploy script adding strange unicode character (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae authored Dec 4, 2023
1 parent 01521b7 commit cca05ce
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
def stripFirstLine(text):
return '\n'.join(text.splitlines()[1:])

# Which of the two bot libraries are we using to write our edits?
if using_mwclient:
if wiki == 'en':
server_name = 'en.wikipedia.org'
Expand All @@ -109,7 +110,7 @@ def setPageText(title, text, summary):
page.save(text, summary=summary)
else:
print('Skipping {}, no changes made'.format(title))
else:
else: #pywikibot
site = pywikibot.Site(wiki, "wikipedia")
site.login()
print('Logged in as {}.'.format(site.user()))
Expand Down Expand Up @@ -156,16 +157,16 @@ def uploadDirectory(directory):
for script in files:
# Skip hidden files and Emacs spam
if not script.startswith('.') and not script.endswith('~'):
with open(directory + '/' + script, 'r') as f:
with open(directory + '/' + script, mode="r", encoding="utf-8") as f:
content = f.read()
uploadSubscript(os.path.splitext(script)[0], content)

# Upload afch.js
with open('build/afch.js', 'r') as f:
with open('build/afch.js', mode="r", encoding="utf-8") as f:
uploadFile(root + '.js', f.read())

# Upload afch.css
with open('build/afch.css', 'r') as f:
with open('build/afch.css', mode="r", encoding="utf-8") as f:
uploadFile(root + '.css', f.read())

# Now upload everything else: modules, templates
Expand Down

0 comments on commit cca05ce

Please sign in to comment.