Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#20937 closed Uncategorized (invalid)

pytz pauses 4 sec the 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


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:

I see first the following output:

Usage: subcommand [options] [args]

  -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
                        A directory to add to the Python path, e.g.
  --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 ' help <subcommand>' for help on a specific subcommand.

Available subcommands:


... (I skip the rest here)

If I uninstall
then I don't have this strange pause

Change History (9)

comment:1 Changed 5 years ago by Tim Graham

Resolution: worksforme
Status: newclosed

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 5 years ago by anonymous


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 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 install in the unpacked source dir
    • with easy_install
    the pause is here again.
  • if I reinstall pytz with pip install , then I have no problems! , the pause is gone.

Seems like a satanic dependency :-)

comment:3 Changed 5 years ago by antonxx@…

Resolution: worksforme
Status: closednew

Here another information:.

I type 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\", line 10, in <module>
  File "D:\Programme\python27\lib\site-packages\django\core\management\__init__.
py", line 453, in execute_from_command_line
  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\", line 5
3, in __getattr__
  File "D:\Programme\python27\lib\site-packages\django\conf\", line 4
9, in _setup
  File "D:\Programme\python27\lib\site-packages\django\conf\", line 7
1, in _configure_logging
    from django.utils.log import DEFAULT_LOGGING
  File "D:\Programme\python27\lib\site-packages\django\utils\", line 6, in
    from django.views.debug import ExceptionReporter, get_exception_reporter_fil
  File "D:\Programme\python27\lib\site-packages\django\views\", line 11,
 in <module>
    from django.http import (HttpResponse, HttpResponseServerError,
  File "D:\Programme\python27\lib\site-packages\django\http\", line 4
, in <module>
    from django.http.response import (HttpResponse, StreamingHttpResponse,
  File "D:\Programme\python27\lib\site-packages\django\http\", line 1
7, in <module>
    from django.utils import six, timezone
  File "D:\Programme\python27\lib\site-packages\django\utils\", line
11, in <module>
    import pytz
  File "build\bdist.win32\egg\pytz\", line 1103, in <module>
  File "build\bdist.win32\egg\pytz\", line 107, in resource_exists
  File "build\bdist.win32\egg\pytz\", line 100, in open_resource
  File "build\bdist.win32\egg\", line 950, in resource_stream
  File "build\bdist.win32\egg\", line 250, in get_provider
  File "build\bdist.win32\egg\", line 1602, in __init__
  File "build\bdist.win32\egg\", line 1583, in build_zipmanifest

  File "D:\Programme\python27\lib\", line 766, in __init__
  File "D:\Programme\python27\lib\", line 842, in _RealGetContents
    x.comment =[_CD_COMMENT_LENGTH])

does anybody have an idea?

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


comment:4 Changed 5 years 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 5 years ago by Tim Graham

Resolution: invalid
Status: newclosed

Please see this link for ways to get help; this ticket tracker isn't the proper channel, thanks.

comment:6 Changed 5 years ago by Aymeric Augustin

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 5 years 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 and do a python 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 5 years ago by Łukasz Rekucki

comment:9 Changed 5 years ago by anton

I checked it with,
and I can confirm that it works now.

Note: See TracTickets for help on using tickets.
Back to Top