Re: making safe_dump / safe_load the defaults

Peter Murphy <[email protected]> Tue, 8 Dec 2015 15:57:58 +1000
Newsgroups gmane.text.yaml.general
Message-ID <CANZ_uBhjLttpD9ZOiDo873h7+Ze36m5F2Djfa_RW-DrdhPMJ0Q@mail.gmail.com>
Well, I agree, but I don't have code access either.

Best regards,
Peter

On Tue, Dec 8, 2015 at 6:03 AM, James Broadhead
<[email protected]> wrote:
> ^ Hi again -- any thoughts on the above?
>
> On 26 November 2015 at 23:17, James Broadhead <[email protected]>
> wrote:
>>
>> Hi there!
>>
>> I would like to propose that the behaviour of the current yaml.safe_load /
>> yaml.safe_dump functions become the defaults available through
>> yaml.load/yaml.dump, and that the full-featured .load/.dump be renamed to
>> indicate that care must be taken when using them.
>> This relates to the github issue: https://github.com/yaml/pyyaml/issues/5.
>> I do not have access to file TRAC issues.
>>
>> The current default is quite intuitive, and I believe breaks the principle
>> of least-surprise to developers attempting to use the library without
>> careful reading of the docs. I understand the argument of "they should read
>> the docs" / "they should not load untrusted content", but am aware that this
>> advice is not followed in the real world, and have encountered many
>> instances of use of .load where .safe_load was entirely sufficient &
>> preferable.
>>
>> I have a proposal branch here: https://github.com/yaml/pyyaml/pull/21
>> which deprecates the 'Loader'/'Dumper' kwargs to .load/.dump [_all], and
>> bumps the minor version number. If this approach is acceptable, the actual
>> change-over would probably call for a major-version release. I welcome
>> comments on the implementation or approach.
>>
>> I could not find much prior discussion of this issue on the mailing-lists
>> or in TRAC, which surprised me. Am I looking in the wrong places?
>>
>> James
>
>
>
> ------------------------------------------------------------------------------
> Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug & build mobile apps & 2D/3D high-impact games for multiple
> OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
> _______________________________________________
> Yaml-core mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/yaml-core
>



-- 
Email: [email protected]
WWW: http://www.pkmurphy.com.au/

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140