{"action":"created","issue":{"url":"https://api.github.com/repos/WoLpH/python-progressbar/issues/182","repository_url":"https://api.github.com/repos/WoLpH/python-progressbar","labels_url":"https://api.github.com/repos/WoLpH/python-progressbar/issues/182/labels{/name}","comments_url":"https://api.github.com/repos/WoLpH/python-progressbar/issues/182/comments","events_url":"https://api.github.com/repos/WoLpH/python-progressbar/issues/182/events","html_url":"https://github.com/WoLpH/python-progressbar/issues/182","id":390657859,"node_id":"MDU6SXNzdWUzOTA2NTc4NTk=","number":182,"title":"Failing test with python 3.7 (and two that seem to be armv7 specific)","user":{"login":"sanjayankur31","id":102575,"node_id":"MDQ6VXNlcjEwMjU3NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/102575?v=4","gravatar_id":"","url":"https://api.github.com/users/sanjayankur31","html_url":"https://github.com/sanjayankur31","followers_url":"https://api.github.com/users/sanjayankur31/followers","following_url":"https://api.github.com/users/sanjayankur31/following{/other_user}","gists_url":"https://api.github.com/users/sanjayankur31/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjayankur31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjayankur31/subscriptions","organizations_url":"https://api.github.com/users/sanjayankur31/orgs","repos_url":"https://api.github.com/users/sanjayankur31/repos","events_url":"https://api.github.com/users/sanjayankur31/events{/privacy}","received_events_url":"https://api.github.com/users/sanjayankur31/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-12-13T12:31:09Z","updated_at":"2018-12-16T18:02:24Z","closed_at":null,"author_association":"NONE","body":"#### Description\r\n\r\nWhile building for Fedora 30, which has py3.7, we get these test failures:\r\n\r\n```\r\n============================= test session starts ==============================\r\nplatform linux -- Python 3.7.1, pytest-3.9.3, py-1.7.0, pluggy-0.8.0\r\nrootdir: /builddir/build/BUILD/progressbar2-3.38.0, inifile: pytest.ini\r\nplugins: pep8-1.0.6, flakes-4.0.0, cov-2.5.1\r\ncollected 183 items\r\nexamples.py ..                                                           [  0%]\r\nsetup.py ..                                                              [  1%]\r\nprogressbar/__init__.py ..                                               [  1%]\r\nprogressbar/__about__.py ..                                              [  2%]\r\nprogressbar/bar.py .....                                                 [  4%]\r\nprogressbar/base.py ..                                                   [  4%]\r\nprogressbar/shortcuts.py ..                                              [  5%]\r\nprogressbar/utils.py ..                                                  [  6%]\r\nprogressbar/widgets.py ...F                                              [  7%]\r\ntests/conftest.py ..                                                     [  8%]\r\ntests/test_custom_widgets.py ....                                        [  9%]\r\ntests/test_data.py ..............                                        [ 16%]\r\ntests/test_data_transfer_bar.py ....                                     [ 18%]\r\ntests/test_empty.py ....                                                 [ 20%]\r\ntests/test_end.py ....                                                   [ 21%]\r\ntests/test_failure.py .................                                  [ 30%]\r\ntests/test_flush.py ...                                                  [ 31%]\r\ntests/test_iterators.py ........                                         [ 35%]\r\ntests/test_large_values.py ....                                          [ 37%]\r\ntests/test_misc.py ...                                                   [ 38%]\r\ntests/test_monitor_progress.py ......                                    [ 40%]\r\ntests/test_progressbar.py .....                                          [ 43%]\r\ntests/test_samples.py .....                                              [ 45%]\r\ntests/test_speed.py ................                                     [ 53%]\r\ntests/test_stream.py ........                                            [ 57%]\r\ntests/test_terminal.py .............                                     [ 63%]\r\ntests/test_timed.py ........                                             [ 67%]\r\ntests/test_timer.py ....                                                 [ 69%]\r\ntests/test_unicode.py ........                                           [ 73%]\r\ntests/test_unknown_length.py .....                                       [ 75%]\r\ntests/test_widgets.py ........FF                                         [ 80%]\r\ntests/test_with.py .....\r\n=================================== FAILURES ===================================\r\n__________________ [doctest] progressbar.widgets.SamplesMixin __________________\r\n234     >>> class progress:\r\n235     ...     last_update_time = datetime.datetime.now()\r\n236     ...     value = 1\r\n237     ...     extra = dict()\r\n238 \r\n239     >>> samples = SamplesMixin(samples=2)\r\n240     >>> samples(progress, None, True)\r\n241     (None, None)\r\n242     >>> progress.last_update_time += datetime.timedelta(seconds=1)\r\n243     >>> samples(progress, None, True)\r\nExpected:\r\n    (datetime.timedelta(0, 1), 0)\r\nGot:\r\n    (datetime.timedelta(seconds=1), 0)\r\n/builddir/build/BUILD/progressbar2-3.38.0/progressbar/widgets.py:243: DocTestFailure\r\n____________________ test_all_widgets_large_values[1000000] ____________________\r\nmax_value = 1000000\r\n    @pytest.mark.parametrize('max_value', [10 ** 6, 10 ** 7])\r\n    def test_all_widgets_large_values(max_value):\r\n        widgets = [\r\n            progressbar.Timer(),\r\n            progressbar.ETA(),\r\n            progressbar.AdaptiveETA(),\r\n            progressbar.AbsoluteETA(),\r\n            progressbar.DataSize(),\r\n            progressbar.FileTransferSpeed(),\r\n            progressbar.AdaptiveTransferSpeed(),\r\n            progressbar.AnimatedMarker(),\r\n            progressbar.Counter(),\r\n            progressbar.Percentage(),\r\n            progressbar.FormatLabel('%(value)d/%(max_value)d'),\r\n            progressbar.SimpleProgress(),\r\n            progressbar.Bar(fill=lambda progress, data, width: '#'),\r\n            progressbar.ReverseBar(),\r\n            progressbar.BouncingBar(),\r\n            progressbar.FormatCustomText('Custom %(text)s', dict(text='text')),\r\n        ]\r\n        p = progressbar.ProgressBar(widgets=widgets, max_value=max_value)\r\n        p.update()\r\n        time.sleep(1)\r\n>       p.update()\r\ntests/test_widgets.py:113: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\nprogressbar/bar.py:589: in update\r\n    StdRedirectMixin.update(self, value=value)\r\nprogressbar/bar.py:146: in update\r\n    DefaultFdMixin.update(self, value=value)\r\nprogressbar/bar.py:68: in update\r\n    line = converters.to_unicode('\\r' + self._format_line())\r\nprogressbar/bar.py:518: in _format_line\r\n    widgets = ''.join(self._to_unicode(self._format_widgets()))\r\nprogressbar/bar.py:493: in _format_widgets\r\n    widget_output = converters.to_unicode(widget(self, data))\r\nprogressbar/widgets.py:356: in __call__\r\n    data['eta'] = utils.format_time(data['eta_seconds'])\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\ntimestamp = FakeDatetime(9999, 12, 31, 23, 59, 59, 999999)\r\nprecision = datetime.timedelta(seconds=1)\r\n    def format_time(timestamp, precision=datetime.timedelta(seconds=1)):\r\n        '''Formats timedelta/datetime/seconds\r\n    \r\n        >>> format_time('1')\r\n        '0:00:01'\r\n        >>> format_time(1.234)\r\n        '0:00:01'\r\n        >>> format_time(1)\r\n        '0:00:01'\r\n        >>> format_time(datetime.datetime(2000, 1, 2, 3, 4, 5, 6))\r\n        '2000-01-02 03:04:05'\r\n        >>> format_time(datetime.date(2000, 1, 2))\r\n        '2000-01-02'\r\n        >>> format_time(datetime.timedelta(seconds=3661))\r\n        '1:01:01'\r\n        >>> format_time(None)\r\n        '--:--:--'\r\n        >>> format_time(format_time)  # doctest: +ELLIPSIS\r\n        Traceback (most recent call last):\r\n            ...\r\n        TypeError: Unknown type ...\r\n    \r\n        '''\r\n        precision_seconds = precision.total_seconds()\r\n    \r\n        if isinstance(timestamp, six.string_types + six.integer_types + (float, )):\r\n            try:\r\n                castfunc = six.integer_types[-1]\r\n                timestamp = datetime.timedelta(seconds=castfunc(timestamp))\r\n            except OverflowError:  # pragma: no cover\r\n                timestamp = None\r\n    \r\n        if isinstance(timestamp, datetime.timedelta):\r\n            seconds = timestamp.total_seconds()\r\n            # Truncate the number to the given precision\r\n            seconds = seconds - (seconds % precision_seconds)\r\n    \r\n            return str(datetime.timedelta(seconds=seconds))\r\n        elif isinstance(timestamp, datetime.datetime):\r\n            # Python 2 doesn't have the timestamp method\r\n            if hasattr(timestamp, 'timestamp'):  # pragma: no cover\r\n>               seconds = timestamp.timestamp()\r\nE               OverflowError: timestamp out of range for platform time_t\r\n/usr/lib/python3.7/site-packages/python_utils/time.py:77: OverflowError\r\n----------------------------- Captured stderr call -----------------------------\r\n\r\n                                                                               \r\n\r\nElapsed Time: 0:00:00ETA:  --:--:--ETA:  --:--:--Estimated finish time:  ----/--/-- --:--:--  0.0 B  0.0 s/B  0.0 s/B/0N/A%0/10000000 of 1000000||||||Custom text\r\n                                                                               \r\n___________________ test_all_widgets_large_values[10000000] ____________________\r\nmax_value = 10000000\r\n    @pytest.mark.parametrize('max_value', [10 ** 6, 10 ** 7])\r\n    def test_all_widgets_large_values(max_value):\r\n        widgets = [\r\n            progressbar.Timer(),\r\n            progressbar.ETA(),\r\n            progressbar.AdaptiveETA(),\r\n            progressbar.AbsoluteETA(),\r\n            progressbar.DataSize(),\r\n            progressbar.FileTransferSpeed(),\r\n            progressbar.AdaptiveTransferSpeed(),\r\n            progressbar.AnimatedMarker(),\r\n            progressbar.Counter(),\r\n            progressbar.Percentage(),\r\n            progressbar.FormatLabel('%(value)d/%(max_value)d'),\r\n            progressbar.SimpleProgress(),\r\n            progressbar.Bar(fill=lambda progress, data, width: '#'),\r\n            progressbar.ReverseBar(),\r\n            progressbar.BouncingBar(),\r\n            progressbar.FormatCustomText('Custom %(text)s', dict(text='text')),\r\n        ]\r\n        p = progressbar.ProgressBar(widgets=widgets, max_value=max_value)\r\n        p.update()\r\n        time.sleep(1)\r\n>       p.update()\r\ntests/test_widgets.py:113: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\nprogressbar/bar.py:589: in update\r\n    StdRedirectMixin.update(self, value=value)\r\nprogressbar/bar.py:146: in update\r\n    DefaultFdMixin.update(self, value=value)\r\nprogressbar/bar.py:68: in update\r\n    line = converters.to_unicode('\\r' + self._format_line())\r\nprogressbar/bar.py:518: in _format_line\r\n    widgets = ''.join(self._to_unicode(self._format_widgets()))\r\nprogressbar/bar.py:493: in _format_widgets\r\n    widget_output = converters.to_unicode(widget(self, data))\r\nprogressbar/widgets.py:356: in __call__\r\n    data['eta'] = utils.format_time(data['eta_seconds'])\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\ntimestamp = FakeDatetime(9999, 12, 31, 23, 59, 59, 999999)\r\nprecision = datetime.timedelta(seconds=1)\r\n    def format_time(timestamp, precision=datetime.timedelta(seconds=1)):\r\n        '''Formats timedelta/datetime/seconds\r\n    \r\n        >>> format_time('1')\r\n        '0:00:01'\r\n        >>> format_time(1.234)\r\n        '0:00:01'\r\n        >>> format_time(1)\r\n        '0:00:01'\r\n        >>> format_time(datetime.datetime(2000, 1, 2, 3, 4, 5, 6))\r\n        '2000-01-02 03:04:05'\r\n        >>> format_time(datetime.date(2000, 1, 2))\r\n        '2000-01-02'\r\n        >>> format_time(datetime.timedelta(seconds=3661))\r\n        '1:01:01'\r\n        >>> format_time(None)\r\n        '--:--:--'\r\n        >>> format_time(format_time)  # doctest: +ELLIPSIS\r\n        Traceback (most recent call last):\r\n            ...\r\n        TypeError: Unknown type ...\r\n    \r\n        '''\r\n        precision_seconds = precision.total_seconds()\r\n    \r\n        if isinstance(timestamp, six.string_types + six.integer_types + (float, )):\r\n            try:\r\n                castfunc = six.integer_types[-1]\r\n                timestamp = datetime.timedelta(seconds=castfunc(timestamp))\r\n            except OverflowError:  # pragma: no cover\r\n                timestamp = None\r\n    \r\n        if isinstance(timestamp, datetime.timedelta):\r\n            seconds = timestamp.total_seconds()\r\n            # Truncate the number to the given precision\r\n            seconds = seconds - (seconds % precision_seconds)\r\n    \r\n            return str(datetime.timedelta(seconds=seconds))\r\n        elif isinstance(timestamp, datetime.datetime):\r\n            # Python 2 doesn't have the timestamp method\r\n            if hasattr(timestamp, 'timestamp'):  # pragma: no cover\r\n>               seconds = timestamp.timestamp()\r\nE               OverflowError: timestamp out of range for platform time_t\r\n/usr/lib/python3.7/site-packages/python_utils/time.py:77: OverflowError\r\n----------------------------- Captured stderr call -----------------------------\r\n\r\n                                                                               \r\n\r\nElapsed Time: 0:00:00ETA:  --:--:--ETA:  --:--:--Estimated finish time:  ----/--/-- --:--:--  0.0 B  0.0 s/B  0.0 s/B/0N/A%0/100000000 of 10000000||||||Custom text\r\n                                                                               \r\n==================== 3 failed, 180 passed in 17.35 seconds =====================\r\n```\r\n\r\nI can reproduce the first failure here in a fresh py3.7 virtual environment on my x86_64 machine. The other two with the overflows appear to be arm specific?\r\n\r\n#### Versions\r\n\r\n- Python version: `import sys; print(sys.version)`\r\n\r\nThis is from the virtual environment:\r\n$ python -c 'import sys; print (sys.version)'\r\n3.7.1 (default, Nov 23 2018, 10:01:49) \r\n[GCC 8.2.1 20181105 (Red Hat 8.2.1-5)]\r\n\r\nFedora 30 is also at Python 3.7.1. The complete build failure log is attached: \r\n[build.txt](https://github.com/WoLpH/python-progressbar/files/2675942/build.txt)\r\n\r\n\r\n- Python distribution/environment: CPython\r\n- Operating System: Fedora 29 x86_64 for the first failure, Fedora 30 armv7 for the second one.\r\n- Package version: `import progressbar; print(progressbar.__version__)`: 3.38.0\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/WoLpH/python-progressbar/issues/comments/447663249","html_url":"https://github.com/WoLpH/python-progressbar/issues/182#issuecomment-447663249","issue_url":"https://api.github.com/repos/WoLpH/python-progressbar/issues/182","id":447663249,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzY2MzI0OQ==","user":{"login":"WoLpH","id":270571,"node_id":"MDQ6VXNlcjI3MDU3MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/270571?v=4","gravatar_id":"","url":"https://api.github.com/users/WoLpH","html_url":"https://github.com/WoLpH","followers_url":"https://api.github.com/users/WoLpH/followers","following_url":"https://api.github.com/users/WoLpH/following{/other_user}","gists_url":"https://api.github.com/users/WoLpH/gists{/gist_id}","starred_url":"https://api.github.com/users/WoLpH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WoLpH/subscriptions","organizations_url":"https://api.github.com/users/WoLpH/orgs","repos_url":"https://api.github.com/users/WoLpH/repos","events_url":"https://api.github.com/users/WoLpH/events{/privacy}","received_events_url":"https://api.github.com/users/WoLpH/received_events","type":"User","site_admin":false},"created_at":"2018-12-16T18:02:24Z","updated_at":"2018-12-16T18:02:24Z","author_association":"OWNER","body":"That's great to hear :)\r\n\r\nIt should be noted that it's still fully backwards compatible with the original module so users should have no issues switching. "}}
{"actor":{"display_login":"WoLpH"}}