FS#57186 - [python-babel] missing 'locale-data' dir and files

Attached to Project: Community Packages
Opened by Josip Ponjavic (metak) - Monday, 22 January 2018, 01:04 GMT
Last edited by Eli Schwartz (eschwartz) - Tuesday, 23 January 2018, 12:12 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Morten Linderud (Foxboron)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:

Latest change doesn't include *.dat files in 'locale-data'.

[ 107s] writing... streamlink.1 { }
[ 107s] Exception occurred:
[ 107s] File "/usr/lib/python3.6/site-packages/babel/localedata.py", line 66, in locale_identifiers
[ 107s] os.path.splitext(filename) for filename in os.listdir(_dirname)
[ 107s] FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3.6/site-packages/babel/locale-data'
[ 107s] The full traceback has been saved in /tmp/sphinx-err-xbselpys.log, if you want to report the issue to the developers.
[ 107s] Please also report this if it was a user error, so that a better error message can be provided next time.
[ 107s] A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!


Additional info:
* package version(s)
python-babel-2.5.3-1

Packages to fail to build with this error:

[code]
[ 107s] writing... streamlink.1 { }
[ 107s] Exception occurred:
[ 107s] File "/usr/lib/python3.6/site-packages/babel/localedata.py", line 66, in locale_identifiers
[ 107s] os.path.splitext(filename) for filename in os.listdir(_dirname)
[ 107s] FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3.6/site-packages/babel/locale-data'
[ 107s] The full traceback has been saved in /tmp/sphinx-err-xbselpys.log, if you want to report the issue to the developers.
[ 107s] Please also report this if it was a user error, so that a better error message can be provided next time.
[ 107s] A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

[/code]
Steps to reproduce: recent change where '--skip-build' was introduced seems to cause this.
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Tuesday, 23 January 2018, 12:12 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-babel 2.5.3-4
Comment by Juliette Monsel (j_4321) - Monday, 22 January 2018, 10:48 GMT
I have tried building python-babel with and without '--skip-build' in the 'python setup.py install' line:

- with '--skip-build', no 'usr/lib/python3.6/site-packages/babel/locale-data' directory which leads to the error "FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3.6/site-packages/babel/locale-data'" when using the babel library.

- without '--skip-build', 'usr/lib/python3.6/site-packages/babel/locale-data' exists and the library works fine.
Comment by Michel (xantares) - Monday, 22 January 2018, 13:04 GMT
same problem here, I confirm that removing the skip-build fixes the issue
Comment by Morten Linderud (Foxboron) - Monday, 22 January 2018, 14:58 GMT
Pushed new version that should include everything. Please report back if it still doesnt work :)
Comment by stef204 (stef204) - Monday, 22 January 2018, 20:15 GMT
2.5.3-2 fixes problem with python-babel but NOT python2-babel.
the locale-data directory does not get installed and filled correctly for python2.7.
So OK on python 3 but still needs fixing for python 2.
Comment by Eli Schwartz (eschwartz) - Monday, 22 January 2018, 21:31 GMT
It appears to have been rebuilt in between adding the line to package_python-babel() and then adding the line to package_python2-babel() as well. A rebuild is incoming.
Comment by stef204 (stef204) - Monday, 22 January 2018, 22:23 GMT
Could be. However, still getting problems with new 2.5.3-3 release (python2): "RuntimeError: The babel data files are not available. This usually happens because you are using a source checkout from Babel and you did not build the data files. Just make sure to run "python setup.py import_cldr" before installing the library."
so PKGBUILD still needing patching.... we'll get there yet.
but if one just removes the --skip-build from lines 43 and 52 AND removes lines 44 and 54, it seems to build and run fine, no errors.
Why introduce those changes and lines?

Comment by Josip Ponjavic (metak) - Tuesday, 23 January 2018, 03:38 GMT
@stef204

It doesn't fix it for me for python3. python-babel-2.5.3-3

[ 107s] Exception occurred:
[ 107s] File "/usr/lib/python3.6/site-packages/babel/core.py", line 27, in _raise_no_data_error
[ 107s] raise RuntimeError('The babel data files are not available. '
[ 107s] RuntimeError: The babel data files are not available. This usually happens because you are using a source checkout from Babel and you did not build the data files. Just make sure to run "python setup.py import_cldr" before installing the library.
[ 107s] The full traceback has been saved in /tmp/sphinx-err-79bwn6qj.log, if you want to report the issue to the developers.
[ 107s] Please also report this if it was a user error, so that a better error message can be provided next time.
[ 107s] A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
Comment by Eli Schwartz (eschwartz) - Tuesday, 23 January 2018, 04:22 GMT
You will often see --skip-build used when the build command is run separately... it is a bit of a red herring though, as the real issue is that build needs to be run *after* import_cldr

Removing --skip-build, means that build will be called again during package() which is of course after import_cldr was called.

As long as build is run after import_cldr, there is no need to manually copy the data files, as MANIFEST.in will detect them via a glob pattern.

Note that even when manually copying the files, the file babel/global.dat was not being copied.

Foxboron, I would generally recommend using the `checkpkg` script to compare the before and after versions of updated PKGBUILDs before uploading them -- it is a nifty script that can catch things like this. e.g. after implementing the changes I mentioned above, I get the following checkpkg output: https://paste.xinu.at/oAYb2U/

...

This is entirely down to an upstream quirk where subcommands without a dependency graph are used for something that is an absolute requirement for the build, without any truly reliable way to detect and abort on errors in the build process. It usually works, because they generate known good dist tarballs via PyPI.

Loading...