Index: /pyyaml/trunk/ext/_yaml.pyx
===================================================================
--- /pyyaml/trunk/ext/_yaml.pyx	(revision 348)
+++ /pyyaml/trunk/ext/_yaml.pyx	(revision 350)
@@ -1381,5 +1381,12 @@
         anchor = NULL
         if anchor_object is not None:
-            anchor = PyString_AS_STRING(PyUnicode_AsUTF8String(anchor_object))
+            if PyUnicode_CheckExact(anchor_object):
+                anchor_object = PyUnicode_AsUTF8String(anchor_object)
+            if not PyString_CheckExact(anchor_object):
+                if PY_MAJOR_VERSION < 3:
+                    raise TypeError("anchor must be a string")
+                else:
+                    raise TypeError(u"anchor must be a string")
+            anchor = PyString_AS_STRING(anchor_object)
         if node in self.serialized_nodes:
             if yaml_alias_event_initialize(&event, anchor) == 0:
Index: /pyyaml/trunk/tests/lib/test_constructor.py
===================================================================
--- /pyyaml/trunk/tests/lib/test_constructor.py	(revision 330)
+++ /pyyaml/trunk/tests/lib/test_constructor.py	(revision 350)
@@ -18,5 +18,5 @@
             AnObject, AnInstance, AState, ACustomState, InitArgs, InitArgsWithState,    \
             NewArgs, NewArgsWithState, Reduce, ReduceWithState, MyInt, MyList, MyDict,  \
-            FixedOffset, execute
+            FixedOffset, today, execute
 
     class MyLoader(yaml.Loader):
@@ -213,4 +213,6 @@
         def dst(self, dt):
             return datetime.timedelta(0)
+
+    today = datetime.date.today()
 
 def _load_code(expression):
Index: /pyyaml/trunk/tests/data/aliases-cdumper-bug.code
===================================================================
--- /pyyaml/trunk/tests/data/aliases-cdumper-bug.code	(revision 350)
+++ /pyyaml/trunk/tests/data/aliases-cdumper-bug.code	(revision 350)
@@ -0,0 +1,1 @@
+[ today, today ]
Index: /pyyaml/trunk/tests/lib3/test_constructor.py
===================================================================
--- /pyyaml/trunk/tests/lib3/test_constructor.py	(revision 330)
+++ /pyyaml/trunk/tests/lib3/test_constructor.py	(revision 350)
@@ -15,5 +15,5 @@
             AnObject, AnInstance, AState, ACustomState, InitArgs, InitArgsWithState,    \
             NewArgs, NewArgsWithState, Reduce, ReduceWithState, MyInt, MyList, MyDict,  \
-            FixedOffset, execute
+            FixedOffset, today, execute
 
     class MyLoader(yaml.Loader):
@@ -200,4 +200,6 @@
         def dst(self, dt):
             return datetime.timedelta(0)
+
+    today = datetime.date.today()
 
 def _load_code(expression):
