Gentoo Archives: gentoo-python

From: Nikolaj Sjujskij <sterkrig@×××××××.com>
To: gentoo-python@l.g.o, IAN DELANEY <della5@×××××××××.au>
Subject: Re: [gentoo-python] recent trend of django-foo tests
Date: Tue, 21 May 2013 10:43:01
Message-Id: op.wxfj1tn2h7emz2@verkdatorn.npdb
In Reply to: Re: [gentoo-python] recent trend of django-foo tests by IAN DELANEY
1 Den 2013-05-21 21:35:24 skrev IAN DELANEY <della5@×××××××××.au>:
2
3 > On Tue, 21 May 2013 12:56:50 +0400
4 > "Nikolaj Sjujskij" <sterkrig@×××××××.com> wrote:
5 >
6 >> Den 2013-05-20 20:37:53 skrev IAN DELANEY <della5@×××××××××.au>:
7 >>
8 >>> Ja, tack tack for att forsoka, med nej. (Please add the grammatical
9 >>> nice-ities to the vowel o).
10 >> I've got bad news for you: actually my native language is Russian :)
11 >>
12 > Oh dear, more bad news, this isn't a good week. Header read;
13 > "Den 2013-05-20 20:37:53 skrev"
14 > Den is 'the', skrev is wrote in swedish.
15 Yep, my email client speaks Swedish :)
16
17 >>> I got a fix from #django on the second
18 >>> attempt. I was close on the first attempt, so for the benefit of
19 >>> all,
20 >>>
21 >>> first export SECRET_KEY='green', followed by
22 >>>
23 >>> - "from django.conf import \
24 >>> global_settings;global_settings.SECRET_KEY='green'" ${test}
25 >>> + "from django.conf import \
26 >>> global_settings;global_settings.SECRET_KEY='$SECRET_KEY'" ${test}
27 > well I'm open to an explanation too, but in brief, he said set the key
28 > in bash, then on a second attempt on re-reading my query more closely,
29 > he corrected it to the above. An alternate was SECRET_KEY="green"
30 > python -c ..., that is pre-pending the setting of the secret key to the
31 > call to python, which should work if you try. I settled for the above.
32 I mean, python should ignore (and it does for me) arguments after -c
33 option, however you do that in bash:
34
35 % python global_settings.py
36 <module 'django.conf.global_settings' from
37 '/usr/lib64/python2.7/site-packages/django/conf/global_settings.pyc'>
38
39 % python -c "print('$LANG')" global_settings.py
40 ru_RU.UTF-8
41
42 I'm not sure you understand my code snippets correctly. I demonstrate how
43 python ignores "global_settings.py" argument and doesn't run the script
44 whose name was passed after `-c <python code>` option.
45
46 >> I positively fail to see how that change could fix anything.
47 >> % python global_settings.py
48 >> <module 'django.conf.global_settings' from
49 >> '/usr/lib64/python2.7/site-packages/django/conf/global_settings.pyc'>
50 >>
51 > I'm guessing here the manufactured global_settings.py could be used
52 > effectively, I'd have to go back and try some more to do so. But hey
53 > thx for the effort.
54 >> % python -c 'import sys; print sys.platform' global_settings.py
55 >> linux2
56 >>
57 >>> and presto.
58 >>>
59 >>> * python2_7: running distutils-r1_run_phase python_test
60 >>> * test test_compiler.py passed under python2.7
61 >>> * test test_compressor.py passed under python2.7
62 >>> another bug bites the dust.
63 >> Well, if that somehow had worked, it's all right, I guess.
64 >>
65 > a good news snippet to offset the bad. What can I say?
66 I'm just pointing out that I for one can't understand what's happening
67 there and why it seems to work while it shouldn't. Therefore it may break
68 again unexpectedly, so just keep that in mind :)