Unable to push the POT file beginning from the underscore (_) in the filename

Description

Description of problem:
When the POT filename is beginning from the underscore, such as _Exit.2.pot, zanata-cli always fails due to:
[main] ERROR org.zanata.client.commands.push.PushCommand - Operation failed: Error status 404 Not Found returned

Version-Release number of selected component (if applicable):
zanata-client-3.3.2-2.fc21.noarch

How reproducible:
always

Steps to Reproduce:
1.push the pot file to the server
2.
3.

Actual results:
the above error happens.

Expected results:
no error

Additional info:

Environment

None

Activity

Show:
Bugzilla Migration
July 31, 2015, 1:43 AM

Ding-Yi Chen commented on 2014-06-24 00:25:17 -0400:

This can also be reproduced with

Server: Zanata 3.4.2-SNAPSHOT (git-server-3.4.1-47-g88e8fe3)
Client: zanata-maven-plugin:3.3.2ush
client API version: 3.3.1, server API version: 3.3.1

Project type: gettext
Filename: libstdc+-v3/po/libstdc+.pot (gcc-4.9.0)

Bugzilla Migration
July 31, 2015, 1:43 AM

David Mason commented on 2014-08-05 21:39:45 -0400:

This has something to do with RESTEasy paths, and there would probably be similar issues with some other characters such as commas. The problem stems from the use of filenames as part of a URL: the rules for what can be in a URL are a lot more stringent than for what can be in a filename.

Proposed fix: Make filenames a query parameter with escaping. This would get around this and all other issues with RESTEasy's handling of different characters. This would require deprecating the current REST endpoint and implementing a new endpoint with the filename as a query parameter.

Bugzilla Migration
July 31, 2015, 1:43 AM

Patrick Huang commented on 2014-08-27 20:10:00 -0400:

A workaround exists:
Add command hook to zanata.xml to rename the file before push and back again after pull.
Example (not tested only in theory)
<hooks>
<hook command="push">
<before>mv _Exit.2.pot Exit.2.pot</before>
<after>mv Exit.2.pot _Exit.2.pot</after>
</hook>
<hook command="pull">
<!-- assuming this is a gettext project. For podir it will be different -->
<!-- need to rename all locales but here just use ja as one example -->
<after>mv Exit_ja.po _Exit_ja.po</after>
</hook>
</hooks>

Carlos Munoz
February 3, 2016, 4:12 AM

Allow underscores, hyphens, and periods in resource slugs / regex

Damian Jansen
February 23, 2016, 5:15 AM

Correction - allow start with hyphen / underscore, and period anywhere after start (i.e. not hidden).

Assignee

Patrick Huang

Reporter

tagoh

Labels

None

Tested Version/s

None

Components

Sprint

None

Fix versions

Priority

Highest
Configure