Code

Opened 8 months ago

Closed 8 months ago

Last modified 6 months ago

#20937 closed Uncategorized (invalid)

pytz pauses 4 sec the manage.py output

Reported by: antonxx@… Owned by: nobody
Component: Uncategorized Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Today I made a strange observation.

After having reinstalled all my python and django stuff,
I went to my django project and typed at the console:

manage.py

I see first the following output:

D:\tmp\djangotest\djtest>manage.py
Usage: manage.py subcommand [options] [args]

Options:
  -v VERBOSITY, --verbosity=VERBOSITY
                        Verbosity level; 0=minimal output, 1=normal output,
                        2=verbose output, 3=very verbose output
  --settings=SETTINGS   The Python path to a settings module, e.g.
                        "myproject.settings.main". If this isn't provided, the
                        DJANGO_SETTINGS_MODULE environment variable will be
                        used.
  --pythonpath=PYTHONPATH
                        A directory to add to the Python path, e.g.
                        "/home/djangoprojects/myproject".
  --traceback           Print traceback on exception
  --version             show program's version number and exit
  -h, --help            show this help message and exit

then I have a pause of 4 sec...
and the output continues with

Type 'manage.py help <subcommand>' for help on a specific subcommand.

Available subcommands:

[auth]
    changepassword
    createsuperuser

[django]
    cleanup
...
... (I skip the rest here)

If I uninstall https://pypi.python.org/pypi/pytz/2013b
then I don't have this strange pause

Attachments (0)

Change History (9)

comment:1 Changed 8 months ago by timo

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed

I can't seem to reproduce this using Django 1.5.2 (or master) and pytz 2013b. If you can provide more steps to reproduce and ensure it's not an issue with your machine, please reopen.

comment:2 Changed 8 months ago by anonymous

Hi,

I still do not really understand what happens.
Here are all my packages as shown by pip list
which I have on Windows 7 64 bit with python 2.7.5 (32bit):

babel (0.9.6)
Django (1.5.2)
docutils (0.11)
genshi (0.7)
ipython (1.0.0)
jinja2 (2.7)
lxml (3.2.3)
markupsafe (0.18)
matplotlib (1.3.0)
mercurial (2.7)
MySQL-python (1.2.3)
numpy (1.7.1)
pillow (2.1.0)
pip (1.4.1)
pygments (1.6)
pyparsing (2.0.1)
pyreadline (2.0)
python-dateutil (2.1)
python-ldap (2.4.13)
pytz (2013b)
pywin32 (218)
scipy (0.12.0)
setuptools (0.9.8)
six (1.3.0)
south (0.8.1)
sphinx (1.1.3)
trac (1.0.1)

I have made a python script for installing all that stuff.
Now whats happens:

  • if I type manage.py in my test django project (created from scratch) I get the 4 sec pause as mentioned above
  • if I uninstall pytz, and retry the pause is gone.
  • if I reinstall pytz:
    • with setup.py install in the unpacked source dir
    • with easy_install pytz-2013b.zip
    the pause is here again.
  • if I reinstall pytz with pip install pytz-2013b.zip , then I have no problems! , the pause is gone.

Seems like a satanic dependency :-)

comment:3 Changed 8 months ago by antonxx@…

  • Resolution worksforme deleted
  • Status changed from closed to new

Here another information:.

I type manage.py and after 3 sec (before the 4 sec pause ends)
I interrupt the script by Ctrl-C and get the following traceback.

Traceback (most recent call last):
  File "D:\tmp\djangotest\djtest\manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "D:\Programme\python27\lib\site-packages\django\core\management\__init__.
py", line 453, in execute_from_command_line
    utility.execute()
  File "D:\Programme\python27\lib\site-packages\django\core\management\__init__.
py", line 376, in execute
    sys.stdout.write(self.main_help_text() + '\n')
  File "D:\Programme\python27\lib\site-packages\django\core\management\__init__.
py", line 242, in main_help_text
    for name, app in six.iteritems(get_commands()):
  File "D:\Programme\python27\lib\site-packages\django\core\management\__init__.
py", line 109, in get_commands
    apps = settings.INSTALLED_APPS
  File "D:\Programme\python27\lib\site-packages\django\conf\__init__.py", line 5
3, in __getattr__
    self._setup(name)
  File "D:\Programme\python27\lib\site-packages\django\conf\__init__.py", line 4
9, in _setup
    self._configure_logging()
  File "D:\Programme\python27\lib\site-packages\django\conf\__init__.py", line 7
1, in _configure_logging
    from django.utils.log import DEFAULT_LOGGING
  File "D:\Programme\python27\lib\site-packages\django\utils\log.py", line 6, in
 <module>
    from django.views.debug import ExceptionReporter, get_exception_reporter_fil
ter
  File "D:\Programme\python27\lib\site-packages\django\views\debug.py", line 11,
 in <module>
    from django.http import (HttpResponse, HttpResponseServerError,
  File "D:\Programme\python27\lib\site-packages\django\http\__init__.py", line 4
, in <module>
    from django.http.response import (HttpResponse, StreamingHttpResponse,
  File "D:\Programme\python27\lib\site-packages\django\http\response.py", line 1
7, in <module>
    from django.utils import six, timezone
  File "D:\Programme\python27\lib\site-packages\django\utils\timezone.py", line
11, in <module>
    import pytz
  File "build\bdist.win32\egg\pytz\__init__.py", line 1103, in <module>
  File "build\bdist.win32\egg\pytz\__init__.py", line 107, in resource_exists
  File "build\bdist.win32\egg\pytz\__init__.py", line 100, in open_resource
  File "build\bdist.win32\egg\pkg_resources.py", line 950, in resource_stream
  File "build\bdist.win32\egg\pkg_resources.py", line 250, in get_provider
  File "build\bdist.win32\egg\pkg_resources.py", line 1602, in __init__
  File "build\bdist.win32\egg\pkg_resources.py", line 1583, in build_zipmanifest

  File "D:\Programme\python27\lib\zipfile.py", line 766, in __init__
    self._RealGetContents()
  File "D:\Programme\python27\lib\zipfile.py", line 842, in _RealGetContents
    x.comment = fp.read(centdir[_CD_COMMENT_LENGTH])
KeyboardInterrupt

does anybody have an idea?

Please give a short look at it, if you still
have no idea then lets forget it.

Thanks.

comment:4 Changed 8 months ago by antonxx@…

sorry I forgot as last remark:

I have no direct internet access by python itself
(we are behind a company proxy, but I didn't get python
to go through it).

So its not possible to install packages with pip or easy_install
from the internet:
I have to download them first with my browser, and install from
the local files.

comment:5 Changed 8 months ago by timo

  • Resolution set to invalid
  • Status changed from new to closed

Please see this link for ways to get help; this ticket tracker isn't the proper channel, thanks. https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels

comment:6 Changed 8 months ago by aaugustin

In addition to what timo said, please check if typing "import pytz" in a python shell triggers the 4 second delay. If it does, it's a bug in pytz, not in Django.

comment:7 Changed 8 months ago by antonxx@…

Hi, I leave this ticket closed but I found the problem (more or less):

  • if pytz is installed as egg (all the pytz files are in the egg) then I have the 4 sec pause.
    This happens if I unzip pytz-2013b.zip and do a python setup.py install
  • if the files are installed normally in python27\Lib\site-packages\pytz\... then it works

I leave this message if somebody else stumles over this problem.

comment:8 Changed 8 months ago by lrekucki

comment:9 Changed 6 months ago by anton

I checked it with pytz-2013.7.zip,
and I can confirm that it works now.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.