You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
without having specified TRANSIFEX_PROJECT_PATH in the settings I get the following exception:
Executing pull_translations on project test-392
Pulling translations for "test-392" project, in "en" source language
Traceback (most recent call last):
File "./manage.py", line 7, in <module>
execute_from_command_line(sys.argv)
File "/Users/harris/Workspaces/Unleash12/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/Users/harris/Workspaces/Unleash12/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/harris/Workspaces/Unleash12/env/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/harris/Workspaces/Unleash12/env/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/Users/harris/Src/django-transifex/djangotransifex/management/commands/tx.py", line 75, in handle
command_func(*args[1:], **options)
File "/Users/harris/Src/django-transifex/djangotransifex/management/commands/tx.py", line 159, in transifex_pull_translations
project_slug=self.project_slug, source_language=self.source_language
File "/Users/harris/Src/django-transifex/djangotransifex/api.py", line 171, in pull_translations
'LC_MESSAGES'
File "/Users/harris/Workspaces/Unleash12/env/bin/../lib/python2.7/posixpath.py", line 70, in join
elif path == '' or path.endswith('/'):
AttributeError: 'function' object has no attribute 'endswith'
This is with Django 1.6.
It seems that if the path is not explicitly set, then django-transifex tries to figure out where the project is located using a lazy function. There are two problems in the code:
the lazy function is not properly initialized - it needs str as an additional parameter.
the lazy function is not a property but a callable, and is not evaluated on access.
There is also the problem that the actual helper function app_settings._get_project_path does not handle the case where the settings file is not top-level in the project. In my case, all my settings are stored in a submodule structure.
The tests do not catch this, because the tests explicitly define TRANSIFEX_PROJECT_PATH.
The text was updated successfully, but these errors were encountered:
willharris
added a commit
to willharris/django-transifex
that referenced
this issue
Nov 19, 2015
…he location of the locales, rather than trying to figure out the project path from the settings module. Allow specifying a custom locale path for operations using a command-line flag. (Issue jakul#20)
When I run
without having specified
TRANSIFEX_PROJECT_PATH
in the settings I get the following exception:This is with Django 1.6.
It seems that if the path is not explicitly set, then django-transifex tries to figure out where the project is located using a
lazy
function. There are two problems in the code:str
as an additional parameter.There is also the problem that the actual helper function
app_settings._get_project_path
does not handle the case where the settings file is not top-level in the project. In my case, all my settings are stored in a submodule structure.The tests do not catch this, because the tests explicitly define
TRANSIFEX_PROJECT_PATH
.The text was updated successfully, but these errors were encountered: