1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/python-modules/scrapy/permissions-fix.patch
Tom Hunger 69363e9611 Move scrapy to its own module and add patch to fix broken permission code.
Scrapy is usually installed via pip where copying all permissions
makes sense. In Nix the files copied are owned by root and
readonly. As a consequence scrapy can't edit the project templates so

  scrapy startproject

fails.
2017-02-16 16:21:46 +00:00

29 lines
1 KiB
Diff

diff --git a/scrapy/commands/startproject.py b/scrapy/commands/startproject.py
index 5941066..89f8edb 100644
--- a/scrapy/commands/startproject.py
+++ b/scrapy/commands/startproject.py
@@ -4,7 +4,7 @@ import os
import string
from importlib import import_module
from os.path import join, exists, abspath
-from shutil import ignore_patterns, move, copy2, copystat
+from shutil import ignore_patterns, move, copyfile, copystat
import scrapy
from scrapy.commands import ScrapyCommand
@@ -76,8 +76,7 @@ class Command(ScrapyCommand):
if os.path.isdir(srcname):
self._copytree(srcname, dstname)
else:
- copy2(srcname, dstname)
- copystat(src, dst)
+ copyfile(srcname, dstname)
def run(self, args, opts):
if len(args) not in (1, 2):
@@ -118,4 +117,3 @@ class Command(ScrapyCommand):
_templates_base_dir = self.settings['TEMPLATES_DIR'] or \
join(scrapy.__path__[0], 'templates')
return join(_templates_base_dir, 'project')
-