space before ";" breaks php.ini parsing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php |
Unknown
|
Unknown
|
|||
php5 (Ubuntu) |
Fix Released
|
Low
|
Unassigned | ||
Trusty |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
The following php.ini snippet is found in the newest releases of php.ini (found un downloads section and Ubuntu 13.10):
; If disabled, all PHPDoc comments are dropped from the code to reduce the
;size of the optimized code.
;opcache.
The space before " ;size" breaks automation systems like Ansible which tries to parse it as a correctly formatted .ini file.
Test script:
---------------
Apparently it only breaks with builtin MacOSX Python distribution, so you would not be able to reproduce the above exception if running GNU/Linux or others.
#!/usr/bin/python
import ConfigParser, os
config = ConfigParser.
config.
print config.get('PHP', 'max_execution_
Expected result:
----------------
It should return the value of the attribute instead of raising an exception:
$ python phpparse.py
30
Actual result:
--------------
TASK: [ini_file dest=/etc/
fatal: [86.50.168.69] => failed to parse: Traceback (most recent call last):
File "/root/
main()
File "/root/
changed = do_ini(module, dest, section, option, value, state, backup)
File "/root/
cp.readfp(f)
File "/usr/lib/
self._read(fp, filename)
File "/usr/lib/
raise e
ConfigParser.
[line 1859]: ' ;size of the optimized code.\n'
Changed in php5 (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Medium |
tags: | added: bitesize |
Reported upstream over here too: https:/ /bugs.php. net/bug. php?id= 65939
It is a very simple patch, it would be lovely to see it patched in the current Saucy release.