At present, the Python client handles 301 and 302 redirects by automatically redirecting (probably thanks to httplib2). According to wikipedia: "If the 301 status code is received in response to a request of any type other than GET or HEAD, the client must ask the user before redirecting." In the interests of automation, I'm happy for the client to redirect automatically (especially if --force is set), but it should at least log a warning.
I have add a warning for 301 and 302 redirecting, the changes are in commit 72b717e41c9fce54be3a of devel branch of zanata python client on github.
I modify the warning and add the information of the new URL of redirecting, also I add a check for response.previous, if it is none, we don't need to log a warning. The changes are in commit 7be3cde2cf756703fc49 of devel branch of zanata python client on github.
Version create works, but push produced "error: Unexpected Status, failed to push" Test case: ibus-chewing to fedora.zanata.org (which should be redirected to translate.zanata.org) Step: 1. git-clone git://github.com/definite/ibus-chewing.git 2. cd ibus-chewing/po 3. xgettext --language=C --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 -s --package-name=ibus-chewing --package-version=master -o ibus-chewing.pot ../src/*.c ../src/*.gob 4. edit zanata.xml as: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <config xmlns="http://zanata.org/namespace/config/"> <url>https://fedora.zanata.org/zanata/</url> <project>ibus-chewing</project> <project-version>1.3.10</project-version> <locales> <locale map-from="zh_TW">zh-Hant-TW</locale> <locale map-from="zh_CN">zh-Hans-CN</locale> </locales> </config> 5. zanata push --project-type=gettext --username=<user> --apikey=<key> --url=https://fedora.zanata.org/zanata/ Expected: Pushing with redirection warning. Actual: Pushing the content of ibus-chewing.pot to server: warning: encountered msgctxt; not currently supported warning: encountered msgctxt; not currently supported warning: encountered msgctxt; not currently supported error: Unexpected Status, failed to push
Hi Ding, I have commit a change 654368b to git-hub to fix this issue, basically i add a handler for status code is 301 when pushing pot file and po file. Please use latest code to verify it, thanks.
VERIFIED with commit ec9cadf01148f7335e10f98fb0690028b0b0f48e
Could you please close this when 1.3.2 is released?
Sure, I will make sure this bug does not reappear then close it.