Spec URL: https://raw.github.com/hroncok/SPECS/master/python-MultipartPostHandler2.spec SRPM URL: https://github.com/downloads/hroncok/SPECS/python-MultipartPostHandler2-0.1.1-2.fc18.src.rpm Description: This is MultipartPostHandler plus a fix for UTF-8 systems. Enables the use of multipart/form-data for posting forms. Fedora Account System Username: churchyard
I'll take this for a review.
- I'd advise using %{version} in URL (instead of current 0.1.1). - pushd/popd seem a bit cleaner than cd/cd -, but that's just my impression :) - Files in %{python_sitelib} shouldn't be executable, IMHO. If these files really need to be executed by user, I'd suggest placing some stub into %{_bindir}. setuptools' entry_points should do the trick [1]. It might be worth it to create pull request that would introduce usage of entry_points and send it upstream. [1] http://pythonhosted.org/distribute/setuptools.html#dynamic-discovery-of-services-and-plugins
Actually, examining the code makes me think the main() function of this is absolutely useless to the user. The best idea I have is to cut it out of the file, use it as test* and then store it in doc as an example. * That might not work in Koji, as it requires Internet access and I don't know if that is possible.
(In reply to comment #3) > Actually, examining the code makes me think the main() function of this is > absolutely useless to the user. The best idea I have is to cut it out of the > file, use it as test* and then store it in doc as an example. > Yes, that seems like a good approach to me. > * That might not work in Koji, as it requires Internet access and I don't > know if that is possible. No, that's not possible in Koji. The best way is running the test locally and then disabling it for Koji by some condition.
Now it is done. The only thing that drives me crazy is that output of test in Pyhton 2 uses newlines and in Pyhton 3 it prints \n. Is there anything I've done wrong, or is it normal bahaviour in P3? Thanks for help. Spec URL: https://raw.github.com/hroncok/SPECS/master/python-MultipartPostHandler2.spec SRPM URL: https://github.com/downloads/hroncok/SPECS/python-MultipartPostHandler2-0.1.1-3.fc18.src.rpm
The newlines are actually a correct behaviour. In Python 3, the read() method of the opener object returns 'bytes' object. This is because it can't determine the encoding of the URL content prior to reading it. When you print a 'bytes' object in Python 3, this is exactly what happens. As mentioned in [1], it is up to your program to determine the encoding from the 'bytes' object and then decode it properly into string. Therefore, if you use print(opener.open(validatorURL, params).read().decode('utf-8')) everything will work as you expect and it is also actually the "correct" behaviour, so to say. [1] http://docs.python.org/3/library/urllib.request.html#examples Anyway, the specfile and SRPM look good, so please fix this nit before importing, the package is APPROVED
(In reply to comment #6) > Therefore, if you use > > print(opener.open(validatorURL, params).read().decode('utf-8')) > > everything will work as you expect and it is also actually the "correct" > behaviour, so to say. Can't say that + /usr/bin/python3 MultipartPostHandler-example.py Traceback (most recent call last): File "MultipartPostHandler-example.py", line 29, in <module> main() File "MultipartPostHandler-example.py", line 26, in main validateFile("http://www.google.com") File "MultipartPostHandler-example.py", line 19, in validateFile print(opener.open(validatorURL, params).read().decode('utf-8')) UnicodeEncodeError: 'ascii' codec can't encode character '\u2026' in position 1422: ordinal not in range(128)
That is of course assuming that the page is really encoded using utf-8. For me, iso-8859-2 works for www.google.com - I guess google adapts that to your actual location. You can try e.g. www.python.org, that is in utf-8 for everyone.
Spec URL: https://raw.github.com/hroncok/SPECS/master/python-MultipartPostHandler2.spec SRPM URL: https://github.com/downloads/hroncok/SPECS/python-MultipartPostHandler2-0.1.1-4.fc18.src.rpm Solved. Thanks for help.
New Package SCM Request ======================= Package Name: python-MultipartPostHandler2 Short Description: A handler for urllib2 to enable multipart form uploading Owners: churchyard bkabrda Branches: f17 f18 f19
Jon, you have set the flag to + but haven't write your magical "Git done" and I still canote clone it. Thanks
Sorry, I had some script issues this weekend due to the python-bugzilla update. The script is fixed now, but some repos might not have been set up properly. I've done it manually, try it now.
It works. Thanks.
Excellent, anytime!
python-MultipartPostHandler2-0.1.1-4.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/python-MultipartPostHandler2-0.1.1-4.fc17
python-MultipartPostHandler2-0.1.1-4.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/python-MultipartPostHandler2-0.1.1-4.fc18
python-MultipartPostHandler2-0.1.1-4.fc18 has been pushed to the Fedora 18 testing repository.
python-MultipartPostHandler2-0.1.1-4.fc18 has been pushed to the Fedora 18 stable repository.
python-MultipartPostHandler2-0.1.1-4.fc17 has been pushed to the Fedora 17 stable repository.
Hi, this is awesome because I'm the publisher of this MultipartPostHandler2 , but I can't consider the author, because the primary author vanish of MultipartPostHandler . Since someone consider this useful, I may change the contacts, improve things etc . But I'm writing because I like to know where do you use this or where this package is useful ?
Hi, I personally use it in my own dirty scripts, such as this one https://github.com/hroncok/netfabbcloud There's not package in Fedora, that would depend on this one right now. Improving thing doesn't seem worthy to me, as it works just fine.
Hi, I update MultipartPostHandler2 , and applied your patch python-MultipartPostHandler2-cut-out-main.patch , but python setup.py sdist doesn't include the example, I don't understand what I have to do to be included, in meantime I put sources on github you may download full package here : https://github.com/sergiomb2/MultipartPostHandler2/archive/0.1.3.tar.gz
ah and please, test it for me please , I just can do a limited tests here.
(In reply to Bohuslav "Slavek" Kabrda from comment #2) > [1] > http://pythonhosted.org/distribute/setuptools.html#dynamic-discovery-of- > services-and-plugins now the link is : https://pythonhosted.org/setuptools/setuptools.html#dynamic-discovery-of-services-and-plugins May I join to committers of this package ? I'm going make the requests now
I don't underestand, why do you want to join the committers?
to update the package to 0.1.4 basically
Created attachment 899001 [details] 0.1.4.patch here is the patch for update MultipartPostHandler2 to 0.1.4 and git rm python-MultipartPostHandler2-cut-out-main.patch I should open another bug but post here was faster
Created attachment 899012 [details] 0.1.4.v2.patch sorry , I promise, this is last comment .