Bug 233427 - www/google-sitemapgen: local variable referenced before assignment
Summary: www/google-sitemapgen: local variable referenced before assignment
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Tobias Kortkamp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-23 06:47 UTC by Vladyslav Movchan
Modified: 2018-11-23 10:27 UTC (History)
0 users

See Also:


Attachments
Patch (417 bytes, text/plain)
2018-11-23 06:47 UTC, Vladyslav Movchan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladyslav Movchan 2018-11-23 06:47:42 UTC
Created attachment 199471 [details]
Patch

When www/google-sitemapgen asked to build sitemap_index.xml it throws the following error:
Writing index file "sitemap_index.xml" with 13 Sitemaps
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 2092, in <module>
    sitemap.Generate()
  File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 1665, in Generate
    self.WriteIndex()
  File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 1810, in WriteIndex
    fd.write(sitemap_index_header)
UnboundLocalError: local variable 'sitemap_index_header' referenced before assignment

This caused by the typo (sitemap_index_header -> sitemap__index_header) in the source code of the upstream project. But due to upstream project is not maintained there is no way to submit this fix to upstream.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-11-23 10:16:53 UTC
A commit references this bug:

Author: tobik
Date: Fri Nov 23 10:16:15 UTC 2018
New revision: 485645
URL: https://svnweb.freebsd.org/changeset/ports/485645

Log:
  www/google-sitemapgen: Fix obvious typo

  It causes problems later:

  Writing index file "sitemap_index.xml" with 13 Sitemaps
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 2092, in <module>
      sitemap.Generate()
    File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 1665, in Generate
      self.WriteIndex()
    File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 1810, in WriteIndex
      fd.write(sitemap_index_header)
  UnboundLocalError: local variable 'sitemap_index_header' referenced before assignment

  PR:		233427
  Submitted by:	Vladislav Movchan <vladislav.movchan@gmail.com>

Changes:
  head/www/google-sitemapgen/Makefile
  head/www/google-sitemapgen/files/patch-sitemap__gen.py
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-11-23 10:27:02 UTC
A commit references this bug:

Author: tobik
Date: Fri Nov 23 10:26:25 UTC 2018
New revision: 485646
URL: https://svnweb.freebsd.org/changeset/ports/485646

Log:
  MFH: r485645

  www/google-sitemapgen: Fix obvious typo

  It causes problems later:

  Writing index file "sitemap_index.xml" with 13 Sitemaps
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 2092, in <module>
      sitemap.Generate()
    File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 1665, in Generate
      self.WriteIndex()
    File "/usr/local/lib/python2.7/site-packages/sitemap_gen.py", line 1810, in WriteIndex
      fd.write(sitemap_index_header)
  UnboundLocalError: local variable 'sitemap_index_header' referenced before assignment

  PR:		233427
  Submitted by:	Vladislav Movchan <vladislav.movchan@gmail.com>

  Approved by:	ports-secteam blanket

Changes:
_U  branches/2018Q4/
  branches/2018Q4/www/google-sitemapgen/Makefile
  branches/2018Q4/www/google-sitemapgen/files/patch-sitemap__gen.py