Comments (10)
@fschrempf do I remember correctly that this was your part of the code? Do you have time to look into this bug report?
No, I never used or touched file_upload()
so far.
from churchtoolsapi.
@fschrempf do I remember correctly that this was your part of the code? Do you have time to look into this bug report?
from churchtoolsapi.
@jannesjust - i could not reproduce your described behavior.
Not only do we already have songs like "Macht hoch die Tür" on our system, i did also add a test case which specifically checks a test file with Umlaut.
Are you sure you're using the song_arrangement_id and not the song_id to upload you attachment?
I've updated a docstring to strongly point out this difference ... 53c0de0#diff-026cdb0bee0effb8f5d2b4e8d06983b2fbab48b868670644ea2d0e12ce8c153cR28
If this wasn't the cause i'd need more information.
- Does it work with other filenames on your configuration?
- What specific filename did you try?
- Which ChurchTools instance are you testing against?
from churchtoolsapi.
Thanks for your quick testing and reply.
-
Yes I am using the song_arrangement_id and not the song id. I have a folder containg around 150 files. All of them are uploaded correctly, but files with umlauts or special characters do not upload.
-
The first failed filename was "011. Man erzählte mir froh". It is a pdf file. I've also tried to use the custom_file_name and upload the file with a different name, it works, but I would not like to change the file name.
-
I've tried your mentioned filename and that does not upload neither.
-
We are on ChurchTools v3.103.0
That's my code:
def initial_file_upload(api, category):
cwd = os.getcwd()
os.chdir(cwd +"/Lieder/3.Chor")
songs = api.get_songs()
for song in songs:
if song['category']['id'] == category:
name = f'{song["name"]}.pdf'
arrangement = song['arrangements'][0]['id']
if api.file_upload(name, 'song_arrangement', arrangement, overwrite = True) == True:
logging.info(name + " hochgeladen")
else:
logging.info(name + " fehlgeschlagen")
time.sleep(1)
from churchtoolsapi.
I'd rather suspect the use of you . might be a problem. I'll have to look into the code again though...
If that's not the issue
- what OS are you running on (I suppose Windows? I'm testing on Linux...
- what's the filesize?
- does the file upload using the regular swagger API?
- check if . In filename might cause issues
- check if pdf is still allowed
- check maximum filesize
from churchtoolsapi.
One more idea ... my test runs with overwrite = False as default.
Can you try to upload without overwrite and let me know if the issue persists?
from churchtoolsapi.
-
Yes I am using Windows.
-
Filesize is around 1 MByte. I can upload the exact same file using the custom_file_name attribute. That means, that the file is available on my computer and can be read
-
The . in the filename does not cause problems. Every filename I was uploading had . in it
-
First I also tried it without the overwrite option, that also did not work
When I upload the file via the webbroser in ChurchTools by hand, it works and the Umlaut is showing correctly
from churchtoolsapi.
After some testing on other machines and updating everything, I found the issue. Previously I used Python version 3.7.4 which did not work. After updating to 3.12.0 it finally works. Thanks for your support.
from churchtoolsapi.
Thanks for the update.
Would you mind trying again with Python 3.8 as specified in the requirements?
[tool.poetry.dependencies]
python = "^3.8"
If it does work with 3.8 i'd keep everything as is, but if you require 3.9, 3.10 or newer I'd have to update the requirements :)
It looks like my venv is currently using 3.11 ...
from churchtoolsapi.
Yes, it also works with 3.8
from churchtoolsapi.
Related Issues (20)
- Implement get_group_permissions() HOT 1
- Implement update_group() HOT 1
- Implement get_global_permissions()
- Update project setup
- why churchtools-api on import in communi_api with poetry HOT 2
- Feature Request for CT Calendar HOT 8
- Allow overloading to_ and from_ keywords with datetime objects
- Add get_event_by_calendar_appointment
- .get_calendar_appointments() with IndexOutOfRange
- Implement get_group_statistics()
- Implement create_group() and delete_group()
- Implement get_group_members()
- Implement add_group_member() and remove_group_member()
- Implement get_group_roles()
- Implement add_parent_group() and remove_parent_group()
- Implement def create_tags
- extend get_tags to offer simplified dict as return
- get_songs used with tags ends on 82/83
- get_songs has pagination of 83 requests on ELKW1610.krz.tools
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from churchtoolsapi.