After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 551059 - GFIle load_contents methods chop the data off at the first \0
GFIle load_contents methods chop the data off at the first \0
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gio
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
: 550835 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-09-05 23:03 UTC by Jonathan Matthew
Modified: 2008-09-07 01:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
simple fix (708 bytes, patch)
2008-09-05 23:05 UTC, Jonathan Matthew
committed Details | Review

Description Jonathan Matthew 2008-09-05 23:03:23 UTC
_wrap_g_file_load_contents and _wrap_g_file_load_contents_finish use 

  Py_BuildValue("(sks)", content, length, etag_out)

to construct the result.  This treats 'content' as a null-terminated string.
Comment 1 Jonathan Matthew 2008-09-05 23:05:26 UTC
Created attachment 118131 [details] [review]
simple fix
Comment 2 Sebastien Bacher 2008-09-05 23:11:38 UTC
*** Bug 550835 has been marked as a duplicate of this bug. ***
Comment 3 Paul Pogonyshev 2008-09-06 12:13:36 UTC
Comment on attachment 118131 [details] [review]
simple fix

Looks good, please commit.
Comment 4 Jonathan Matthew 2008-09-07 01:05:28 UTC
2008-09-07  Jonathan Matthew  <jonathan@d14n.org>

        Bug 551059 – GFile load_contents methods chop data at first \0

        * gio/gfile.override:
        Use 's#' (length specified) rather than 's' when constructing
        result values in load_contents and load_contents_finish.