<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to bugs</title><link href="https://sourceforge.net/p/formencode/bugs/" rel="alternate"/><link href="https://sourceforge.net/p/formencode/bugs/feed.atom" rel="self"/><id>https://sourceforge.net/p/formencode/bugs/</id><updated>2012-08-09T14:03:28Z</updated><subtitle>Recent changes to bugs</subtitle><entry><title>Mandatory checkbox</title><link href="https://sourceforge.net/p/formencode/bugs/121/" rel="alternate"/><published>2012-08-09T14:03:28Z</published><updated>2012-08-09T14:03:28Z</updated><author><name>Matthieu Pepin</name><uri>https://sourceforge.net/u/mattpepin/</uri></author><id>https://sourceforge.net17b746fe7b7f04871ae7eaee4a9e6f652453e910</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;At the moment, Bool and StringBool are always valid and not_empty=True has no effect. This is unfortunate because it is not possible to have a simple checkbox on a form that the user must check to comply.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>url that includes ip address not working</title><link href="https://sourceforge.net/p/formencode/bugs/120/" rel="alternate"/><published>2012-02-07T16:56:00Z</published><updated>2012-02-07T16:56:00Z</updated><author><name>drmaples</name><uri>https://sourceforge.net/u/drmaples/</uri></author><id>https://sourceforge.nete501ee9b6e447cd757e952ebec576bcce66c9b2f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;URL validator fails with url "http://65.18.195.155/cgi-ordoro/bo/start.cgi"&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Current All compound validator behaves like Pipe</title><link href="https://sourceforge.net/p/formencode/bugs/119/" rel="alternate"/><published>2011-09-24T17:51:18Z</published><updated>2011-09-24T17:51:18Z</updated><author><name>Alessandro Molina</name><uri>https://sourceforge.net/u/amolsf/</uri></author><id>https://sourceforge.net04aa0e1baafe1bb9167c280df15eaed54fb2c2a4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;This leads to various issues like:&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; All(validators=[Int, Bool]).to_python('yes')&lt;br /&gt;
1&lt;/p&gt;
&lt;p&gt;even though it should fail as yes is 'yes' not an Int.&lt;/p&gt;
&lt;p&gt;Also the fact that FormEncode mixes validation and conversion is an issue in All.&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; All(validators=[Int, Bool]).to_python('1')&lt;br /&gt;
1&lt;/p&gt;
&lt;p&gt;I get 1 even though I probably wanted a True. &lt;br /&gt;
Currently All is an inverse Pipe with an odd name.&lt;/p&gt;
&lt;p&gt;A proposed solution is to add a "converter" parameter to All, in the case this parameter is available the validators are applied on the original value instead of being used on the output of the previous validator and only converter is used to provide the requested output.&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; All(validators=[Int, Bool], converter=Bool).to_python('yes')&lt;br /&gt;
Invalid&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; All(validators=[Int, Bool], converter=Bool).to_python('1')&lt;br /&gt;
True&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Compound validators are inconsistent</title><link href="https://sourceforge.net/p/formencode/bugs/118/" rel="alternate"/><published>2011-09-14T17:43:18Z</published><updated>2011-09-14T17:43:18Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net160d739b256afac660282f7263cea63488d4faf8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The three compound validators—Any, All, and Pipe—process their subvalidators in reverse order depending on the direction of conversion. But Pipe reverses them for from_python, while Any and All reverse them for to_python.&lt;/p&gt;
&lt;p&gt;Moreover, the documentation for Any claims that the “first validator/converter that validates the value will be used”, whereas (from the user’s point of view) it’s the last one.&lt;/p&gt;
&lt;p&gt;For consistency, all compound validators should process self.vaidators in direct order for to_python.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>test suite fails with python 2.7</title><link href="https://sourceforge.net/p/formencode/bugs/117/" rel="alternate"/><published>2011-05-28T14:31:44Z</published><updated>2011-05-28T14:31:44Z</updated><author><name>Daniel</name><uri>https://sourceforge.net/u/fetchinson/</uri></author><id>https://sourceforge.net7fa1e393ab67fe4bd846c82ecec129b22f564405</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;python 2.7.1&lt;br /&gt;
formencode head (or whatever is the name of the top of the hg tree)&lt;br /&gt;
nose 1.0.0&lt;/p&gt;
&lt;p&gt;[fetchinson@fetch formencode]$ python2.7 -c "import nose; nose.run_exit( )"&lt;br /&gt;
......EEEE.EE.....................................F...................................................................................&lt;br /&gt;
======================================================================&lt;br /&gt;
ERROR: tests.test_htmlfill.test_inputoutput('/home/nogradi/files/python/svn/formencode-py3k.hg/tests/htmlfill_data/data-fill1.txt',)&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
File "/usr/local/lib/python2.7/site-packages/nose-1.0.0-py2.7.egg/nose/case.py", line 187, in runTest&lt;br /&gt;
self.test(*self.arg)&lt;br /&gt;
File "/home/nogradi/files/python/svn/formencode-py3k.hg/tests/test_htmlfill.py", line 68, in run_filename&lt;br /&gt;
output_xml = ET.XML(output)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1282, in XML&lt;br /&gt;
parser.feed(text)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1624, in feed&lt;br /&gt;
self._raiseerror(v)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1488, in _raiseerror&lt;br /&gt;
raise err&lt;br /&gt;
ParseError: not well-formed (invalid token): line 1, column 9&lt;/p&gt;
&lt;p&gt;======================================================================&lt;br /&gt;
ERROR: tests.test_htmlfill.test_inputoutput('/home/nogradi/files/python/svn/formencode-py3k.hg/tests/htmlfill_data/data-error1.txt',)&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
File "/usr/local/lib/python2.7/site-packages/nose-1.0.0-py2.7.egg/nose/case.py", line 187, in runTest&lt;br /&gt;
self.test(*self.arg)&lt;br /&gt;
File "/home/nogradi/files/python/svn/formencode-py3k.hg/tests/test_htmlfill.py", line 68, in run_filename&lt;br /&gt;
output_xml = ET.XML(output)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1282, in XML&lt;br /&gt;
parser.feed(text)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1624, in feed&lt;br /&gt;
self._raiseerror(v)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1488, in _raiseerror&lt;br /&gt;
raise err&lt;br /&gt;
ParseError: not well-formed (invalid token): line 2, column 5&lt;/p&gt;
&lt;p&gt;======================================================================&lt;br /&gt;
ERROR: tests.test_htmlfill.test_inputoutput('/home/nogradi/files/python/svn/formencode-py3k.hg/tests/htmlfill_data/data-schema1.txt',)&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
File "/usr/local/lib/python2.7/site-packages/nose-1.0.0-py2.7.egg/nose/case.py", line 187, in runTest&lt;br /&gt;
self.test(*self.arg)&lt;br /&gt;
File "/home/nogradi/files/python/svn/formencode-py3k.hg/tests/test_htmlfill.py", line 68, in run_filename&lt;br /&gt;
output_xml = ET.XML(output)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1282, in XML&lt;br /&gt;
parser.feed(text)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1624, in feed&lt;br /&gt;
self._raiseerror(v)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1488, in _raiseerror&lt;br /&gt;
raise err&lt;br /&gt;
ParseError: mismatched tag: line 8, column 2&lt;/p&gt;
&lt;p&gt;======================================================================&lt;br /&gt;
ERROR: tests.test_htmlfill.test_inputoutput('/home/nogradi/files/python/svn/formencode-py3k.hg/tests/htmlfill_data/data-fill4.txt',)&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
File "/usr/local/lib/python2.7/site-packages/nose-1.0.0-py2.7.egg/nose/case.py", line 187, in runTest&lt;br /&gt;
self.test(*self.arg)&lt;br /&gt;
File "/home/nogradi/files/python/svn/formencode-py3k.hg/tests/test_htmlfill.py", line 68, in run_filename&lt;br /&gt;
output_xml = ET.XML(output)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1283, in XML&lt;br /&gt;
return parser.close()&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1636, in close&lt;br /&gt;
self._raiseerror(v)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1488, in _raiseerror&lt;br /&gt;
raise err&lt;br /&gt;
ParseError: no element found: line 13, column 0&lt;/p&gt;
&lt;p&gt;======================================================================&lt;br /&gt;
ERROR: tests.test_htmlfill.test_inputoutput('/home/nogradi/files/python/svn/formencode-py3k.hg/tests/htmlfill_data/data-fill3.txt',)&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
File "/usr/local/lib/python2.7/site-packages/nose-1.0.0-py2.7.egg/nose/case.py", line 187, in runTest&lt;br /&gt;
self.test(*self.arg)&lt;br /&gt;
File "/home/nogradi/files/python/svn/formencode-py3k.hg/tests/test_htmlfill.py", line 68, in run_filename&lt;br /&gt;
output_xml = ET.XML(output)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1282, in XML&lt;br /&gt;
parser.feed(text)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1624, in feed&lt;br /&gt;
self._raiseerror(v)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1488, in _raiseerror&lt;br /&gt;
raise err&lt;br /&gt;
ParseError: mismatched tag: line 5, column 2&lt;/p&gt;
&lt;p&gt;======================================================================&lt;br /&gt;
ERROR: tests.test_htmlfill.test_inputoutput('/home/nogradi/files/python/svn/formencode-py3k.hg/tests/htmlfill_data/data-fill2.txt',)&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
File "/usr/local/lib/python2.7/site-packages/nose-1.0.0-py2.7.egg/nose/case.py", line 187, in runTest&lt;br /&gt;
self.test(*self.arg)&lt;br /&gt;
File "/home/nogradi/files/python/svn/formencode-py3k.hg/tests/test_htmlfill.py", line 68, in run_filename&lt;br /&gt;
output_xml = ET.XML(output)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1282, in XML&lt;br /&gt;
parser.feed(text)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1624, in feed&lt;br /&gt;
self._raiseerror(v)&lt;br /&gt;
File "/usr/local/lib/python2.7/xml/etree/ElementTree.py", line 1488, in _raiseerror&lt;br /&gt;
raise err&lt;br /&gt;
ParseError: syntax error: line 1, column 54&lt;/p&gt;
&lt;p&gt;======================================================================&lt;br /&gt;
FAIL: tests.test_htmlgen.test_comment&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
File "/usr/local/lib/python2.7/site-packages/nose-1.0.0-py2.7.egg/nose/case.py", line 187, in runTest&lt;br /&gt;
self.test(*self.arg)&lt;br /&gt;
File "/home/nogradi/files/python/svn/formencode-py3k.hg/tests/test_htmlgen.py", line 52, in test_comment&lt;br /&gt;
assert str(html.comment('test')) == '&amp;lt;!-- test --&amp;gt;'&lt;br /&gt;
AssertionError: &lt;/p&gt;
&lt;p&gt;----------------------------------------------------------------------&lt;br /&gt;
Ran 134 tests in 0.216s&lt;/p&gt;
&lt;p&gt;FAILED (errors=6, failures=1)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>IPAddress allowing bad octets</title><link href="https://sourceforge.net/p/formencode/bugs/116/" rel="alternate"/><published>2011-05-12T17:57:37Z</published><updated>2011-05-12T17:57:37Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net137de21ac7e70af3ddb1d85fb628a7589002da85</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The IPAddress validator is allowing IP addresses of this form: "219.080.004.150" &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Schema with UnicodeString item behaves unclearly</title><link href="https://sourceforge.net/p/formencode/bugs/115/" rel="alternate"/><published>2011-02-13T13:25:46Z</published><updated>2011-02-13T13:25:46Z</updated><author><name>Max </name><uri>https://sourceforge.net/u/maxavanov/</uri></author><id>https://sourceforge.netf615ad17f0651db336dec4821f9e9cc15901d6f4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Here's an example.&lt;/p&gt;
&lt;p&gt;# =====================&lt;br /&gt;
from formencode import Schema, Invalid&lt;br /&gt;
from formencode.validators import UnicodeString, Int&lt;br /&gt;
from webob import Request&lt;/p&gt;
&lt;p&gt;class StrictSchema(Schema):&lt;br /&gt;
allow_extra_fields = False&lt;/p&gt;
&lt;p&gt;class IntegerTestSchema(StrictSchema):&lt;br /&gt;
testfield = Int(not_empty=True)&lt;/p&gt;
&lt;p&gt;class StringTestSchema(StrictSchema):&lt;br /&gt;
testfield = UnicodeString(not_empty=True)&lt;/p&gt;
&lt;p&gt;# Testing.&lt;br /&gt;
# =====================&lt;br /&gt;
req = Request.blank('/?testfield=111')&lt;br /&gt;
print IntegerTestSchema.to_python(req.params)&lt;/p&gt;
&lt;p&gt;# This raises an exception&lt;br /&gt;
req = Request.blank('/?testfield=111&amp;amp;testfield=222')&lt;br /&gt;
try:&lt;br /&gt;
IntegerTestSchema.to_python(req.params)&lt;br /&gt;
except Invalid as e:&lt;br /&gt;
print "Caught Exception: {0}".format(e)&lt;/p&gt;
&lt;p&gt;req = Request.blank('/?testfield=aaa')&lt;br /&gt;
print StringTestSchema.to_python(req.params)&lt;/p&gt;
&lt;p&gt;# This will be passed successfully (!)&lt;br /&gt;
# The output will be {'testfield': u"[u'aaa', u'bbb']"}&lt;br /&gt;
req = Request.blank('/?testfield=aaa&amp;amp;testfield=bbb')&lt;br /&gt;
print StringTestSchema.to_python(req.params)&lt;/p&gt;
&lt;p&gt;# ========================&lt;/p&gt;
&lt;p&gt;Please note we do not use formencode.ForEach() or formencode.Set()&lt;br /&gt;
here. I think this is very unclear behaviour. &lt;/p&gt;
&lt;p&gt;This behavior happens because mixed is used here - &lt;a href="https://bitbucket.org/ianb/formencode/src/d95237b33f3c/formencode/api.py#cl-403" rel="nofollow"&gt;https://bitbucket.org/ianb/formencode/src/d95237b33f3c/formencode/api.py#cl-403&lt;/a&gt;&lt;br /&gt;
For example, if we'd have an unified behaviour for all single-value validators (Int, UnicodeString, Bool etc.) we could get "[u'John', u'Mike']" result only for "/?username=[u'John', u'Mike']" request. But now, we can get the same result by the two different requests - by "/?username=[u'John', u'Mike']" and by "/? username=John&amp;amp;username=Mike". This shouldn't be allowed.&lt;/p&gt;
&lt;p&gt;Original discussion has been started here - &lt;a href="http://groups.google.com/group/pylons-discuss/browse_thread/thread/ccbfeac4c12d3a9b" rel="nofollow"&gt;http://groups.google.com/group/pylons-discuss/browse_thread/thread/ccbfeac4c12d3a9b&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>requireifpresent with timeconverter</title><link href="https://sourceforge.net/p/formencode/bugs/114/" rel="alternate"/><published>2011-01-10T10:22:08Z</published><updated>2011-01-10T10:22:08Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net7f7860cbca1176f628ee9bfda3f9910e937f12c9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;if a TimeConverter field is used with RequireIfPresent and a time in format '0:0' is given the form give a missing error&lt;/p&gt;
&lt;p&gt;hch = fe.validators.TimeConverter(use_datetime=True, use_seconds=False)&lt;br /&gt;
chained_validators = [&lt;br /&gt;
fe.validators.RequireIfPresent(present='mane_id', required='hin')&lt;br /&gt;
]&lt;/p&gt;
&lt;p&gt;the problem is at row 2648 of the validator.py module&lt;/p&gt;
&lt;p&gt;if is_required and not value_dict.get(self.required):&lt;/p&gt;
&lt;p&gt;this row I think must be:&lt;/p&gt;
&lt;p&gt;if is_required and value_dict.get(self.required) is None:&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>formencode.api.set_stdtranslation stopped working in 1.2.3</title><link href="https://sourceforge.net/p/formencode/bugs/113/" rel="alternate"/><published>2011-01-08T23:42:35Z</published><updated>2011-01-08T23:42:35Z</updated><author><name>Juliusz Gonera</name><uri>https://sourceforge.net/u/julas/</uri></author><id>https://sourceforge.net38a9e3a06e88d2f563a57048863c892a90b53fb1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I use Pylons 1.0 and in environment.py I put:&lt;br /&gt;
formencode.api.set_stdtranslation(domain='FormEncode', languages=['pl'])&lt;br /&gt;
to get Polish messages.&lt;/p&gt;
&lt;p&gt;It worked in 1.2.2 but stopped working in 1.2.3dev and I always get English messages.&lt;br /&gt;
I use uwsgi for deployment if that matters.&lt;/p&gt;
&lt;p&gt;Sorry for the duplicate, please remove the one submitted by "nobody."&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>formencode.api.set_stdtranslation stopped working in 1.2.3</title><link href="https://sourceforge.net/p/formencode/bugs/112/" rel="alternate"/><published>2011-01-08T23:40:29Z</published><updated>2011-01-08T23:40:29Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net3eef53344568f9d2c164a22bce6ab608f6884f01</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I use Pylons 1.0 and in environment.py I put:&lt;br /&gt;
formencode.api.set_stdtranslation(domain='FormEncode', languages=['pl'])&lt;br /&gt;
to get Polish messages.&lt;/p&gt;
&lt;p&gt;It worked in 1.2.2 but stopped working in 1.2.3dev and I always get English messages.&lt;br /&gt;
I use uwsgi for deployment if that matters.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>