From: SourceForge.net <no...@so...> - 2012-12-29 23:09:54
|
Bugs item #3598893, was opened at 2012-12-29 15:09 Message generated for change (Tracker Item Submitted) made by arfrever You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422030&aid=3598893&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Arfrever (arfrever) Assigned to: Nobody/Anonymous (nobody) Summary: --stylesheet and --stylesheet-path options broken Initial Comment: --stylesheet and --stylesheet-path options in Docutils 0.10 are broken with Python 2. This bug does not occur with Python 3. $ PYTHONPATH="." python2.7 tools/buildhtml.py --stylesheet-path=docutils/writers/html4css1/html4css1.css Usage ===== buildhtml.py [options] [<directory> ...] buildhtml.py: error: Error in option "--stylesheet-path": AttributeError: 'str' object has no attribute 'pop' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422030&aid=3598893&group_id=38414 |
From: SourceForge.net <no...@so...> - 2012-12-30 21:48:09
|
Bugs item #3598893, was opened at 2012-12-29 15:09 Message generated for change (Comment added) made by arfrever You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422030&aid=3598893&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Arfrever (arfrever) Assigned to: Nobody/Anonymous (nobody) Summary: --stylesheet and --stylesheet-path options broken Initial Comment: --stylesheet and --stylesheet-path options in Docutils 0.10 are broken with Python 2. This bug does not occur with Python 3. $ PYTHONPATH="." python2.7 tools/buildhtml.py --stylesheet-path=docutils/writers/html4css1/html4css1.css Usage ===== buildhtml.py [options] [<directory> ...] buildhtml.py: error: Error in option "--stylesheet-path": AttributeError: 'str' object has no attribute 'pop' ---------------------------------------------------------------------- >Comment By: Arfrever (arfrever) Date: 2012-12-30 13:48 Message: The attached patch fixes this bug. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422030&aid=3598893&group_id=38414 |
From: SourceForge.net <no...@so...> - 2012-12-31 13:13:26
|
Bugs item #3598893, was opened at 2012-12-29 15:09 Message generated for change (Comment added) made by grubert You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422030&aid=3598893&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open >Resolution: Fixed Priority: 5 Private: No Submitted By: Arfrever (arfrever) >Assigned to: engelbert gruber (grubert) Summary: --stylesheet and --stylesheet-path options broken Initial Comment: --stylesheet and --stylesheet-path options in Docutils 0.10 are broken with Python 2. This bug does not occur with Python 3. $ PYTHONPATH="." python2.7 tools/buildhtml.py --stylesheet-path=docutils/writers/html4css1/html4css1.css Usage ===== buildhtml.py [options] [<directory> ...] buildhtml.py: error: Error in option "--stylesheet-path": AttributeError: 'str' object has no attribute 'pop' ---------------------------------------------------------------------- >Comment By: engelbert gruber (grubert) Date: 2012-12-31 05:13 Message: fixed only validate_comma_separated_list replacing isinstance(value, unicode) with hasattr(value, 'pop') buildhtml calls this function 5 times with unicode once with str Questions a) use isinstacne or hasattr ? b) how to test for this in python3, where "a" is unicode too ? c) is buildhtmls usage correct ? therefore still open ---------------------------------------------------------------------- Comment By: Arfrever (arfrever) Date: 2012-12-30 13:48 Message: The attached patch fixes this bug. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422030&aid=3598893&group_id=38414 |
From: SourceForge.net <no...@so...> - 2013-01-01 09:36:32
|
Bugs item #3598893, was opened at 2012-12-29 15:09 Message generated for change (Comment added) made by arfrever You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422030&aid=3598893&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: Fixed Priority: 5 Private: No Submitted By: Arfrever (arfrever) Assigned to: engelbert gruber (grubert) Summary: --stylesheet and --stylesheet-path options broken Initial Comment: --stylesheet and --stylesheet-path options in Docutils 0.10 are broken with Python 2. This bug does not occur with Python 3. $ PYTHONPATH="." python2.7 tools/buildhtml.py --stylesheet-path=docutils/writers/html4css1/html4css1.css Usage ===== buildhtml.py [options] [<directory> ...] buildhtml.py: error: Error in option "--stylesheet-path": AttributeError: 'str' object has no attribute 'pop' ---------------------------------------------------------------------- >Comment By: Arfrever (arfrever) Date: 2013-01-01 01:36 Message: The original patch was tested successfully with both Python 2 and 3. You need to set PYTHONPATH correctly: $ rm -fr build $ python3.3 setup.py build $ PYTHONPATH="build/lib" python3.3 tools/buildhtml.py --stylesheet-path=docutils/writers/html4css1/html4css1.css A. isinstance() is the recommended way to test types of variables. B. setup.py runs 2to3 on docutils and test directories. Converted files are placed in ${build_directory}/lib/docutils (e.g. build/lib/docutils) and test3 directories. 2to3 replaces both unicode and basestring with str. $ echo "isinstance(value, unicode)" | 2to3 - 2>/dev/null --- <stdin> (original) +++ <stdin> (refactored) @@ -1 +1 @@ -isinstance(value, unicode) +isinstance(value, str) $ echo "isinstance(value, basestring)" | 2to3 - 2>/dev/null --- <stdin> (original) +++ <stdin> (refactored) @@ -1 +1 @@ -isinstance(value, basestring) +isinstance(value, str) $ C. Yes. ---------------------------------------------------------------------- Comment By: engelbert gruber (grubert) Date: 2012-12-31 05:13 Message: fixed only validate_comma_separated_list replacing isinstance(value, unicode) with hasattr(value, 'pop') buildhtml calls this function 5 times with unicode once with str Questions a) use isinstacne or hasattr ? b) how to test for this in python3, where "a" is unicode too ? c) is buildhtmls usage correct ? therefore still open ---------------------------------------------------------------------- Comment By: Arfrever (arfrever) Date: 2012-12-30 13:48 Message: The attached patch fixes this bug. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422030&aid=3598893&group_id=38414 |
From: SourceForge.net <no...@so...> - 2013-01-01 09:51:22
|
Bugs item #3598893, was opened at 2012-12-29 15:09 Message generated for change (Comment added) made by arfrever You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422030&aid=3598893&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: Fixed Priority: 5 Private: No Submitted By: Arfrever (arfrever) Assigned to: engelbert gruber (grubert) Summary: --stylesheet and --stylesheet-path options broken Initial Comment: --stylesheet and --stylesheet-path options in Docutils 0.10 are broken with Python 2. This bug does not occur with Python 3. $ PYTHONPATH="." python2.7 tools/buildhtml.py --stylesheet-path=docutils/writers/html4css1/html4css1.css Usage ===== buildhtml.py [options] [<directory> ...] buildhtml.py: error: Error in option "--stylesheet-path": AttributeError: 'str' object has no attribute 'pop' ---------------------------------------------------------------------- >Comment By: Arfrever (arfrever) Date: 2013-01-01 01:51 Message: By the way, a unicode type is named "str" in Python 3: str in Python 2 == bytes in Python 3 unicode in Python 2 == str in Python 3 $ python2.7 -c 'print(type("a"))' <type 'str'> $ python2.7 -c 'print(type(b"a"))' <type 'str'> $ python2.7 -c 'print(type(u"a"))' <type 'unicode'> $ python3.3 -c 'print(type(b"a"))' <class 'bytes'> $ python3.3 -c 'print(type("a"))' <class 'str'> ---------------------------------------------------------------------- Comment By: Arfrever (arfrever) Date: 2013-01-01 01:36 Message: The original patch was tested successfully with both Python 2 and 3. You need to set PYTHONPATH correctly: $ rm -fr build $ python3.3 setup.py build $ PYTHONPATH="build/lib" python3.3 tools/buildhtml.py --stylesheet-path=docutils/writers/html4css1/html4css1.css A. isinstance() is the recommended way to test types of variables. B. setup.py runs 2to3 on docutils and test directories. Converted files are placed in ${build_directory}/lib/docutils (e.g. build/lib/docutils) and test3 directories. 2to3 replaces both unicode and basestring with str. $ echo "isinstance(value, unicode)" | 2to3 - 2>/dev/null --- <stdin> (original) +++ <stdin> (refactored) @@ -1 +1 @@ -isinstance(value, unicode) +isinstance(value, str) $ echo "isinstance(value, basestring)" | 2to3 - 2>/dev/null --- <stdin> (original) +++ <stdin> (refactored) @@ -1 +1 @@ -isinstance(value, basestring) +isinstance(value, str) $ C. Yes. ---------------------------------------------------------------------- Comment By: engelbert gruber (grubert) Date: 2012-12-31 05:13 Message: fixed only validate_comma_separated_list replacing isinstance(value, unicode) with hasattr(value, 'pop') buildhtml calls this function 5 times with unicode once with str Questions a) use isinstacne or hasattr ? b) how to test for this in python3, where "a" is unicode too ? c) is buildhtmls usage correct ? therefore still open ---------------------------------------------------------------------- Comment By: Arfrever (arfrever) Date: 2012-12-30 13:48 Message: The attached patch fixes this bug. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422030&aid=3598893&group_id=38414 |
From: SourceForge.net <no...@so...> - 2013-01-01 20:06:57
|
Bugs item #3598893, was opened at 2012-12-29 15:09 Message generated for change (Settings changed) made by grubert You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422030&aid=3598893&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed Resolution: Fixed Priority: 5 Private: No Submitted By: Arfrever (arfrever) Assigned to: engelbert gruber (grubert) Summary: --stylesheet and --stylesheet-path options broken Initial Comment: --stylesheet and --stylesheet-path options in Docutils 0.10 are broken with Python 2. This bug does not occur with Python 3. $ PYTHONPATH="." python2.7 tools/buildhtml.py --stylesheet-path=docutils/writers/html4css1/html4css1.css Usage ===== buildhtml.py [options] [<directory> ...] buildhtml.py: error: Error in option "--stylesheet-path": AttributeError: 'str' object has no attribute 'pop' ---------------------------------------------------------------------- Comment By: Arfrever (arfrever) Date: 2013-01-01 01:51 Message: By the way, a unicode type is named "str" in Python 3: str in Python 2 == bytes in Python 3 unicode in Python 2 == str in Python 3 $ python2.7 -c 'print(type("a"))' <type 'str'> $ python2.7 -c 'print(type(b"a"))' <type 'str'> $ python2.7 -c 'print(type(u"a"))' <type 'unicode'> $ python3.3 -c 'print(type(b"a"))' <class 'bytes'> $ python3.3 -c 'print(type("a"))' <class 'str'> ---------------------------------------------------------------------- Comment By: Arfrever (arfrever) Date: 2013-01-01 01:36 Message: The original patch was tested successfully with both Python 2 and 3. You need to set PYTHONPATH correctly: $ rm -fr build $ python3.3 setup.py build $ PYTHONPATH="build/lib" python3.3 tools/buildhtml.py --stylesheet-path=docutils/writers/html4css1/html4css1.css A. isinstance() is the recommended way to test types of variables. B. setup.py runs 2to3 on docutils and test directories. Converted files are placed in ${build_directory}/lib/docutils (e.g. build/lib/docutils) and test3 directories. 2to3 replaces both unicode and basestring with str. $ echo "isinstance(value, unicode)" | 2to3 - 2>/dev/null --- <stdin> (original) +++ <stdin> (refactored) @@ -1 +1 @@ -isinstance(value, unicode) +isinstance(value, str) $ echo "isinstance(value, basestring)" | 2to3 - 2>/dev/null --- <stdin> (original) +++ <stdin> (refactored) @@ -1 +1 @@ -isinstance(value, basestring) +isinstance(value, str) $ C. Yes. ---------------------------------------------------------------------- Comment By: engelbert gruber (grubert) Date: 2012-12-31 05:13 Message: fixed only validate_comma_separated_list replacing isinstance(value, unicode) with hasattr(value, 'pop') buildhtml calls this function 5 times with unicode once with str Questions a) use isinstacne or hasattr ? b) how to test for this in python3, where "a" is unicode too ? c) is buildhtmls usage correct ? therefore still open ---------------------------------------------------------------------- Comment By: Arfrever (arfrever) Date: 2012-12-30 13:48 Message: The attached patch fixes this bug. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422030&aid=3598893&group_id=38414 |