[Tutor] Borrowing free code
Steven D'Aprano
steve at pearwood.info
Wed Dec 5 01:14:46 EST 2018
On Tue, Dec 04, 2018 at 11:43:05PM +0000, Alan Gauld via Tutor wrote:
> On 04/12/2018 19:31, Avi Gross wrote:
>
> > But some packages are simply python code that you can
> > simply insert into your own python files.
>
> If they are fully public domain that's probably true.
Almost nothing younger than 70 years is in the public domain. Nearly all
countries share certain copyright laws, including automatic granting of
copyright for the life of the author + many years (exactly how many
depends on the country) whether you want it or not.
According the lawyers behind the Creative Commons, many jurisdictions
make it difficult if not impossible to voluntarily give up copyright and
put a work in the public domain:
https://creativecommons.org/share-your-work/public-domain/cc0/
One of the few exceptions is that many (but not all) works by the US
government are required to be placed in the public domain by law.
Having said that, all is not *quite* lost (yet). There are still ways to
get equivalent freedom as if the work was in the public domain, and
another Mickey Mouse Copyright Extension Act is unlikely to occur any
time soon.
> If they are copyright (even if open/free) you would be
> potentially liable for prosecution since you are copying
> someone else's work.
That's a rather negative way of looking at it.
Copyright infringement is typically handled through the civil courts:
the legal authorities don't press charges for copying (except, perhaps,
in the case of large-scale piracy of manufactured goods like fake
designer handbags, movie DVDs, etc). Rather, the copyright owner has to
sue you. If the copyright owner is explicitly giving you the right to
copy and modify the software, which is the case for FOSS (Free Open
Source Software), then you have nothing to fear so long as you have a
valid licence.
If you have a valid licence to use and copy the software, and you obey
the licence terms, then you are in no danger of being prosecuted for
copyright infringement because you are licenced to do so.
> Even if it is open source then at the very least
> you should include a comment to the effect that
> the code is based on, say, M Palin's file parrot.py
> or whatever.
Giving credit might be good from an ethical point of view, but it may
not be either necessary or sufficient (depending on the licence).
Some examples:
The MIT and BSD licences do not explicitly require you to credit the
author, but they do require you to include a copy of the original
author's copyright and licence in your work:
https://en.wikipedia.org/wiki/BSD_licenses
https://en.wikipedia.org/wiki/MIT_License
If you choose to give credit as a courtesy, that's fine, but you must be
careful as to do so in such a way that you avoid giving the impression
that the author endorses or is responsible for your work.
Good: "MyApp, by me, with a big thank you to J. Cleese for
his spam library."
Bad: "MyApp with spam by J. Cleese!"
On the other hand, the GPL requires more than just credit, it requires
that (with some exceptions, including fair use) if you duplicate their
code, that your code in turn must be released under the GPL as well.
Merely giving credit is in no way sufficient.
And on the gripping hand, you have ultra-permissive public-domain like
licences such as the creative commons CC0 or the Toybox licence:
https://en.wikipedia.org/wiki/Public-domain-equivalent_license
neither of which require credit be given.
Regardless of the licence, you must obey the conditions (whether they
are minimal, as in the MIT licence, or onerous and difficult as in most
proprietary licences) in order to be legally permitted to copy the work.
But if you have a licence to copy, then of course you may copy according
to the terms of the licence.
In a practical sense, copying trivial amounts of code from software
licenced under the MIT licence, or similar, would be highly unlikely to
get you sued. For starters, the author would have to know you copied it,
and care, and track you down in real life, and sue you. And if the code
snippet was small enough, you could defend on the basis of fair use.
(Although more and more jurisdictions are taking a hard-line, minimalist
approach to fair use, allowing it effectively only for the purposes of
satire. Or even not acknowledging a fair use right at all.)
Another factor may be that, regardless of the *actual* legal risk, some
employers may not allow copying or use of (some or all) FOSS software
even if licenced, because they may fear the unknown, or they believe
anti-GPL propoganda ("its a virus that means you will have to give up
your intellectual property"), ethical reasons (copying without
attribution may be plagiarism), or possibly even for legitimate legal
reasons ("the GPL is not compatible with our licence").
Bottom line: yes, you can legally copy FOSS software, under certain
conditions, and need not fear being prosecuted.
(Actually, you could even copy closed-source proprietary software, if
you have a licence allowing you to do so.)
--
Steve
More information about the Tutor
mailing list